Legacy:Functions/Input/Keyboard

From Spherical
< Legacy:Functions‎ | Input
Revision as of 23:06, 30 May 2013 by Apollolux (talk | contribs) (created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

  • 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.