authoring-godot-prompt…
Use when writing or editing a SKILL.md, a skill's references/*.md, or an agent definition in this repo — required frontmatter,…
Use when implementing input — InputEvent system, Input Map actions, controllers/gamepads, mouse/touch, action rebinding, and input architecture
Claude Code
$ npx -y skills add jame581/GodotPrompter --skill input-handling --agent claude-code
Codex
$ npx skills add jame581/GodotPrompter --skill input-handling -a codex -y
Cursor
$ npx skills add jame581/GodotPrompter --skill input-handling -a cursor -y
Gemini CLI
$ npx skills add jame581/GodotPrompter --skill input-handling -a gemini-cli -y
GitHub Copilot
$ npx skills add jame581/GodotPrompter --skill input-handling -a github-copilot -y
OpenCode
$ npx skills add jame581/GodotPrompter --skill input-handling -a opencode -y
Windsurf
$ npx skills add jame581/GodotPrompter --skill input-handling -a windsurf -y
name: input-handling description: Use when implementing input — InputEvent system, Input Map actions, controllers/gamepads, mouse/touch, action rebinding, and input architecture
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, then C#.
> **Related skills:** **player-controller** for movement driven by input, **godot-ui** for UI input focus and navigation, **save-load** for persisting custom key bindings, **responsive-ui** for touch vs desktop input adaptation, **xr-development** for XR controller and hand tracking input, **mobile-development** for mobile sensors and app lifecycle.
---
Hardware Event (key, mouse, gamepad)
↓
Engine converts to InputEvent
↓
_input() ← raw input, runs first
↓
UI Control nodes ← _gui_input: buttons, sliders consume events
↓
_shortcut_input() ← for global shortcuts
↓
_unhandled_key_input() ← unhandled key-only events
↓
_unhandled_input() ← game input (movement, actions)| Method | Use For | When It Runs | |---------------------------|--------------------------------------------|------------------| | `_input()` | Camera look, global hotkeys | First — before everything | | `_shortcut_input()` | Global shortcuts (pause, screenshot) | After UI, before unhandled | | `_unhandled_key_input()` | Key-only events that UI didn't consume | After UI, keys only | | `_unhandled_input()` | Gameplay actions (jump, attack, interact) | Last — after UI consumes | | `Input.is_action_pressed()` in `_physics_process()` | Continuous movement | N/A — polling, not event-driven |
**Rule of thumb:** Use `_unhandled_input()` for discrete game actions (jump, attack). Use `Input` polling in `_physics_process()` for continuous movement. Use `_input()` only when you need input before UI consumes it (e.g., mouse look).
InputEvent ├── InputEventFromWindow │ ├── InputEventWithModifiers │ │ ├── InputEventKey ← keyboard │ │ ├── InputEventMouse │ │ │ ├── InputEventMouseButton ← mouse clicks │ │ │ └── InputEventMouseMotion ← mouse movement │ │ └── InputEventGesture ← Magnify / Pan gestures │ ├── InputEventScreenTouch ← touchscreen tap │ └── InputEventScreenDrag ← touchscreen drag ├── InputEventJoypadButton ← gamepad buttons ├── InputEventJoypadMotion ← gamepad sticks/triggers ├── InputEventAction ← synthetic action events ├── InputEventMIDI ← MIDI devices └── InputEventShortcut
---
Define actions in **Project > Project Settings > Input Map** instead of checking raw keycodes. This decouples game logic from specific keys and enables rebinding.
Godot ships with `ui_*` actions: `ui_accept`, `ui_cancel`, `ui_left`, `ui_right`, `ui_up`, `ui_down`, etc. These are used by UI controls for keyboard navigation. You can use them for gameplay but creating custom actions is preferred to avoid conflicts.
Actions can be created at runtime with `InputMap.add_action()` + `InputMap.action_add_event()` — typically in an autoload `_ready()`, guarded by `InputMap.has_action()`. Define actions in the editor Input Map; only add them in code for dynamically generated bindings or mod support.
> See [references/action-rebinding.md](references/action-rebinding.md) for the GDScript and C# snippet.
Use descriptive, game-specific names instead of key names:
| Good | Bad | Why | |---------------------|------------------|--------------------------------------| | `move_left` | `press_a` | Decoupled from physical key | | `attack` | `left_click` | Works for mouse and gamepad | | `interact` | `press_e` | Rebindable without changing logic | | `sprint` | `hold_shift` | Input-agnostic | | `pause` | `press_escape` | Can map to gamepad Start button too |
---
Use `_unhandled_input()` for one-shot actions: jump, attack, interact, pause.
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("jump"):
_jump()
get_viewport().set_input_as_handled() # prevent further propagation
if event.is_action_pressed("interact"):
_interact()
if event.is_action_pressed("pause"):
get_tree().paused = not get_tree().paused
get_viewport().set_input_as_handled()public override void _UnhandledInput(InputEvent @event)
{
if (@event.IsActionPressed("jump"))
{
Jump();
GetViewport().SetInputAsHandled();
}
if (@event.IsActionPressed("interact"))
Interact();
if (@event.IsActionPressed("pause"))
{
GetTree().Paused = !GetTree().Paused;
GetViewport().SetInputAsHandled();
}
}Use `Input` singleton in `_physics_process()` for held buttons and analog axes.
func _physics_process(delta: float) -> void:
# Movement vector from 4 directional actions
var direction := Input.get_vector("move_left", "move_right", "move_up", "move_down")
velocity = direction * speed
# Check if a button is held
if Input.is_action_pressed("sprint"):
velocity *= 1.5
move_and_slide()public override void _PhysicsProcess(double delta)
{
Vector2 direction = Input.GetVector("move_left", "move_right", "move_up", "move_down");
Velocity = direction * Speed;
if (Input.IsActionPressed("sprint"))
Velocity *= 1.5f;
MoveAndSlide();
}| Method | Returns | Use For | |-----------------------------------|---------|--------------------------------------| | `Input.is_action_pressed()` | `bool` | Held buttons (sprint, crouch, fire) | | `Input.
Agentic skills framework for Godot 4.x game development. Gives AI coding agents domain-specific expertise for GDScript and C# projects.
Use when writing or editing a SKILL.md, a skill's references/*.md, or an agent definition in this repo — required frontmatter,…
Use when cutting a GodotPrompter release or bumping its version — the version-bump sequence, tag-triggered workflow, and the…
Use when working with 2D-specific systems — TileMaps, parallax scrolling, 2D lights and shadows, canvas layers, particles 2D,…
Use when working with 3D-specific systems — materials, lighting, shadows, environment, global illumination, fog, LOD, occlusion…
Use when building or replacing an ability system — abilities with cost/cooldown, buffs/debuffs, stat modifiers, and gameplay…
Use when creating Godot editor plugins — EditorPlugin, @tool scripts, custom inspectors, and dock panels
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.