Validate and wrap a raw raylib key code.
Keys
:= []
Keys module - keyboard state and key constants.
Key state encoding uses one byte per key: - bit 0 = currently held - bit 1 = pressed this frame - bit 2 = released this frame
The host stores fixed-size state lists with one byte per raylib key code
0-348. Named keys cover the full raylib KeyboardKey enum. Use Raw(code)
through from_code when you need a backend-specific escape hatch.
raylib key code for a key (index into the Host key-state lists).
Check if a specific key is currently held down. Pass host directly.
Check if a specific key is currently not pressed (up). Pass host directly.
key_pressed : { ..state, keys : List(U8) }, KeyboardKey -> Bool
Check if a key was first pressed this frame. Pass host directly.
key_released : { ..state, keys : List(U8) }, KeyboardKey -> Bool
Check if a key was released this frame. Pass host directly.
KeyboardKey
:= [
KeyAndroidBack,
KeyAndroidMenu,
KeyVolumeUp,
KeyVolumeDown,
KeyApostrophe,
KeyComma,
KeyMinus,
KeyPeriod,
KeySlash,
Key0,
Key1,
Key2,
Key3,
Key4,
Key5,
Key6,
Key7,
Key8,
Key9,
KeySemicolon,
KeyEqual,
KeyA,
KeyB,
KeyC,
KeyD,
KeyE,
KeyF,
KeyG,
KeyH,
KeyI,
KeyJ,
KeyK,
KeyL,
KeyM,
KeyN,
KeyO,
KeyP,
KeyQ,
KeyR,
KeyS,
KeyT,
KeyU,
KeyV,
KeyW,
KeyX,
KeyY,
KeyZ,
KeyLeftBracket,
KeyBackslash,
KeyRightBracket,
KeyGrave,
KeySpace,
KeyEscape,
KeyEnter,
KeyTab,
KeyBackspace,
KeyInsert,
KeyDelete,
KeyRight,
KeyLeft,
KeyDown,
KeyUp,
KeyPageUp,
KeyPageDown,
KeyHome,
KeyEnd,
KeyCapsLock,
KeyScrollLock,
KeyNumLock,
KeyPrintScreen,
KeyPause,
KeyF1,
KeyF2,
KeyF3,
KeyF4,
KeyF5,
KeyF6,
KeyF7,
KeyF8,
KeyF9,
KeyF10,
KeyF11,
KeyF12,
KeyLeftShift,
KeyLeftControl,
KeyLeftAlt,
KeyLeftSuper,
KeyRightShift,
KeyRightControl,
KeyRightAlt,
KeyRightSuper,
KeyKbMenu,
KeyKp0,
KeyKp1,
KeyKp2,
KeyKp3,
KeyKp4,
KeyKp5,
KeyKp6,
KeyKp7,
KeyKp8,
KeyKp9,
KeyKpDecimal,
KeyKpDivide,
KeyKpMultiply,
KeyKpSubtract,
KeyKpAdd,
KeyKpEnter,
KeyKpEqual,
Raw(U64),
]
Named raylib keyboard keys plus a validated backend-specific escape hatch.