This question refers to the use of enhanced input in Unreal Engine 5. Whenever I say "modifier", I refer to modifier keys such as Shift, Alt, and Ctrl (rather than the Input Modifers such as Dead Zone and Aim Assist).
I am trying to bind actions to mouse and keyboard inputs that require the user to hold a modifier key, e.g. the following ones, which one would typically find in RTS type games:
Left click without modifiersto select a unit
Left click + Shiftto add to selection
- Keyboard key
1to select the units in control group #1
1 + Ctrlto define control group #1
1 + Shiftto add to control group #1
This can be easily achieved through the deprecated Action Mapping in the Project Settings:
However, I am looking for a way to achieve the same through the preferred Enhanced Input Actions and Input Mapping Context. How does that work?
I could probably achieve the desired outcome with a Chorded Action (by defining a helper action for "Shift is Down" and then adding it as Chord Action to the left click. However, not only would I need to do this with the modifier I want, I would even need to add Chord Actions for those I don't want: otherwise if shift is down, both "Left click+shift" and "Only left click" will fire. That sounds insane. What am I missing (and why don't I find this in the docs -- this seems like a common use case)?