# Input Remapping rebind actions at runtime through InputMap. ```{raw} html ▶ Run in browser ``` **Tags:** `input` `remapping` `ui` `actions` A settings-style panel lists three actions (jump, fire, pause) with their current keyboard bindings, enumerated from InputMap.actions and InputMap.get_bindings and displayed via InputBinding.key_combo. Each row's Rebind button arms capture mode: the next key press arrives through on_unhandled_input and replaces the action's bindings with a single new one (InputMap.remove_binding + add_binding), modifiers included ("shift+f"). Esc cancels an armed capture; Reset restores the declared defaults. ## What it demonstrates - Declaring default actions on the root's `input_actions` class attribute. - Enumerating the live map: `InputMap.actions` + `InputMap.get_bindings(name)`, with `InputBinding.key_combo` as the display spelling. - Key capture via `on_unhandled_input`: modifiers ride along, pure modifier presses are held back, and Esc cancels. - Replacing bindings with `InputMap.remove_binding` + `InputMap.add_binding`. - A ticker polling `Input.is_action_just_pressed` proves rebinds take effect. Controls: Mouse - click Rebind to arm capture for that row, Reset for defaults Any key - fires its action (see the ticker); while capturing, becomes the new binding ESC - cancel an armed capture Run: uv run python examples/features/input/remapping.py Headless self-check: uv run python examples/features/input/remapping.py --test ## Source ```{literalinclude} ../../examples/features/input/remapping.py :language: python :linenos: ```