Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is the do I need to fill in for the Ctrl key?

So, I wanted to make a simple script, in which an animation plays when you press the "Ctrl" key on your keyboard. I only had no idea how to fill this in. Does somebody know?

PS: I don't mean the script, I just mean what the key is called, with shift it's called "46" or something.

1 comment

0

46 is just the enumeration value of a period, you can get use the actual name of it if you use browse through the Enum.KeyCodes table, also, here is the wiki page if you want to look at it : https://developer.roblox.com/api-reference/enum/KeyCode

1 answer

You can use this to find the keycode for the keys that are being pressed

    local UserInputService = game:GetService("UserInputService")
     
    local pressedkeys = UserInputService:GetKeysPressed()
     
    print("Keys pressed:")
    for _, inputObject in pairs (pressedkeys) do
    	print(inputObject.KeyCode)
    end

If this answers your question, just mark this as the accepted solution.

This discussion is preserved as it was. New answers, comments, and votes are closed.