ModifierMap

AppCUI::Input::ModifierMap (class)

class ModifierMap

Bijective remapping of the Ctrl/Alt/Shift modifier combinations, applied to every incoming input event (physical -> logical) and to every displayed key (logical -> physical).

Identity costs one branch per event.

Public Functions

ModifierMap()
Key ToLogical(Key physical) const
Key ToPhysical(Key logical) const
Key GetCtrlActsAs() const
Key GetAltActsAs() const
inline bool IsIdentity() const

Public Static Functions

static ModifierMap Identity()
static std::optional<ModifierMap> FromAssignments(Key ctrlActsAs, Key altActsAs)

ctrlActsAs / altActsAs: the logical modifier(s) produced by the physical Ctrl / Alt key.

Returns nullopt when the result is not a bijection (it would make some shortcuts unreachable).