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.

Prerequisites
An 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.

IMC mapping row -> Triggers -> + -> Crimson Dynamic Chord. Expand it and tick Default Chord -> Requires Shift. Leave Mapping Name empty for an inline (non-rebindable) chord.

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.

Exact-match semantics
The chord is an exact match. 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.
Gamepad bypasses chords
Chord checks apply to keyboard/mouse only. Gamepad input always passes the trigger, so a chorded keyboard binding never blocks the equivalent gamepad binding.

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.

Verify
In PIE the action fires only with the required modifier held; the same key with no modifier (or the wrong one) does nothing. Different IMCs can bind the same action with different chords because each trigger carries its own 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.