Skip to main content

Module keys

Module keys 

Source
Expand description

Translation from macroquad key codes to shuyi-ui’s hardware-agnostic Key, collecting a frame’s keyboard events as RawInputEvents, and hearing what the window’s focus is made from (WindowHeard).

Functions§

fullscreen_shortcut
Whether the window’s fullscreen shortcut was pressed this frame: F11, or Alt+Enter. Like the window’s close button these belong to the platform, not to the game’s keymap (ticket 0902).
ordered
A frame’s key events in the order they happened, from what the window says of the frame: the keys released and pressed in it, and whether a key is down at its end. Releases come first (a key let go, then another pressed), then presses (with shift). A key both pressed and released in one frame was tapped if it is up at the end (pressed, then let go: its release comes after its press), or let go and pressed again if it is down; so a quick tap never reads as a key held down, which would repeat its action until the next release.
poll
This frame’s key events, in the order they happened (ordered), then the characters typed (for text boxes, with the keyboard’s layout).
to_key
The game key for a macroquad key code; None for keys the game ignores (bare modifiers, which only form Shift+ chords, and rare keys).