std_keyboard.zh#
Variables#
const int |
|
const int |
|
const int |
|
const int |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const char32 |
|
const int |
|
const int |
Functions#
char32 |
CheckKeyToChar(int key) |
bool |
ReadKey(int key) |
bool |
KeyPress(int key) |
char32 |
GetKeyPress(int key) |
bool |
|
bool |
|
bool |
PressAlt() |
bool |
CapsLock() |
bool |
NumLock() |
bool |
|
bool |
PressWin() |
bool |
|
bool |
|
bool |
|
bool |
|
bool |
|
bool |
AccentShift(int n) |
bool |
|
bool |
|
bool |
FKey(int f) |
bool |
EscKey() |
char32 |
KeyToChar(int key) |
char32 |
KeyToChar(int key, bool shifted) |
char32 |
KeyToChar(int key, bool shifted, bool caps) |
Enumerations#
KeyCode KEY_A = 1
KeyCode KEY_B = 2
KeyCode KEY_C = 3
KeyCode KEY_D = 4
KeyCode KEY_E = 5
KeyCode KEY_F = 6
KeyCode KEY_G = 7
KeyCode KEY_H = 8
KeyCode KEY_I = 9
KeyCode KEY_J = 10
KeyCode KEY_K = 11
KeyCode KEY_L = 12
KeyCode KEY_M = 13
KeyCode KEY_N = 14
KeyCode KEY_O = 15
KeyCode KEY_P = 16
KeyCode KEY_Q = 17
KeyCode KEY_R = 18
KeyCode KEY_S = 19
KeyCode KEY_T = 20
KeyCode KEY_U = 21
KeyCode KEY_V = 22
KeyCode KEY_W = 23
KeyCode KEY_X = 24
KeyCode KEY_Y = 25
KeyCode KEY_Z = 26
KeyCode KEY_0 = 27
KeyCode KEY_1 = 28
KeyCode KEY_2 = 29
KeyCode KEY_3 = 30
KeyCode KEY_4 = 31
KeyCode KEY_5 = 32
KeyCode KEY_6 = 33
KeyCode KEY_7 = 34
KeyCode KEY_8 = 35
KeyCode KEY_9 = 36
KeyCode KEY_0_PAD = 37
KeyCode KEY_1_PAD = 38
KeyCode KEY_2_PAD = 39
KeyCode KEY_3_PAD = 40
KeyCode KEY_4_PAD = 41
KeyCode KEY_5_PAD = 42
KeyCode KEY_6_PAD = 43
KeyCode KEY_7_PAD = 44
KeyCode KEY_8_PAD = 45
KeyCode KEY_9_PAD = 46
KeyCode KEY_F1 = 47
KeyCode KEY_F2 = 48
KeyCode KEY_F3 = 49
KeyCode KEY_F4 = 50
KeyCode KEY_F5 = 51
KeyCode KEY_F6 = 52
KeyCode KEY_F7 = 53
KeyCode KEY_F8 = 54
KeyCode KEY_F9 = 55
KeyCode KEY_F10 = 56
KeyCode KEY_F11 = 57
KeyCode KEY_F12 = 58
KeyCode KEY_ESC = 59
KeyCode KEY_TILDE = 60
KeyCode KEY_MINUS = 61
KeyCode KEY_EQUALS = 62
KeyCode KEY_BACKSPACE = 63
KeyCode KEY_TAB = 64
KeyCode KEY_OPENBRACE = 65
KeyCode KEY_CLOSEBRACE = 66
KeyCode KEY_ENTER = 67
KeyCode KEY_COLON = 68
KeyCode KEY_QUOTE = 69
KeyCode KEY_BACKSLASH = 70
KeyCode KEY_BACKSLASH2 = 71
KeyCode KEY_COMMA = 72
KeyCode KEY_STOP = 73
KeyCode KEY_SLASH = 74
KeyCode KEY_SPACE = 75
KeyCode KEY_INSERT = 76
KeyCode KEY_DEL = 77
KeyCode KEY_HOME = 78
KeyCode KEY_END = 79
KeyCode KEY_PGUP = 80
KeyCode KEY_PGDN = 81
KeyCode KEY_LEFT = 82
KeyCode KEY_RIGHT = 83
KeyCode KEY_UP = 84
KeyCode KEY_DOWN = 85
KeyCode KEY_SLASH_PAD = 86
KeyCode KEY_ASTERISK = 87
KeyCode KEY_MINUS_PAD = 88
KeyCode KEY_PLUS_PAD = 89
KeyCode KEY_DEL_PAD = 90
KeyCode KEY_ENTER_PAD = 91
KeyCode KEY_PRTSCR = 92
KeyCode KEY_PAUSE = 93
KeyCode KEY_ABNT_C1 = 94
KeyCode KEY_YEN = 95
KeyCode KEY_KANA = 96
KeyCode KEY_CONVERT = 97
KeyCode KEY_NOCONVERT = 98
KeyCode KEY_AT = 99
KeyCode KEY_CIRCUMFLEX = 100
KeyCode KEY_COLON2 = 101
KeyCode KEY_KANJI = 102
KeyCode KEY_EQUALS_PAD = 103
KeyCode KEY_BACKQUOTE = 104
KeyCode KEY_SEMICOLON = 105
KeyCode KEY_COMMAND = 106
KeyCode KEY_UNKNOWN1 = 107
KeyCode KEY_UNKNOWN2 = 108
KeyCode KEY_UNKNOWN3 = 109
KeyCode KEY_UNKNOWN4 = 110
KeyCode KEY_UNKNOWN5 = 111
KeyCode KEY_UNKNOWN6 = 112
KeyCode KEY_UNKNOWN7 = 113
KeyCode KEY_UNKNOWN8 = 114
KeyCode KEY_MODIFIERS = 115
KeyCode KEY_LSHIFT = 115
KeyCode KEY_RSHIFT = 116
KeyCode KEY_LCONTROL = 117
KeyCode KEY_RCONTROL = 118
KeyCode KEY_ALT = 119
KeyCode KEY_ALTGR = 120
KeyCode KEY_LWIN = 121
KeyCode KEY_RWIN = 122
KeyCode KEY_SCRLOCK = 124
KeyCode KEY_NUMLOCK = 125
KeyCode KEY_CAPSLOCK = 126
KeyCode KEY_MAX = 127
enum KeyModifierBitflags: 🔗 Source
KeyModifierBitflags KB_SHIFT_FLAG = 1
KeyModifierBitflags KB_CTRL_FLAG = 2
KeyModifierBitflags KB_ALT_FLAG = 4
KeyModifierBitflags KB_LWIN_FLAG = 8
KeyModifierBitflags KB_RWIN_FLAG = 16
KeyModifierBitflags KB_COMMAND_FLAG = 64
KeyModifierBitflags KB_SCROLOCK_FLAG = 256
KeyModifierBitflags KB_NUMLOCK_FLAG = 512
KeyModifierBitflags KB_CAPSLOCK_FLAG = 1024
KeyModifierBitflags KB_INALTSEQ_FLAG = 2048
KeyModifierBitflags KB_ACCENT1_FLAG = 4096
KeyModifierBitflags KB_ACCENT2_FLAG = 8192
KeyModifierBitflags KB_ACCENT3_FLAG = 16384
KeyModifierBitflags KB_ACCENT4_FLAG = 32768
Variable descriptions#
const int KEYBOARD_TYPE = 0
🔗 Source
0 == US, 1 == UK, 2 == EU/GR
const int KEYBOARD_LAYOUT_US = 0
🔗 Source
const int KEYBOARD_LAYOUT_UK = 1
🔗 Source
const int KEYBOARD_LAYOUT_EU = 2
🔗 Source
const char32 CHAR_ERROR = -1
🔗 Source
Special Circumstance Characters to store in strings if needed.
const char32 CHAR_BACKSPC = -2
🔗 Source
const char32 CHAR_DELETE = -4
🔗 Source
const char32 CHAR_HOMEKEY = -8
🔗 Source
const char32 CHAR_ENDKEY = -16
🔗 Source
const char32 CHAR_PAGEUP = -32
🔗 Source
const char32 CHAR_PAGEDOWN = -64
🔗 Source
const char32 CHAR_ARROW_U = -128
🔗 Source
const char32 CHAR_ARROW_L = -256
🔗 Source
const char32 CHAR_ARROW_D = -512
🔗 Source
const char32 CHAR_ARROW_R = -1024
🔗 Source
const char32 CHAR_PRINTSCREEN = -2048
🔗 Source
const char32 CHAR_PAUSE = -4096
🔗 Source
const char32 CHAR_NONE = 0
🔗 Source
const int ___KEY_TIMER = 255
🔗 Source
Index of ____STD_GRAM[]
const int KEYBOARD_REPEAT_RATE = 6
🔗 Source
frames per keypress. 3 == 1/20 second
Function descriptions#
char32 CheckKeyToChar(int key) 🔗 Source
const int SFX_KEYPRESS = 58; //Do we want this in the header? Checks if a key was pressed. If it was, it returns its char value. Returns CHAR_NONE / false if key was not pressed.
bool ReadKey(int key) 🔗 Source
These functions are meant to return ReadKey and Keypress, while setting the appropriate input blockers. I would like to add bool Input->ReadingKeyboard, which while true, stops key presses from being read as joystick inputs.
This should be a ZScript function, as Input->ReadKey() -Z
bool KeyPress(int key) 🔗 Source
char32 GetKeyPress(int key) 🔗 Source
Is this safe? Should we return 0, which is null? Returns modifier keys
bool PressControl() 🔗 Source
bool PressRightWin() 🔗 Source
bool PressLeftWin() 🔗 Source
bool PressCommand() 🔗 Source
bool InAltSequence() 🔗 Source
bool AccentShift(int n) 🔗 Source
Is this Linux only?
Input->DisableKey[] can be used to disable F keys, aside from F7,F8,F9.
char32 KeyToChar(int key) 🔗 Source
converts a key to its proper char (int, in ZScript).
char32 KeyToChar(int key, bool shifted) 🔗 Source
bool caps ==true : caps acts as shift, == false, standard
char32 KeyToChar(int key, bool shifted, bool caps) 🔗 Source