unreal.InputMappingContext

class unreal.InputMappingContext(outer=None, name='None')

Bases: unreal.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

[Read-Only] Localized context descriptor

Type

(Text)

map_key(action, to_key)EnhancedActionKeyMapping

Map a key to an action within the mapping context.

Parameters
Returns

Return type

EnhancedActionKeyMapping

property mappings

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

Type

(Array(EnhancedActionKeyMapping))

unmap_action(action)None

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

Parameters

action (InputAction) –

unmap_all()None

Unmap everything within the mapping context.

unmap_key(action, key)None

Unmap a key from an action within the mapping context.

Parameters