Skilllibrary input-mapping-controller
Implements action-based input mapping, controller support, rebinding, and multi-device handling across Unity, UE5, and Godot. Use when designing input systems, adding gamepad support, implementing rebinding, handling input buffering, or switching input contexts. Do not use for general UI layout or non-input game logic.
install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/13-game-engines-and-creative-tech/input-mapping-controller" ~/.claude/skills/merceralex397-collab-skilllibrary-input-mapping-controller && rm -rf "$T"
manifest:
13-game-engines-and-creative-tech/input-mapping-controller/SKILL.mdsource content
Purpose
Provides engine-specific patterns for action-based input mapping, runtime rebinding, gamepad/touch/keyboard support, input buffering, and context switching across Unity, UE5, and Godot.
When to use this skill
- Implementing an input system that maps physical buttons to game actions
- Adding gamepad support with dead zones, analog curves, or rumble/haptics
- Building runtime key rebinding with serialization and persistence
- Handling context switching (gameplay vs menu vs vehicle input maps)
- Implementing input buffering, coyote time, or other responsive-feel techniques
- Supporting multiple simultaneous input devices (keyboard+mouse alongside gamepad)
Do not use this skill when
- The task is about UI layout or HUD design with no input system work — prefer
game-ui-hud - The task is about network input synchronization — prefer
multiplayer-netcode - The task is purely about animation driven by input (no input mapping changes needed)
Operating procedure
- Define actions, not keys. Create an abstract action layer:
,Jump
,Attack
— never reference physical keys in gameplay code. This is the foundation of every cross-platform input system.Move - Use the engine's input system.
- Unity New Input System: Create an
asset. Define.inputactions
groups (Player, UI, Vehicle). UseInputActionMap
component or generate a C# class. Read viaPlayerInput
or callbackaction.ReadValue<Vector2>()
.action.performed += ctx => { } - UE5 Enhanced Input: Define
assets per action. CreateUInputAction
to bind keys. In the PlayerController:UInputMappingContext
.EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &AMyChar::Jump) - Godot Input Map: Configure in Project → Input Map. Read via
or handleInput.is_action_just_pressed("jump")
inInputEvent
._unhandled_input(event)
- Unity New Input System: Create an
- Implement runtime rebinding.
- Listen for the next input event during rebind mode.
- Store bindings as a serializable map:
.{ "jump": "Keyboard/Space", "attack": "Gamepad/ButtonSouth" } - Save/load bindings to JSON or the engine's settings system (Unity
, UE5PlayerPrefs
, GodotGameUserSettings
).ConfigFile
- Configure gamepad correctly. Set dead zones (typically 0.15–0.25 for sticks). Apply response curves (linear, quadratic, or custom) for analog movement. Enable rumble via engine APIs: Unity
, UE5Gamepad.current.SetMotorSpeeds()
.PlayDynamicForceFeedback() - Handle context switching. Enable/disable action maps when entering menus, vehicles, or cutscenes. Unity:
. UE5: add/removeplayerInput.SwitchCurrentActionMap("UI")
viaInputMappingContext
/AddMappingContext()
.RemoveMappingContext() - Implement input buffering. Store the last N frames of input. Allow jump if pressed within a buffer window (e.g., 100ms before landing). Implement coyote time: allow jump for ~80ms after leaving a platform edge.
- Support accessibility. Allow hold-vs-toggle options, adjustable stick sensitivity, remappable controls for all actions, and separate mouse sensitivity settings.
Decision rules
- Always decouple physical input from game actions — never hard-code
in gameplay logic.KeyCode.Space - Default to the engine's built-in input system before building custom solutions.
- Treat gamepad and keyboard as equal citizens; test both paths during development.
- Buffer inputs for action games; skip buffering for strategy or menu-heavy games.
- Persist rebindings separately from game save data — they are user preferences, not game state.
- When supporting multiple devices simultaneously, use the last-active device to drive UI prompt icons.
Output requirements
— list of abstract actions with default bindings per deviceAction Map
— engine-specific code for reading actions and handling callbacksImplementation
— how bindings are captured, stored, serialized, and restoredRebinding Flow
— test matrix: keyboard, gamepad, rebind → save → reload, context switchValidation
References
- Unity Input System: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.7/
- UE5 Enhanced Input: https://docs.unrealengine.com/5.3/en-US/enhanced-input-in-unreal-engine/
- Godot InputEvent: https://docs.godotengine.org/en/stable/tutorials/inputs/inputevent.html
Related skills
— persisting rebinding preferencessave-load-state
— displaying context-sensitive button promptsgame-ui-hud
— input latency measurementperformance-profiling-games
— input prediction and synchronizationmultiplayer-netcode
Failure handling
- If the target engine is unknown, ask before proceeding — input APIs differ fundamentally.
- If rebinding conflicts arise (two actions on same key), warn the player and allow override or swap.
- If gamepad is not detected at runtime, fall back gracefully to keyboard+mouse with no errors.
- If input feels unresponsive, check buffer window sizes and dead zone thresholds before rewriting logic.