Is it possible to use the "alt" key to act as an action key in an if function? Basically can I program this macro to be do something in my game and if I can, how would you call the key to be used? Would it just go as follows?
if key == "alt" then end
Since KeyDown doesn't detect most keys(other than alphas) on a keyboard, and KeyUp isn't exactly the most secure, I encourage you to use UserInputService with the InputBegan method.
The InputBegan method will allow you for better response, easier manipulation, and overall improved readability for your code.
So, if you looked at the link you may be asking, how do I detect if the Input was a key? since the InputBegan method returns an instance, rather than a string or byte code. You have to compare the returned statement with a KeyCode Enum.
So, we want to detect the Alt key?
game:GetService('UserInputService').InputBegan:connect(function(key) if key == Enum.KeyCode.LeftAlt then --Your Code Here end end)
Additionally, KeyCodes provide easy access to any key on the keyboard. And you don't have to look up some fancy chart on what the enum value would be.. want the right shift? Enum.KeyCode.RightShift, want A? Enum.KeyCode.A It's much easier to work with than KeyDown or KeyUp and referring to a byte table for character interpretations.