Skip to main content

Module input

Module input 

Source
Expand description

Input event ABI shared by host and guest.

Keys are numbered by position in KEY_NAMES (1-based; 0 = unknown). The names are DOM KeyboardEvent.code values, so web game code ports unchanged.

Modules§

kind

Structs§

RawEvent
One input event, as written by sg.input_poll (24 bytes, little endian).

Constants§

EVENT_SIZE
FLAG_REPEAT
KEY_NAMES
MOD_ALT
MOD_CTRL
MOD_META
MOD_SHIFT

Functions§

key_code
Returns the key number for a DOM code name.
key_name
Returns the DOM code name for a key number (“” if unknown).