Input¶
22 tools for Enhanced Input: input actions, mapping contexts, triggers and modifiers, key mappings, input state, and force feedback.
Back to the index.
add_input_modifier¶
Additive
Reshape the VALUE a key sends before the action sees it: append a modifier (Negate to flip an axis, Swizzle to remap X/Y/Z, DeadZone for stick drift, Scalar for sensitivity) to a key mapping in a mapping context. This is how one Axis2D action serves WASD -- S is W negated, not a second action. Modifiers change the value, triggers change when it fires (add_input_trigger); list_input_types enumerates the classes, remove_input_modifier undoes it by index. The context is saved, and the call succeeds only when it reaches disk.
| Parameter | Type | Required | Description |
|---|---|---|---|
context_name |
string | yes | Short asset name of the InputMappingContext. |
action_name |
string | yes | Short asset name of the InputAction. |
key |
string | yes | Key name of the mapping the modifier is attached to. |
modifier_type |
string | yes | One of "Negate", "Swizzle", "DeadZone", "Scalar". |
context_path |
string | no | Asset path of the Input Mapping Context |
action_path |
string | no | Asset path of the Input Action |
key_name |
string | no | Input key name (e.g. SpaceBar, Gamepad_FaceButton_Bottom) |
Returns: { context_name, action_name, key, modifier_type, modifier_class, index, modifier_count, saved, save_error? }
add_input_trigger¶
Additive
Decide WHEN a key fires its action: append a trigger (Down / Pressed / Released / Hold / Tap / Pulse / ChordAction) so a key can mean tap-to-do-X and hold-to-do-Y instead of consuming two keys. Targets either one key mapping inside a mapping context (pass context + key) or, with no context and no key, the InputAction asset's own Triggers array -- the difference decides whether the rule applies to that binding or to the action everywhere, so a key without a context is refused rather than read as the action. The edited asset is saved, and the call succeeds only when it reaches disk. Tune it afterwards with set_input_action_trigger_behavior; list_input_types enumerates the classes.
| Parameter | Type | Required | Description |
|---|---|---|---|
action_name |
string | yes | Short asset name of the InputAction. |
trigger_type |
string | yes | One of "Down", "Pressed", "Released", "Hold", "Tap", "Pulse", "ChordAction". |
context_name |
string | no | Short asset name of the InputMappingContext. Omit it (and context_path) to append the trigger to the InputAction asset's own Triggers array instead of one of its key mappings. |
key |
string | no | Key name of the mapping the trigger is attached to: required with a context, and refused when there is no context. |
context_path |
string | no | Asset path of the Input Mapping Context, instead of context_name. |
action_path |
string | no | Asset path of the Input Action |
key_name |
string | no | Input key name (e.g. SpaceBar, Gamepad_FaceButton_Bottom) |
Returns: Context target: { context_name, action_name, key, trigger_type, trigger_class, index, trigger_count, saved, save_error? }; Action target: { action_name, action_path, trigger_type, trigger_class, index, trigger_count, saved, save_error? }
add_mapping_to_context¶
Additive
Bind a key to an InputAction in a saved Enhanced Input mapping context, addressing each asset by SHORT ASSET NAME (IMC_Foo / IA_Bar) or by full object path. Returns the mapping index, which is what add_input_trigger / add_input_modifier / get_input_mapping_context (mapping_index) address. A context that already maps that key to that action keeps its mapping (added false, already_mapped true, not saved); a new mapping succeeds only when the context reaches disk. Other actions on the same key are not checked: use find_free_input_key or list_all_input_mappings first.
| Parameter | Type | Required | Description |
|---|---|---|---|
context_name |
string | yes | Short asset name (e.g. IMC_Example) or full object path of the InputMappingContext. |
action_name |
string | yes | Short asset name (e.g. IA_Example) or full object path of the InputAction. |
key |
string | yes | Key name to map (e.g. "SpaceBar", "W", "Gamepad_FaceButton_Bottom"). |
context_path |
string | no | Alias of context_name, read only when context_name is absent. |
action_path |
string | no | Alias of action_name, read only when action_name is absent. |
input_action_path |
string | no | Second alias of action_name, read only when action_name and action_path are both absent. |
key_name |
string | no | Alias of key, read only when key is absent (same FKey names). |
Returns: { context_name, context_path, action_name, action_path (resolved object path), key, key_name (same as key), index, mapping_count, added, already_mapped, saved, save_error? }
create_force_feedback_effect¶
Additive Idempotent
Create a force feedback effect asset (the controller rumble a Play Force Feedback call plays) at package_path/name, with one default channel (all four motors affected, an intensity curve with no keys, so it does not vibrate until the curve is keyed), then save it; there is no undo step. Idempotent: when a force feedback effect already exists at that path it is loaded and returned as it is, with already_existed true, and nothing is saved. An asset of another type at the path, or an invalid name, is an error and nothing changes; a failed save is an error, the new asset staying only in memory. Edit its channels and curves with set_properties (ChannelDetails) on the asset path and read them back with get_properties.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Asset name without folder, e.g. "FFE_Rumble". |
package_path |
string | no | Content folder for the asset, e.g. "/Game/Input/Feedback" (optional, default "/Game/Gameplay"); a trailing slash is ignored. |
Returns: { name: string, asset_path: string, asset_class: string, channel_detail_count: number, is_force_feedback_effect: bool, already_existed: bool, created: bool }
create_input_action¶
Additive
Create an Enhanced Input InputAction asset (IA_): the verb half of a keybinding -- what the player does, independent of which key does it. Pick value_type up front (Bool for a button, Axis1D for a trigger/scroll, Axis2D for a stick or WASD, Axis3D), then bind it to a key inside a mapping context with add_mapping_to_context. Changing the type later is set_input_action_value_type; behaviour flags are set_input_action_flags. The asset is saved, and the call succeeds only when it reaches disk.
| Parameter | Type | Required | Description |
|---|---|---|---|
action_name |
string | yes | Name of the new InputAction. |
package_path |
string | no | Target content package path where the asset is created (default /Game/Input). |
path |
string | no | Fallback for package_path when package_path is absent. |
value_type |
string | no | Value type Bool (default), Axis1D, Axis2D, or Axis3D. |
Returns: { action_name, action_path, value_type, saved, save_error? }
create_input_mapping_context¶
Additive
Create an Enhanced Input mapping context asset (IMC_): the container that binds keys to InputActions and can be pushed and popped as a set. Prefer a context per MODE (driving, swimming, building, menu) over one key per verb -- pushing a context re-purposes the existing keys instead of consuming another global one. Empty on creation: fill it with add_mapping_to_context, and check the keys are free first with find_free_input_key. The asset is saved, and the call succeeds only when it reaches disk.
| Parameter | Type | Required | Description |
|---|---|---|---|
context_name |
string | yes | Name of the new InputMappingContext. |
package_path |
string | no | Target content package path where the asset is created (default /Game/Input). |
path |
string | no | Fallback for package_path when package_path is absent. |
Returns: { context_name, context_path, saved, save_error? }
find_free_input_key¶
Read-only
Which keys are still FREE: lists every input key not bound by any Enhanced Input mapping context or legacy mapping, filterable by category (keyboard / gamepad / mouse / touch) and substring, plus the matching keys that are already bound. The complement of list_all_input_mappings and the tool to run before binding a new keyboard shortcut, since a collision compiles silently and only shows up in play. Also the spelling lookup for any key the engine defines: with bindable_only=false and no category, free_keys (paged with offset/limit) + bound_keys together are the full engine key list, each with its exact FKey name ("SpaceBar", "Gamepad_FaceButton_Bottom") and its display name. Trustworthy where the Python route is not: InputMappingContext.mappings is deprecated and returns empty, which makes every taken key look available.
| Parameter | Type | Required | Description |
|---|---|---|---|
filter |
string | no | Optional case-insensitive substring matched against the key name or display name. |
category |
string | no | Optional key category filter: one of 'keyboard', 'gamepad', 'mouse', 'touch'. Absent = all categories. |
bindable_only |
boolean | no | When true (default), only keys where FKey::IsBindableInBlueprints() is true are considered (skips AnyKey/gestures/etc.). false lists every valid key the engine defines. |
offset |
integer | no | Index of the first free_keys entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset. |
limit |
integer | no | Most entries returned per call, 1..1000 (default 100). |
Returns: { free_keys:[{name (the FKey name binding calls take), key (same), display_name, is_gamepad, is_mouse, is_analog}] (sorted by name, paged with offset/limit), total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null, free_key_count, bound_keys:[...same shape], bound_key_count (keys bound anywhere, unfiltered), key_count (free_keys + bound_keys listed) }
get_input_action¶
Read-only
Read one Enhanced Input InputAction asset in full: its value type (Bool / Axis1D / Axis2D / Axis3D), its accumulation behaviour, all the consume/pause/reserve flags, and the triggers and modifiers attached to the ACTION itself. The read-back oracle for create_input_action, set_input_action_value_type and set_input_action_flags, and the place to check b_consume_input -- an action left consuming input can swallow a key for the whole game. Triggers listed here are the action's own; the ones on a specific key binding live in the mapping context (get_input_mapping_context, per mapping).
| Parameter | Type | Required | Description |
|---|---|---|---|
action_path |
string | yes | Full path to the InputAction asset (e.g., /Game/Input/IA_Jump). |
action_name |
string | no | Fallback for action_path when action_path is absent (short asset name). |
Returns: { action_path, action_name, value_type, accumulation_behavior, b_consume_input, b_trigger_when_paused, b_consumes_action_and_axis_mappings, b_reserve_all_mappings, trigger_events_that_consume_legacy_keys, action_description, b_tap, triggers, modifiers }
get_input_action_state¶
Read-only
Read the live Enhanced Input state of one InputAction for a local player in a running PIE or game session: is_tracked, trigger_events, value, last_triggered_world_time and the mapping contexts that carry it, applied or not. It is the oracle for whether an input fired, since inject_key_input and trigger_input_action succeed either way: read it before and after, and an advancing last_triggered_world_time is the proof. is_mapped_in_applied_context false means no applied context maps it (removed on mounting, in a vehicle or a menu); is_tracked false means the engine is not evaluating it, typically an unpossessed pawn. In co-op, world picks which local player is read.
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
string | yes | InputAction to read: full object path or short asset name. Aliases: action_path, action_name. |
player_index |
integer | no | Local player index (default 0). |
world |
string | no | World selector: 'pie' (default) | 'server' | 'client' | 'pie:N' | 'game'. |
action_path |
string | no | Alias of action, read when action is absent or empty: InputAction object path or short asset name. |
action_name |
string | no | Alias of action, read only when action is absent or empty and action_path is absent: InputAction object path or short asset name. |
Returns: { action_path: string, action_name: string, value_type: string, is_enhanced_input: bool, is_tracked: bool, is_mapped_in_applied_context: bool, trigger_event: number, trigger_events: array, value: array, elapsed_seconds: number, triggered_seconds: number, last_triggered_world_time: number, world_time_seconds: number, contexts_mapping_action: array, contexts_mapping_action_count: number, applied_context_count: number, player_index: number, player_controller: string, player_input_class: string, world: string, note: string }
get_input_mapping_context¶
Read-only
Read ONE Enhanced Input mapping context asset (IMC): every action-to-key mapping it declares, each with its raw Mappings[] index and the triggers attached to that binding (the read-back for add_input_trigger and the trigger_index remove_input_trigger takes); mapping_index narrows the answer to one binding. An IMC asset stores no priority -- that is given when the context is added to a player (AddMappingContext), so it is not reported here. The per-asset reader, and the reliable one -- the Python property InputMappingContext.mappings is deprecated and hands back an EMPTY list without failing, so a scan built on it reports a fully-bound context as empty. Triggers on the InputAction asset itself are in get_input_action. Use list_all_input_mappings for the project-wide "which keys are taken / which conflict" question.
| Parameter | Type | Required | Description |
|---|---|---|---|
context_path |
string | yes | Full path (e.g., /Game/Input/IMC_Default) or short asset name of the InputMappingContext. |
ctx_path |
string | no | Alias of context_path, read only when context_path is absent. |
mapping_index |
integer | no | Optional 0-based index into the context's Mappings[] (the index add_mapping_to_context returns): only that binding is returned, even one without an action. Out of range is an error. |
Returns: { context_path, context_name, mappings: [{ index, action_name, key (display name), key_name (the FKey name add_mapping_to_context takes), triggers: [{ index, class_name, display_name }], trigger_count }], mapping_count, total_mapping_count }
get_player_input¶
Read-only
Read what a player is pressing RIGHT NOW: resolves the PlayerController for a local player index and returns it plus the currently pressed keys. Runtime state, so it needs a live PIE/game session -- an empty pressed_keys outside PIE means nothing. For which keys are BOUND (a static question) use list_all_input_mappings instead; to make an action fire use trigger_input_action.
| Parameter | Type | Required | Description |
|---|---|---|---|
player_index |
integer | no | Player controller index to query (default 0). |
Returns: { player_controller, pressed_keys }
list_all_input_mappings¶
Read-only
Which keys are already TAKEN, and which ones CONFLICT: aggregates every key-to-action binding across ALL Enhanced Input mapping context assets plus the legacy InputSettings action/axis mappings, and flags any key bound to more than one distinct action. Run it BEFORE claiming a new key -- a keybinding collision does not fail to compile, it surfaces weeks later inside another system. This is the aggregate you can trust: the Python route (InputMappingContext.mappings) is deprecated and returns an EMPTY list, which reads as "every key is free" even when every letter is taken. Use find_free_input_key for the complement (what is still unbound), get_input_mapping_context for one context.
| Parameter | Type | Required | Description |
|---|---|---|---|
filter |
string | no | Optional case-insensitive substring on the key name to narrow the returned key_bindings. |
conflicts_only |
boolean | no | When true, return only keys flagged as conflicts (more than one distinct action on the same key). Default false. |
offset |
integer | no | Index of the first key_bindings entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset. |
limit |
integer | no | Most entries returned per call, 1..1000 (default 100). |
Returns: { contexts:[{context_path,context_name,mapping_count}], context_count, key_bindings:[{key,display_name,bindings:[{action,source,context_path}],binding_count,distinct_action_count,conflict}] (sorted by key, paged with offset/limit), total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null, bound_key_count, conflicts:[...], conflict_count, legacy_action_mapping_count, legacy_axis_mapping_count }
list_input_types¶
Read-only
One-call inventory of what Enhanced Input offers in this build: the four InputAction value types (the names create_input_action and set_input_action_value_type take) plus every concrete modifier and trigger subclass, including any the project or a plugin added. Run it before add_input_trigger / add_input_modifier so you pass a class that actually exists instead of guessing a name. Read-only.
No parameters.
Returns: { value_types: ["Bool", "Axis1D", "Axis2D", "Axis3D"], value_type_count, modifier_count, trigger_count, modifier_types: [{ class_name, display_name }], trigger_types: [{ class_name, display_name }] }
register_input_key_mapping¶
Additive
Rebind a player-mappable Enhanced Input mapping to another key for one local player of a running PIE or game session, the way a key-rebinding options menu does (UEnhancedInputUserSettings::MapPlayerKey). It changes that player's user settings in memory only: no asset is edited, nothing is saved, no undo step. To change the key a mapping context asset declares use add_mapping_to_context and remove_mapping_from_context; back to the default key: unregister_input_key_mapping; taken keys: list_all_input_mappings or find_free_input_key. Start PIE first (start_play_in_editor): without a running PIE or game world the call is refused and nothing changes. It also needs Enhanced Input user settings enabled in the project (EnhancedInputDeveloperSettings bEnableUserSettings, before PIE starts) and a context with player-mappable keys applied to that player. A missing mapping_name or an invalid key name is an error before anything changes; when the engine refuses the remap, applied is false, success is false and failure_tags gives its reasons. player_controller and the world fields name the controller and world that were used.
| Parameter | Type | Required | Description |
|---|---|---|---|
mapping_name |
string | yes | Name of the player-mappable key mapping to rebind, as set in its Player Mappable Key Settings, e.g. "Jump" (required). |
new_key |
string | yes | Unreal key name to bind, e.g. "SpaceBar", "Gamepad_FaceButton_Bottom" or "LeftMouseButton"; must be a valid FKey (required). |
player_controller_name |
string | no | Optional object name or actor label of the PlayerController to remap, e.g. "PlayerController_0" (case-insensitive), searched in every running PIE or game world; when given, player_index is ignored. |
player_index |
integer | no | Local player whose binding changes, in the play world: 0 (default) is the first player controller, any other value matches a local player's controller id. |
slot |
string | no | Which of the player's key slots to set: "First" (default), "Second", "Third" or "Fourth"; an unknown name silently means "First". |
Returns: { applied: bool, mapping_name: string, new_key: string, slot: string, failure_tags: [string], player_controller: string, world_name: string, world_package: string, world_type: string, net_mode: string, pie_instance: int }
remove_input_modifier¶
Destructive
Delete one modifier from a key mapping in an Enhanced Input mapping context, by mapping_index + modifier_index -- e.g. removing a Negate that flipped an axis the wrong way -- and save the context; the call succeeds only when the context reaches disk. Indices shift after a removal, so work from the highest down. add_input_modifier is the inverse.
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx_path |
string | yes | Asset path of the UInputMappingContext |
mapping_index |
integer | yes | 0-based index of the FEnhancedActionKeyMapping |
modifier_index |
integer | yes | 0-based index of the modifier within Mapping.Modifiers |
Returns: { applied, removed_class_name, remaining_count, saved, save_error? }
remove_input_trigger¶
Destructive
Delete one trigger from a key mapping in an Enhanced Input mapping context, by mapping_index + trigger_index -- e.g. dropping a Hold so the key fires immediately again -- and save the context; the call succeeds only when the context reaches disk. Get the indices from get_input_mapping_context (mappings[].index, mappings[].triggers[].index); they shift after a removal, so work from the highest down.
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx_path |
string | yes | Asset path of the UInputMappingContext |
mapping_index |
integer | yes | 0-based index of the FEnhancedActionKeyMapping |
trigger_index |
integer | yes | 0-based index of the trigger within Mapping.Triggers |
Returns: { applied, removed_class_name, remaining_count, saved, save_error? }
remove_mapping_from_context¶
Destructive
Unbind a key from an InputAction in a saved Enhanced Input mapping context -- how you free a key that list_all_input_mappings flagged as conflicting, or retire a verb. Identified by context + action + key, so only the first mapping of that action to that key goes; the assets themselves survive. The engine moves the context's last mapping into the freed slot, so mapping indexes (add_input_trigger, get_input_mapping_context) can change. The context is saved, and a removal succeeds only when it reaches disk; a mapping that is not there succeeds with removed false and already_absent true, and saves nothing.
| Parameter | Type | Required | Description |
|---|---|---|---|
context_name |
string | yes | Short asset name of the InputMappingContext. |
action_name |
string | yes | Short asset name of the InputAction. |
key |
string | yes | Key name of the mapping to remove. |
context_path |
string | no | Asset path of the Input Mapping Context |
action_path |
string | no | Asset path of the Input Action |
key_name |
string | no | Input key name (e.g. SpaceBar, Gamepad_FaceButton_Bottom) |
Returns: { context_name, action_name, key, removed, already_absent, mapping_count, saved, save_error? }
set_input_action_flags¶
Destructive Idempotent
Set an InputAction's behaviour flags: consume_input, trigger_when_paused, consumes_action_and_axis_mappings, reserve_all_mappings, the legacy-key consume bitmask, accumulation behaviour and the editor description. Handle consume_input with care -- it is the flag that decides whether OTHER actions on the same key still fire, and turning it on can swallow the game's interaction key entirely, a failure that shows up in an unrelated system days later. Only the fields you pass change, and a call that passes none is an error; the action is saved, and the call succeeds only when it reaches disk. Verify with get_input_action.
| Parameter | Type | Required | Description |
|---|---|---|---|
action_name |
string | yes | Input action name |
action_path |
string | no | Asset path of the Input Action |
consume_input |
boolean | no | When set, updates the action's bConsumeInput flag. |
trigger_when_paused |
boolean | no | When set, updates the action's bTriggerWhenPaused flag. |
consumes_action_and_axis_mappings |
boolean | no | When set, updates bConsumesActionAndAxisMappings. |
reserve_all_mappings |
boolean | no | When set, updates bReserveAllMappings. |
trigger_events_that_consume_legacy_keys |
integer | no | When set (int32 ETriggerEvent bitmask), updates TriggerEventsThatConsumeLegacyKeys. |
accumulation_behavior |
string | no | When set, one of "TakeHighestAbsoluteValue" or "Cumulative". |
action_description |
string | no | When set, updates the action's ActionDescription (FText) shown in the editor. |
Returns: { action_name, action_path, b_consume_input, b_trigger_when_paused, b_consumes_action_and_axis_mappings, b_reserve_all_mappings, trigger_events_that_consume_legacy_keys, accumulation_behavior, action_description, flags_set, saved, save_error? }
set_input_action_trigger_behavior¶
Destructive Idempotent
Tune HOW an input trigger fires on an InputAction: actuation threshold, hold time and one-shot for Hold triggers, tap release window for Tap, time-dilation sensitivity for timed ones -- i.e. how long "hold E to interact" must be held. Address the trigger either by index or by trigger_class (first of that type). Only the fields you pass change; the action is saved, and the call succeeds only when it reaches disk. Add the trigger first with add_input_trigger and re-read with get_input_action.
| Parameter | Type | Required | Description |
|---|---|---|---|
action_path |
string | yes | Asset path of the Input Action (or short asset name). |
action_name |
string | no | Fallback for action_path when action_path is absent. |
trigger_index |
integer | no | Index into the action's Triggers array to edit. Mutually exclusive with trigger_class. |
trigger_class |
string | no | Select the first trigger of this type (Down|Pressed|Released|Hold|Tap|Pulse|ChordAction) instead of an index. |
actuation_threshold |
string | no | When set, the base UInputTrigger::ActuationThreshold (float). |
hold_time_threshold |
string | no | When set, UInputTriggerHold::HoldTimeThreshold (float). Hold triggers only. |
is_one_shot |
string | no | When set, UInputTriggerHold::bIsOneShot (bool). Hold triggers only. |
tap_release_time |
string | no | When set, UInputTriggerTap::TapReleaseTimeThreshold (float). Tap triggers only. |
affected_by_time_dilation |
string | no | When set, UInputTriggerTimedBase::bAffectedByTimeDilation (bool). Timed triggers only. |
Returns: { action_path, action_name, trigger_index, trigger_class, properties_set, trigger, saved, save_error? }
set_input_action_value_type¶
Destructive Idempotent
Change an InputAction's value type after the fact (button vs axis: Bool / Axis1D / Axis2D / Axis3D). Not cosmetic -- the type decides what shape of value the bound handlers receive and what trigger_input_action must inject, so switching it can break existing graph pins. Re-read with get_input_action and re-check the handlers. The action is saved, and the call succeeds only when it reaches disk.
| Parameter | Type | Required | Description |
|---|---|---|---|
action_path |
string | yes | Asset path to the input action |
value_type |
string | yes | One of "Bool", "Float", "Int", "Vector2D", "Vector", "Rotator", "String", etc. |
action_name |
string | no | Fallback for action_path when action_path is absent. |
Returns: { action_name, action_path, value_type, value_type_set, saved, save_error? }
trigger_input_action¶
Destructive
Inject a value for an Enhanced Input action into a local player's UEnhancedInputLocalPlayerSubsystem in a running PIE or game session, so the real bound handlers run with the action's own modifiers and triggers (headless key injection never reaches Enhanced Input). dispatched true does not prove a handler fired: compare get_input_action_state before and after.
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
string | yes | Full object path of a UInputAction, or its short asset name (required). |
value_json |
any | no | The value to inject, coerced to the action's ValueType: bool (Boolean), number (Axis1D), or a [x,y]/[x,y,z] array or {x,y,z} object (Axis2D/Axis3D). If omitted, Boolean actions default to true (pressed) and axis actions default to zero. |
player_index |
integer | no | Local player index used to resolve the PlayerController (default 0). |
hold_seconds |
number | no | Optional float. When > 0, the value is re-injected every tick for this many seconds (so a movement AXIS actually moves the pawn), then a final neutral/zero value is injected to release. Fire-and-forget: the command returns immediately and the hold runs across the next hold_seconds of PIE. Omit (or 0) for a single one-shot sample. |
world |
string | no | Optional world selector: absent/'pie' (default: PlayWorld, else the first PIE context) | 'server' (the PIE world with authority) | 'client' | 'pie:N' | 'game' (alias of 'pie'). With 2+ players the default may drive the OTHER player's pawn. |
action_path |
string | no | Alias of action, read when action is absent or empty: InputAction object path or short asset name. |
action_name |
string | no | Alias of action, read only when action is absent or empty and action_path is absent: InputAction object path or short asset name. |
Returns: { dispatched: bool, note: string, action_path: string, value_type: string, injected_value: [x,y,z], player_index: number, hold_seconds: number, world: string, world_name: string|null, world_package: string|null, world_type: string|null, net_mode: string|null, pie_instance: number }
unregister_input_key_mapping¶
Destructive
Reset a player-mappable Enhanced Input mapping of one local player of a running PIE or game session back to its default key (UEnhancedInputUserSettings::UnMapPlayerKey), clearing the override register_input_key_mapping made for that slot; the mapping itself stays. It changes that player's user settings in memory only: no asset is edited, nothing is saved, no undo step. Start PIE first (start_play_in_editor): without a running PIE or game world the call is refused and nothing changes. It also needs Enhanced Input user settings enabled in the project (EnhancedInputDeveloperSettings bEnableUserSettings, before PIE starts). To unbind a key in a mapping context asset use remove_mapping_from_context; to see the bound keys use list_all_input_mappings. A missing mapping_name is an error before anything changes; when the engine refuses the reset, applied is false, success is false and failure_tags gives its reasons. player_controller and the world fields name the controller and world that were used.
| Parameter | Type | Required | Description |
|---|---|---|---|
mapping_name |
string | yes | Name of the player-mappable key mapping to reset, as set in its Player Mappable Key Settings, e.g. "Jump" (required). |
player_controller_name |
string | no | Optional object name or actor label of the PlayerController to reset, e.g. "PlayerController_0" (case-insensitive), searched in every running PIE or game world; when given, player_index is ignored. |
player_index |
integer | no | Local player whose binding is reset, in the play world: 0 (default) is the first player controller, any other value matches a local player's controller id. |
slot |
string | no | Which of the player's key slots to reset: "First" (default), "Second", "Third" or "Fourth"; an unknown name silently means "First". |
Returns: { applied: bool, mapping_name: string, slot: string, failure_tags: [string], player_controller: string, world_name: string, world_package: string, world_type: string, net_mode: string, pie_instance: int }