All skills
thedivergentai avatar

/godot-input-handling

@9d6e91e

Expert patterns for input handling covering InputMap actions, InputEvent processing, controller support, rebinding, deadzones, and input buffering. Use when setting up player controls, implementing input systems, or adding gamepad/accessibility features. Keywords InputMap, InputEvent, gamepad, controller, rebinding, deadzone, input buffer.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-input-handling

This session only. Nothing lands on disk.

referencesinputmap-best-practices.md

≈238 tokens on demand. Your agent reads this file only when SKILL.md points to it.

InputMap Best Practices

Avoid physical key checks. Define semantic actions (e.g., move_left, interact) in Project Settings > Input Map.

1. Analog Deadzones

Analog sticks suffer from drift. Use Input.get_vector() for mathematically correct circular deadzones.

  • Bad: Subtracting axis strengths manually creates "square" deadzones.
  • Good: var input := Input.get_vector("left", "right", "up", "down") applies a perfectly circular deadzone and clamps magnitude to 1.0.

2. Basic Polling

# Check if action pressed this frame
if Input.is_action_just_pressed("jump"):
    jump()

# Check if action held
if Input.is_action_pressed("fire"):
    shoot()

# Check if action released
if Input.is_action_just_released("jump"):
    release_jump()

# Get axis (-1 to 1)
var direction := Input.get_axis("move_left", "move_right")

# Get vector
var input_vector := Input.get_vector("left", "right", "up", "down")

Source: SKILL.md on GitHub

1 warning17d4 checks · Risk MEDIUM
  • Gen Agent Trust Hub17d

    The skill provides comprehensive patterns for Godot input handling, but includes a medium-severity risk involving unsafe deserialization of local configuration files via bytes_to_var and str_to_var.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    1/4 files flagged

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-input-handling