Skip to main content

Module keymap

Module keymap 

Source
Expand description

Keyboard layouts: the same text format as the web player (gasm-host.js parseKeymap). A line per binding: <pad 1-4> <button> <key code>..., where key codes are W3C KeyboardEvent.code names (winit’s KeyCode uses the same names). Keyboard bindings for pad N >= 2 apply while fewer than N gamepads are connected.

Re-exports§

pub use crate::keys::KEY_CODES;

Constants§

BUTTONS
DEFAULT_KEYMAP

Functions§

gasm_key
GASM_KEY_* code of a winit key (0 if it has none).
key_from_code
W3C KeyboardEvent.code name -> winit KeyCode.
normalize
Browser names for keys whose winit name differs.
pads
Pads from held keys; keyboard pad N (zero-based n >= 1) only while gamepads <= n.
parse

Type Aliases§

Keymap
(key, zero-based pad, button bit)