Skip to main content

Module keybindings

Module keybindings 

Source
Expand description

Key bindings, chord detection, analog axes, and input action system.

This module provides a flexible input mapping layer on top of the raw key/mouse state in InputState. Features:

  • Named actions mapped to one or more keys/mouse buttons
  • Chord bindings (require multiple simultaneous keys)
  • Analog axes mapped from key pairs or mouse motion
  • Binding groups (menu, gameplay, debug) with independent enable states
  • Serialization-friendly action names for config files

Structs§

AxisBinding
An analog axis bound to a name.
Binding
A single key binding entry.
BindingConflict
A binding conflict: two actions share the same key within the same group.
BindingGroup
A named group of bindings that can be enabled/disabled as a unit. Useful for switching between gameplay mode and menu mode.
ChordBinding
A chord is a sequence of keys pressed within a time window. E.g., pressing Up Up Down Down within 1 second fires the “konami_start” action.
KeyBindings
Central key binding registry.

Enums§

AxisSource
Source for an analog axis value.
Trigger
When an action triggers relative to the key state.

Functions§

chaos_rpg_defaults
Default CHAOS RPG gameplay bindings.
detect_conflicts
Detect all conflicts in a KeyBindings instance.
minimal_bindings
Minimal test/debug binding profile.

Type Aliases§

Action
A named action identifier. Actions are the canonical input “nouns” that game logic listens to instead of raw key codes.