🧠 Brains complement: IF an unreal-engine-skills-manager tool (external MCP) exists in this session, call it with {action: "load", skill: "enhanced-input"} for UE domain knowledge on this topic — correct APIs, architecture, best practices — and treat it as the rubric for any review / "best practices" question. If no such tool is available (e.g. running under Claude Code or Codex without that MCP), skip this line entirely and proceed with this skill alone — do NOT attempt the call.
Enhanced Input Skill
Critical Rules
🚨 Real Python method names — do NOT search for the docstring's "action" names
The InputService class docstring lists MCP-style action ids (action_create,
mapping_list_contexts, action_configure, ...). Those are not the Python method
names — discover_python_class(method_filter=...) matches nothing for them. The complete
real API is below; you rarely need a discovery call at all:
| Area |
Methods |
| Reflection |
discover_types(), get_available_keys(filter=""), get_available_modifier_types(), get_available_trigger_types() |
| Actions |
create_action(name, path, value_type="Axis1D"), list_input_actions(), get_input_action_info(action_path) → info or None, configure_action(action_path, consume_input=True, trigger_when_paused=False, description=""), input_action_exists(action_path) |
| Contexts |
create_mapping_context(name, path, priority=0), list_mapping_contexts(), get_mapping_context_info(context_path) → info or None, mapping_context_exists(context_path) |
| Mappings |
get_mappings(context_path), add_key_mapping(context_path, action_path, key_name), remove_mapping(context_path, mapping_index), key_mapping_exists(context_path, action_path) |
| Modifiers |
add_modifier(context_path, mapping_index, modifier_type), remove_modifier(context_path, mapping_index, modifier_index), get_modifiers(context_path, mapping_index) |
| Triggers |
add_trigger(context_path, mapping_index, trigger_type), remove_trigger(context_path, mapping_index, trigger_index), get_triggers(context_path, mapping_index) |
create_action value types are the strings discover_types() returns: "Boolean"
(alias "Digital"), "Axis1D", "Axis2D", "Axis3D". Modifiers and triggers are
addressed by index on the mapping, so get_mappings / get_modifiers /
get_triggers first, then add/remove by index.
⚠️ Property Names on Info Structs
| Struct |
WRONG |
CORRECT |
InputTypeDiscoveryResult |
value_types |
action_value_types |
KeyMappingInfo |
key |
key_name |
InputModifierInfo |
modifier_type |
type_name or display_name |
InputTriggerInfo |
trigger_type |
type_name or display_name |
⚠️ Value Types
| Value Type |
Use Case |
Boolean |
Simple press/release (Jump, Fire) |
Axis1D |
Single axis (Throttle, Zoom) |
Axis2D |
Two axes (Move, Look) |
Axis3D |
Three axes (3D manipulation) |
⚠️ Key Names
Keyboard: SpaceBar, LeftShift, W, A, S, D, F1, Enter, Escape, BackSpace...
Mouse: LeftMouseButton, RightMouseButton, MouseScrollUp
Gamepad: Gamepad_FaceButton_Bottom, Gamepad_LeftThumbstick, Gamepad_LeftTrigger, Gamepad_RightTrigger
Paired axes (use these for Axis2D bindings): Mouse2D (mouse look), Gamepad_Left2D / Gamepad_Right2D (analog sticks)
Verify any other name with get_available_keys("thumb") (substring filter) instead of guessing.
⚠️ Triggers and Modifiers
Triggers: Pressed, Released, Down, Hold, Tap, Pulse
Modifiers: Negate, DeadZone, Scalar, SwizzleAxis (also: Smooth, SmoothDelta, ScaleByDeltaTime — use get_available_modifier_types() for the full set)
Workflows
Create Input Action
import unreal
result = unreal.InputService.create_action("Jump", "/Game/Input", "Boolean")
if result.success:
unreal.EditorAssetLibrary.save_asset(result.asset_path)
Create Mapping Context
import unreal
result = unreal.InputService.create_mapping_context("Default", "/Game/Input", 0)
unreal.EditorAssetLibrary.save_asset(result.asset_path)
Add Key Mapping
import unreal
context_path = "/Game/Input/IMC_Default"
action_path = "/Game/Input/IA_Jump"
unreal.InputService.add_key_mapping(context_path, action_path, "SpaceBar")
unreal.EditorAssetLibrary.save_asset(context_path)
Add Triggers and Modifiers
import unreal
context_path = "/Game/Input/IMC_Default"
action_path = "/Game/Input/IA_Fire"
unreal.InputService.add_key_mapping(context_path, action_path, "LeftMouseButton")
# Get mapping index
mappings = unreal.InputService.get_mappings(context_path)
mapping_index = len(mappings) - 1
# Add trigger/modifier using mapping index
unreal.InputService.add_trigger(context_path, mapping_index, "Pressed")
unreal.InputService.add_modifier(context_path, mapping_index, "DeadZone")
unreal.EditorAssetLibrary.save_asset(context_path)
Get Mappings Info
import unreal
mappings = unreal.InputService.get_mappings("/Game/Input/IMC_Default")
for m in mappings:
print(f"Action: {m.action_name}, Key: {m.key_name}")
info = unreal.InputService.get_input_action_info("/Game/Input/IA_Jump")
if info:
print(f"Action: {info.action_name}, ValueType: {info.value_type}")
Discover Available Types
import unreal
types = unreal.InputService.discover_types()
print(f"Value Types: {types.action_value_types}")
print(f"Modifiers: {types.modifier_types}")
print(f"Triggers: {types.trigger_types}")
keys = unreal.InputService.get_available_keys()
Sample scripts (run via execute_python_code)
scripts/setup_input.txt — create an Input Action + Mapping Context and bind a key.
1---2name: enhanced-input3description: Create and configure Enhanced Input — Input Actions, Mapping Contexts, key mappings, triggers, and modifiers (InputService). Use when the user asks to set up player input, create an Input Action (IA_) or Input Mapping Context (IMC_), bind keys to actions, or configure input triggers/modifiers.4---56> 🧠 **Brains complement:** IF an `unreal-engine-skills-manager` tool (external MCP) exists in this session, call it with `{action: "load", skill: "enhanced-input"}` for UE domain knowledge on this topic — correct APIs, architecture, best practices — and treat it as the rubric for any review / "best practices" question. If no such tool is available (e.g. running under Claude Code or Codex without that MCP), skip this line entirely and proceed with this skill alone — do NOT attempt the call.78# Enhanced Input Skill910## Critical Rules1112### 🚨 Real Python method names — do NOT search for the docstring's "action" names1314The `InputService` class docstring lists MCP-style action ids (`action_create`,15`mapping_list_contexts`, `action_configure`, ...). Those are **not** the Python method16names — `discover_python_class(method_filter=...)` matches nothing for them. The complete17real API is below; you rarely need a discovery call at all:1819| Area | Methods |20|------|---------|21| Reflection | `discover_types()`, `get_available_keys(filter="")`, `get_available_modifier_types()`, `get_available_trigger_types()` |22| Actions | `create_action(name, path, value_type="Axis1D")`, `list_input_actions()`, `get_input_action_info(action_path)` → info or None, `configure_action(action_path, consume_input=True, trigger_when_paused=False, description="")`, `input_action_exists(action_path)` |23| Contexts | `create_mapping_context(name, path, priority=0)`, `list_mapping_contexts()`, `get_mapping_context_info(context_path)` → info or None, `mapping_context_exists(context_path)` |24| Mappings | `get_mappings(context_path)`, `add_key_mapping(context_path, action_path, key_name)`, `remove_mapping(context_path, mapping_index)`, `key_mapping_exists(context_path, action_path)` |25| Modifiers | `add_modifier(context_path, mapping_index, modifier_type)`, `remove_modifier(context_path, mapping_index, modifier_index)`, `get_modifiers(context_path, mapping_index)` |26| Triggers | `add_trigger(context_path, mapping_index, trigger_type)`, `remove_trigger(context_path, mapping_index, trigger_index)`, `get_triggers(context_path, mapping_index)` |2728`create_action` value types are the strings `discover_types()` returns: `"Boolean"`29(alias `"Digital"`), `"Axis1D"`, `"Axis2D"`, `"Axis3D"`. Modifiers and triggers are30addressed by **index on the mapping**, so `get_mappings` / `get_modifiers` /31`get_triggers` first, then add/remove by index.3233### ⚠️ Property Names on Info Structs3435| Struct | WRONG | CORRECT |36|--------|-------|---------|37| `InputTypeDiscoveryResult` | `value_types` | `action_value_types` |38| `KeyMappingInfo` | `key` | `key_name` |39| `InputModifierInfo` | `modifier_type` | `type_name` or `display_name` |40| `InputTriggerInfo` | `trigger_type` | `type_name` or `display_name` |4142### ⚠️ Value Types4344| Value Type | Use Case |45|------------|----------|46| `Boolean` | Simple press/release (Jump, Fire) |47| `Axis1D` | Single axis (Throttle, Zoom) |48| `Axis2D` | Two axes (Move, Look) |49| `Axis3D` | Three axes (3D manipulation) |5051### ⚠️ Key Names5253**Keyboard:** `SpaceBar`, `LeftShift`, `W`, `A`, `S`, `D`, `F1`, `Enter`, `Escape`, `BackSpace`... 54**Mouse:** `LeftMouseButton`, `RightMouseButton`, `MouseScrollUp` 55**Gamepad:** `Gamepad_FaceButton_Bottom`, `Gamepad_LeftThumbstick`, `Gamepad_LeftTrigger`, `Gamepad_RightTrigger` 56**Paired axes (use these for Axis2D bindings):** `Mouse2D` (mouse look), `Gamepad_Left2D` / `Gamepad_Right2D` (analog sticks)5758Verify any other name with `get_available_keys("thumb")` (substring filter) instead of guessing.5960### ⚠️ Triggers and Modifiers6162**Triggers:** `Pressed`, `Released`, `Down`, `Hold`, `Tap`, `Pulse` 63**Modifiers:** `Negate`, `DeadZone`, `Scalar`, `SwizzleAxis` (also: `Smooth`, `SmoothDelta`, `ScaleByDeltaTime` — use `get_available_modifier_types()` for the full set)6465---6667## Workflows6869### Create Input Action7071```python72import unreal7374result = unreal.InputService.create_action("Jump", "/Game/Input", "Boolean")75if result.success:76 unreal.EditorAssetLibrary.save_asset(result.asset_path)77```7879### Create Mapping Context8081```python82import unreal8384result = unreal.InputService.create_mapping_context("Default", "/Game/Input", 0)85unreal.EditorAssetLibrary.save_asset(result.asset_path)86```8788### Add Key Mapping8990```python91import unreal9293context_path = "/Game/Input/IMC_Default"94action_path = "/Game/Input/IA_Jump"95unreal.InputService.add_key_mapping(context_path, action_path, "SpaceBar")96unreal.EditorAssetLibrary.save_asset(context_path)97```9899### Add Triggers and Modifiers100101```python102import unreal103104context_path = "/Game/Input/IMC_Default"105action_path = "/Game/Input/IA_Fire"106107unreal.InputService.add_key_mapping(context_path, action_path, "LeftMouseButton")108109# Get mapping index110mappings = unreal.InputService.get_mappings(context_path)111mapping_index = len(mappings) - 1112113# Add trigger/modifier using mapping index114unreal.InputService.add_trigger(context_path, mapping_index, "Pressed")115unreal.InputService.add_modifier(context_path, mapping_index, "DeadZone")116unreal.EditorAssetLibrary.save_asset(context_path)117```118119### Get Mappings Info120121```python122import unreal123124mappings = unreal.InputService.get_mappings("/Game/Input/IMC_Default")125for m in mappings:126 print(f"Action: {m.action_name}, Key: {m.key_name}")127128info = unreal.InputService.get_input_action_info("/Game/Input/IA_Jump")129if info:130 print(f"Action: {info.action_name}, ValueType: {info.value_type}")131```132133### Discover Available Types134135```python136import unreal137138types = unreal.InputService.discover_types()139print(f"Value Types: {types.action_value_types}")140print(f"Modifiers: {types.modifier_types}")141print(f"Triggers: {types.trigger_types}")142143keys = unreal.InputService.get_available_keys()144```145146## Sample scripts (run via `execute_python_code`)147148- **`scripts/setup_input.txt`** — create an Input Action + Mapping Context and bind a key.