std_keyboard.zh#

Variables#

const int

KEYBOARD_TYPE

const int

KEYBOARD_LAYOUT_US

const int

KEYBOARD_LAYOUT_UK

const int

KEYBOARD_LAYOUT_EU

const char32

CHAR_ERROR

const char32

CHAR_BACKSPC

const char32

CHAR_DELETE

const char32

CHAR_HOMEKEY

const char32

CHAR_ENDKEY

const char32

CHAR_PAGEUP

const char32

CHAR_PAGEDOWN

const char32

CHAR_ARROW_U

const char32

CHAR_ARROW_L

const char32

CHAR_ARROW_D

const char32

CHAR_ARROW_R

const char32

CHAR_PRINTSCREEN

const char32

CHAR_PAUSE

const char32

CHAR_NONE

const int

___KEY_TIMER

const int

KEYBOARD_REPEAT_RATE

const int

KEY_A

const int

KEY_B

const int

KEY_C

const int

KEY_D

const int

KEY_E

const int

KEY_F

const int

KEY_G

const int

KEY_H

const int

KEY_I

const int

KEY_J

const int

KEY_K

const int

KEY_L

const int

KEY_M

const int

KEY_N

const int

KEY_O

const int

KEY_P

const int

KEY_Q

const int

KEY_R

const int

KEY_S

const int

KEY_T

const int

KEY_U

const int

KEY_V

const int

KEY_W

const int

KEY_X

const int

KEY_Y

const int

KEY_Z

const int

KEY_0

const int

KEY_1

const int

KEY_2

const int

KEY_3

const int

KEY_4

const int

KEY_5

const int

KEY_6

const int

KEY_7

const int

KEY_8

const int

KEY_9

const int

KEY_0_PAD

const int

KEY_1_PAD

const int

KEY_2_PAD

const int

KEY_3_PAD

const int

KEY_4_PAD

const int

KEY_5_PAD

const int

KEY_6_PAD

const int

KEY_7_PAD

const int

KEY_8_PAD

const int

KEY_9_PAD

const int

KEY_F1

const int

KEY_F2

const int

KEY_F3

const int

KEY_F4

const int

KEY_F5

const int

KEY_F6

const int

KEY_F7

const int

KEY_F8

const int

KEY_F9

const int

KEY_F10

const int

KEY_F11

const int

KEY_F12

const int

KEY_ESC

const int

KEY_TILDE

const int

KEY_MINUS

const int

KEY_EQUALS

const int

KEY_BACKSPACE

const int

KEY_TAB

const int

KEY_OPENBRACE

const int

KEY_CLOSEBRACE

const int

KEY_ENTER

const int

KEY_COLON

const int

KEY_QUOTE

const int

KEY_BACKSLASH

const int

KEY_BACKSLASH2

const int

KEY_COMMA

const int

KEY_STOP

const int

KEY_SLASH

const int

KEY_SPACE

const int

KEY_INSERT

const int

KEY_DEL

const int

KEY_HOME

const int

KEY_END

const int

KEY_PGUP

const int

KEY_PGDN

const int

KEY_LEFT

const int

KEY_RIGHT

const int

KEY_UP

const int

KEY_DOWN

const int

KEY_SLASH_PAD

const int

KEY_ASTERISK

const int

KEY_MINUS_PAD

const int

KEY_PLUS_PAD

const int

KEY_DEL_PAD

const int

KEY_ENTER_PAD

const int

KEY_PRTSCR

const int

KEY_PAUSE

const int

KEY_ABNT_C1

const int

KEY_YEN

const int

KEY_KANA

const int

KEY_CONVERT

const int

KEY_NOCONVERT

const int

KEY_AT

const int

KEY_CIRCUMFLEX

const int

KEY_COLON2

const int

KEY_KANJI

const int

KEY_EQUALS_PAD

const int

KEY_BACKQUOTE

const int

KEY_SEMICOLON

const int

KEY_COMMAND

const int

KEY_UNKNOWN1

const int

KEY_UNKNOWN2

const int

KEY_UNKNOWN3

const int

KEY_UNKNOWN4

const int

KEY_UNKNOWN5

const int

KEY_UNKNOWN6

const int

KEY_UNKNOWN7

const int

KEY_UNKNOWN8

const int

KEY_MODIFIERS

const int

KEY_LSHIFT

const int

KEY_RSHIFT

const int

KEY_LCONTROL

const int

KEY_RCONTROL

const int

KEY_ALT

const int

KEY_ALTGR

const int

KEY_LWIN

const int

KEY_RWIN

const int

KEY_MENU

const int

KEY_SCRLOCK

const int

KEY_NUMLOCK

const int

KEY_CAPSLOCK

const int

KEY_MAX

const int

KB_SHIFT_FLAG

const int

KB_CTRL_FLAG

const int

KB_ALT_FLAG

const int

KB_LWIN_FLAG

const int

KB_RWIN_FLAG

const int

KB_MENU_FLAG

const int

KB_COMMAND_FLAG

const int

KB_SCROLOCK_FLAG

const int

KB_NUMLOCK_FLAG

const int

KB_CAPSLOCK_FLAG

const int

KB_INALTSEQ_FLAG

const int

KB_ACCENT1_FLAG

const int

KB_ACCENT2_FLAG

const int

KB_ACCENT3_FLAG

const int

KB_ACCENT4_FLAG

Functions#

char32

CheckKeyToChar(int key)

bool

ReadKey(int key)

bool

KeyPress(int key)

char32

GetKeyPress(int key)

bool

PressShift()

bool

PressControl()

bool

PressAlt()

bool

CapsLock()

bool

NumLock()

bool

ScrollLock()

bool

PressWin()

bool

PressRightWin()

bool

PressLeftWin()

bool

PressApple()

bool

PressCommand()

bool

InAltSequence()

bool

AccentShift(int n)

bool

PressAltGR()

bool

PressLinuxMenu()

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_MENU = 123 🔗 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_MENU_FLAG = 32 🔗 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


const int KB_ACCENT4_FLAG = 32768 🔗 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


bool PressShift() 🔗 Source

Is this safe? Should we return 0, which is null? Returns modifier keys


bool PressControl() 🔗 Source


bool PressAlt() 🔗 Source


bool CapsLock() 🔗 Source


bool NumLock() 🔗 Source


bool ScrollLock() 🔗 Source


bool PressWin() 🔗 Source


bool PressRightWin() 🔗 Source


bool PressLeftWin() 🔗 Source


bool PressApple() 🔗 Source


bool PressCommand() 🔗 Source


bool InAltSequence() 🔗 Source


bool AccentShift(int n) 🔗 Source


bool PressAltGR() 🔗 Source


bool PressLinuxMenu() 🔗 Source

Is this Linux only?


bool FKey(int f) 🔗 Source

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


bool EscKey() 🔗 Source


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