add_mapping_to_context
Bind a key to an InputAction in a saved Enhanced Input mapping context using short asset names instead of full paths. Returns the mapping index for adding triggers or modifiers.
Instructions
Bind a key to an InputAction in a saved Enhanced Input mapping context, addressing both by SHORT ASSET NAME (IMC_Foo / IA_Bar) instead of full paths -- otherwise the same operation as map_input_action, which takes paths. Returns the mapping index, which is what add_input_trigger / add_input_modifier / list_input_triggers 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 first.
Returns: { context_name, context_path, action_name, key, index, mapping_count, added, already_mapped, saved, save_error? }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Key name to map (e.g. "SpaceBar", "W", "Gamepad_FaceButton_Bottom"). | |
| key_name | No | Input key name (e.g. SpaceBar, Gamepad_FaceButton_Bottom) | |
| action_name | No | Short asset name of the InputAction (e.g. IA_Example). | |
| action_path | No | Asset path of the Input Action | |
| context_name | No | Short asset name of the InputMappingContext (e.g. IMC_Example). | |
| context_path | No | Asset path of the Input Mapping Context |