So I Was messing around with keybinds today and could not find out why one of my keybind is not working until I printed everything, it printed that shift is 0, control is 2, right option is 3, left option is 4, which I assume that esc is 1. But why is this happening and how to differentiate numbers and those other keys?
We would need more context to your situation.
I'm assuming you're referring to the KeyCode enums you get from InputBegan/Ended? In that case, these numbers do not correspond with the values assigned to the enums that represent the keys in the KeyCode Enum Reference
Here are the enums you enquire and their values:
Enum.KeyCode.LeftShift
. Value: 304Enum.KeyCode.RightShift
. Value: 303Enum.KeyCode.LeftControl
. Value: 306Enum.KeyCode.RightControl
. Value: 305Unfortunately, after some testing, the Escape (esc) key is not detectable via InputBegan/Ended. Generally, you shouldn't use the Escape key as a keybind, but if your intentions are to do something when the roblox menu opens and closes, you can use the following events: