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

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


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

Input->DisableKey[] can be used to disable F keys, aside from F7,F8,F9.


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