Godot input patterns

From MRCalderon3D/everything-game-dev-code · View interactive version

Godot input patterns is an AI agent skill from the GitHub repository MRCalderon3D/everything-game-dev-code. Implement Godot input through InputMap actions with correct event propagation, device support, and rebinding.

How to use this skill

Skill file

Godot Input Patterns

Purpose

Implement Godot input through InputMap actions with correct event propagation, device support, and rebinding.

Use When

Inputs

Process

  1. define every action in the InputMap (project settings or at startup) and bind devices to actions; gameplay code calls Input.is_action_* or handles InputEvent actions, never raw keycodes
  2. choose polling versus events deliberately: poll continuous state (movement axes via Input.get_vector) in _physics_process, and handle discrete edges (just pressed/released) through events or is_action_just_pressed
  3. respect the propagation order — _input, then Control _gui_input, then _unhandled_input — and put gameplay input in _unhandled_input so UI consumes events first; call set_input_as_handled() explicitly when a layer swallows an event
  4. handle joypads through actions with deadzone configured per action, listen to joy_connection_changed for hot-plug, and verify mappings on each exported platform
  5. for touch targets, decide between InputEventScreenTouch handling and emulate_mouse_from_touch, and keep on-screen controls as a separate Control layer bound to the same actions
  6. implement rebinding by editing InputMap at runtime (action_erase_events / action_add_event), persist bindings to user settings, and expose them through the accessibility options
  7. define how paused state affects input: which nodes keep processing via process_mode, and which actions (pause/menu) must work while the tree is paused

Outputs

Quality Bar

Common Failure Modes

Related Agents

Related Commands

Related Skills

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.