Difference between revisions of "Legacy:Functions/Input/Keyboard"
From Spherical
< Legacy:Functions | Input
(created) |
(No difference)
|
Latest revision as of 23:06, 30 May 2013
Keyboard
Key code translation
- GetKeyString(key, shift): Converts the given key into a string, KEY_A will become "a", etc. If shift is true, returns uppercase/special value of key. Control keys return an empty string.
Key status
- IsAnyKeyPressed(): Check if any key is being held down.
- IsKeyPressed(key): Check if the given key is being held down.
- GetToggleState(key): Checks if Caps Lock, Num Lock or Scroll Lock are active.
- Allowed key values:
- KEY_CAPSLOCK
- KEY_NUMLOCK
- KEY_SCROLLOCK (Note: only two Ls)
Key queue
- AreKeysLeft(): Check if keys are left in the key buffer.
- GetKey(): Get a key from the key buffer, waits for one if there isn't.