Keyboard

Represent the Keyboard

Members

Enums

Code
enum Code

Supported Keyboard Codes. This are all possible keys.

Mod
enum Mod

All supported Keyboard modifiers.

ScanCode
enum ScanCode

Supported Keyboard ScanCodes. This are all possible keys.

State
enum State

Supported Keyboard States

Static functions

getModifier
Mod getModifier()

Returns the current Keyboard modifier.

getState
ubyte* getState()

Returns the pointer to the Keyboard state. With that you can check if some key is pressed without using a event queue. A value of 1 means that the key is pressed and a value of 0 means that it is not. The pointer will be valid for the whole lifetime of the application and should not be freed by the caller.

hasScreenSupport
bool hasScreenSupport()

Returns if screen keyboard is supported.

isPressed
bool isPressed(Code code)

Returns if the given Keyboard.Code is pressed.

isPressed
bool isPressed(ScanCode scancode)

Returns if the given Keyboard.ScanCode is pressed.

setModifier
void setModifier(Mod mod)

Set the current Keyboard modifier.

setTextInputRect
void setTextInputRect(ShortRect rect)

Use this function to set the rectangle used to type Unicode text inputs.

setTextInputRect
void setTextInputRect(ShortRect rect)

Rvalue version

startTextInput
void startTextInput()

Use this function to start accepting Unicode text input events

stopTextInput
void stopTextInput()

Use this function to stop receiving any text input events.

Meta