How-To: Add Modifier-Key Chords
Goal: require a modifier key (Shift / Ctrl / Alt) on an action - e.g. Shift+1 - baked into an IMC and not rebindable by players.
UInputMappingContext with the mapping you want to gate. For the modifier check to read your project's modifier actions, set them in Project Settings -> Crimson -> Crimson Input (otherwise it falls back to raw Shift/Ctrl/Alt keys).1. Add the chord trigger to the mapping
Open the IMC, select the mapping row (Action + Key), and add a Crimson Dynamic Chord to its Triggers array - the same place as any Enhanced Input trigger.
2. Set the default chord, leave Mapping Name empty
Tick the modifier(s) under Default Chord (bRequiresShift / bRequiresCtrl / bRequiresAlt) and leave Mapping Name at None. That is the entire inline flow - the chord is baked into this IMC mapping.
Shift+1 fires only with Shift held; a mapping whose chord requires no modifiers is blocked while any modifier is held. This lets 1, Shift+1, and Ctrl+1 be three distinct actions on the same key.3. Apply the mapping context
A purely inline chord works with the vanilla Add Mapping Context. If the IMC also has any rebindable mappings, use Add Mapping Context With Chord Triggers (see How-To: Get the Building Blocks for getting the subsystem) so those get their injected trigger too - it leaves your inline triggers untouched.
DefaultChord.See also
- How-To: Let Players Rebind Chords - make the modifier player-configurable and persisted.
- Concept: The Chord System - exact-match logic, gamepad bypass, and IMC injection.