Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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.

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 theking48989987 2147 — 5y

1 answer

Log in to vote
0
Answered by
SteamG00B 1633 Moderation Voter
5 years ago
Edited 5 years ago

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.

Ad

Answer this question