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.

referencesexpert-input-extensions.md

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

Expert Input Extensions

1. Input-Buffering (Action Queuing)

Decouple input presses from physics execution to make controls feel "tight." Store the input in a timed buffer and consume it when a valid state (e.g., landing) is reached [1, 2].

var jump_buffer_timer: float = 0.0

func _unhandled_input(event: InputEvent) -> void:
    if event.is_action_pressed("jump"):
        jump_buffer_timer = 0.15 # 150ms window

func _physics_process(delta: float) -> void:
    if jump_buffer_timer > 0.0:
        jump_buffer_timer -= delta
        if is_on_floor():
            jump()
            jump_buffer_timer = 0.0

2. Coyote-Time (Jump Leniency)

Allow a jump for a few frames after the character leaves a ledge by tracking the time since last grounded [4].

var coyote_timer: float = 0.0

func _physics_process(delta: float) -> void:
    if is_on_floor():
        coyote_timer = 0.1 # 100ms grace period
    else:
        coyote_timer -= delta
    
    if Input.is_action_just_pressed("jump") and coyote_timer > 0.0:
        jump()
        coyote_timer = 0.0

3. Multiplayer-Input-Synchronization

Route local device input to the authoritative server using RPCs and multiplayer.get_remote_sender_id() for validation [7, 8].

@rpc("any_peer", "call_local", "unreliable")
func sync_input(dir: Vector2) -> void:
    var sender = multiplayer.get_remote_sender_id()
    # Apply dir to the player body associated with sender...

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