unreal.InputMappingContext

class unreal.InputMappingContext(outer: Object | None = None, name: Name | str = 'None')

Bases: DataAsset

UInputMappingContext : A collection of key to action mappings for a specific input context Could be used to:

Store predefined controller mappings (allow switching between controller config variants). TODO: Build a system allowing redirects of UInputMappingContexts to handle this. Define per-vehicle control mappings Define context specific mappings (e.g. I switch from a gun (shoot action) to a grappling hook (reel in, reel out, disconnect actions). Define overlay mappings to be applied on top of existing control mappings (e.g. Hero specific action mappings in a MOBA)

C++ Source:

  • Plugin: EnhancedInput

  • Module: EnhancedInput

  • File: InputMappingContext.h

Editor Properties: (see get_editor_property/set_editor_property)

  • context_description (Text): [Read-Write] Localized context descriptor

  • mappings (Array[EnhancedActionKeyMapping]): [Read-Write] List of key to action mappings.

property context_description: Text

[Read-Only] Localized context descriptor

Type:

(Text)

map_key(action, to_key) EnhancedActionKeyMapping

Map a key to an action within the mapping context.

Parameters:
Return type:

EnhancedActionKeyMapping

property mappings: None

[Read-Only] List of key to action mappings.

Type:

(Array[EnhancedActionKeyMapping])

unmap_action(action) None

Unmap Action deprecated: Function ‘UnmapAction’ is deprecated.

Parameters:

action (InputAction) –

unmap_all() None

Unmap everything within the mapping context.

unmap_all_keys_from_action(action) None

Unmap all key maps to an action within the mapping context.

Parameters:

action (InputAction) –

unmap_key(action, key) None

Unmap a key from an action within the mapping context.

Parameters: