add_input_modifier
Attach Negate, Swizzle, DeadZone, or Scalar modifiers to a key mapping in a mapping context to reshape its value before the action receives it.
Instructions
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_modifier_types enumerates the classes, remove_input_modifier undoes it by index. The context is saved, and the call succeeds only when it reaches disk.
Returns: { context_name, action_name, key, modifier_type, modifier_class, index, modifier_count, saved, save_error? }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Key name of the mapping the modifier is attached to. | |
| key_name | No | Input key name (e.g. SpaceBar, Gamepad_FaceButton_Bottom) | |
| action_name | No | Short asset name of the InputAction. | |
| action_path | No | Asset path of the Input Action | |
| context_name | No | Short asset name of the InputMappingContext. | |
| context_path | No | Asset path of the Input Mapping Context | |
| modifier_type | Yes | One of "Negate", "Swizzle", "DeadZone", "Scalar". |