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 |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
const int |
|
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) |
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
const int KEY_A = 1
🔗 Source
Key Constants – !DO NOT MODIFY
const int KEY_B = 2
🔗 Source
const int KEY_C = 3
🔗 Source
const int KEY_D = 4
🔗 Source
const int KEY_E = 5
🔗 Source
const int KEY_F = 6
🔗 Source
const int KEY_G = 7
🔗 Source
const int KEY_H = 8
🔗 Source
const int KEY_I = 9
🔗 Source
const int KEY_J = 10
🔗 Source
const int KEY_K = 11
🔗 Source
const int KEY_L = 12
🔗 Source
const int KEY_M = 13
🔗 Source
const int KEY_N = 14
🔗 Source
const int KEY_O = 15
🔗 Source
const int KEY_P = 16
🔗 Source
const int KEY_Q = 17
🔗 Source
const int KEY_R = 18
🔗 Source
const int KEY_S = 19
🔗 Source
const int KEY_T = 20
🔗 Source
const int KEY_U = 21
🔗 Source
const int KEY_V = 22
🔗 Source
const int KEY_W = 23
🔗 Source
const int KEY_X = 24
🔗 Source
const int KEY_Y = 25
🔗 Source
const int KEY_Z = 26
🔗 Source
const int KEY_0 = 27
🔗 Source
const int KEY_1 = 28
🔗 Source
const int KEY_2 = 29
🔗 Source
const int KEY_3 = 30
🔗 Source
const int KEY_4 = 31
🔗 Source
const int KEY_5 = 32
🔗 Source
const int KEY_6 = 33
🔗 Source
const int KEY_7 = 34
🔗 Source
const int KEY_8 = 35
🔗 Source
const int KEY_9 = 36
🔗 Source
const int KEY_0_PAD = 37
🔗 Source
const int KEY_1_PAD = 38
🔗 Source
const int KEY_2_PAD = 39
🔗 Source
const int KEY_3_PAD = 40
🔗 Source
const int KEY_4_PAD = 41
🔗 Source
const int KEY_5_PAD = 42
🔗 Source
const int KEY_6_PAD = 43
🔗 Source
const int KEY_7_PAD = 44
🔗 Source
const int KEY_8_PAD = 45
🔗 Source
const int KEY_9_PAD = 46
🔗 Source
const int KEY_F1 = 47
🔗 Source
const int KEY_F2 = 48
🔗 Source
const int KEY_F3 = 49
🔗 Source
const int KEY_F4 = 50
🔗 Source
const int KEY_F5 = 51
🔗 Source
const int KEY_F6 = 52
🔗 Source
const int KEY_F7 = 53
🔗 Source
const int KEY_F8 = 54
🔗 Source
const int KEY_F9 = 55
🔗 Source
const int KEY_F10 = 56
🔗 Source
const int KEY_F11 = 57
🔗 Source
const int KEY_F12 = 58
🔗 Source
const int KEY_ESC = 59
🔗 Source
const int KEY_TILDE = 60
🔗 Source
const int KEY_MINUS = 61
🔗 Source
const int KEY_EQUALS = 62
🔗 Source
const int KEY_BACKSPACE = 63
🔗 Source
const int KEY_TAB = 64
🔗 Source
const int KEY_OPENBRACE = 65
🔗 Source
const int KEY_CLOSEBRACE = 66
🔗 Source
const int KEY_ENTER = 67
🔗 Source
const int KEY_COLON = 68
🔗 Source
const int KEY_QUOTE = 69
🔗 Source
const int KEY_BACKSLASH = 70
🔗 Source
const int KEY_BACKSLASH2 = 71
🔗 Source
const int KEY_COMMA = 72
🔗 Source
const int KEY_STOP = 73
🔗 Source
const int KEY_SLASH = 74
🔗 Source
const int KEY_SPACE = 75
🔗 Source
const int KEY_INSERT = 76
🔗 Source
const int KEY_DEL = 77
🔗 Source
const int KEY_HOME = 78
🔗 Source
const int KEY_END = 79
🔗 Source
const int KEY_PGUP = 80
🔗 Source
const int KEY_PGDN = 81
🔗 Source
const int KEY_LEFT = 82
🔗 Source
const int KEY_RIGHT = 83
🔗 Source
const int KEY_UP = 84
🔗 Source
const int KEY_DOWN = 85
🔗 Source
const int KEY_SLASH_PAD = 86
🔗 Source
const int KEY_ASTERISK = 87
🔗 Source
const int KEY_MINUS_PAD = 88
🔗 Source
const int KEY_PLUS_PAD = 89
🔗 Source
const int KEY_DEL_PAD = 90
🔗 Source
const int KEY_ENTER_PAD = 91
🔗 Source
const int KEY_PRTSCR = 92
🔗 Source
const int KEY_PAUSE = 93
🔗 Source
const int KEY_ABNT_C1 = 94
🔗 Source
const int KEY_YEN = 95
🔗 Source
const int KEY_KANA = 96
🔗 Source
const int KEY_CONVERT = 97
🔗 Source
const int KEY_NOCONVERT = 98
🔗 Source
const int KEY_AT = 99
🔗 Source
const int KEY_CIRCUMFLEX = 100
🔗 Source
const int KEY_COLON2 = 101
🔗 Source
const int KEY_KANJI = 102
🔗 Source
const int KEY_EQUALS_PAD = 103
🔗 Source
const int KEY_BACKQUOTE = 104
🔗 Source
const int KEY_SEMICOLON = 105
🔗 Source
const int KEY_COMMAND = 106
🔗 Source
const int KEY_UNKNOWN1 = 107
🔗 Source
const int KEY_UNKNOWN2 = 108
🔗 Source
const int KEY_UNKNOWN3 = 109
🔗 Source
const int KEY_UNKNOWN4 = 110
🔗 Source
const int KEY_UNKNOWN5 = 111
🔗 Source
const int KEY_UNKNOWN6 = 112
🔗 Source
const int KEY_UNKNOWN7 = 113
🔗 Source
const int KEY_UNKNOWN8 = 114
🔗 Source
const int KEY_MODIFIERS = 115
🔗 Source
const int KEY_LSHIFT = 115
🔗 Source
const int KEY_RSHIFT = 116
🔗 Source
const int KEY_LCONTROL = 117
🔗 Source
const int KEY_RCONTROL = 118
🔗 Source
const int KEY_ALT = 119
🔗 Source
const int KEY_ALTGR = 120
🔗 Source
const int KEY_LWIN = 121
🔗 Source
const int KEY_RWIN = 122
🔗 Source
const int KEY_SCRLOCK = 124
🔗 Source
const int KEY_NUMLOCK = 125
🔗 Source
const int KEY_CAPSLOCK = 126
🔗 Source
const int KEY_MAX = 127
🔗 Source
const int KB_SHIFT_FLAG = 1
🔗 Source
Key Modifier Constants – DO NOT MODIFY!
const int KB_CTRL_FLAG = 2
🔗 Source
const int KB_ALT_FLAG = 4
🔗 Source
const int KB_LWIN_FLAG = 8
🔗 Source
const int KB_RWIN_FLAG = 16
🔗 Source
const int KB_COMMAND_FLAG = 64
🔗 Source
const int KB_SCROLOCK_FLAG = 256
🔗 Source
const int KB_NUMLOCK_FLAG = 512
🔗 Source
const int KB_CAPSLOCK_FLAG = 1024
🔗 Source
const int KB_INALTSEQ_FLAG = 2048
🔗 Source
const int KB_ACCENT1_FLAG = 4096
🔗 Source
const int KB_ACCENT2_FLAG = 8192
🔗 Source
const int KB_ACCENT3_FLAG = 16384
🔗 Source
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?
Note that these keys are used by the ZC Ui. You can read them this way, but you should not expect a user to utilise them, for input, without some kind of interupt system. Input->DisableKey[] can be used to disable F keys, aside from F7,F8,F9. -V
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