Windows-style `LevelThree` as `Ctrl+Alt`
On Windows the default third-level modifier is actually Ctrl+Alt, while Linux has a dedicated modifier: LevelThree.
While most people would probably use only the AltGr key as third-level modifier, some prefer to use the key combination Ctrl+Alt, either because they do have symmetric Alt keys or because they simply expect AltGr and Ctrl+Alt key combos to be strictly equivalent.
See some use cases on the xkeyboard-config project:
My initial idea to tackle this is to implement a dedicated mechanism:
-
Active only on keys that have a key type such that its mask:
- has
LevelThree - has at most one of
ControlorAlt
The reasoning should be on the modifier encodings.
- has
-
Active only when
Ctrl+Altis in the effective modifier mask. -
Generate a sequence of 3 events, similar to
RedirectKey():- Save the state; remove
Ctr+Altfrom the modifiers and addLevelThreeeand send the corresponding event. - Send the key event.
- Restore the state and send the corresponding event.
- Save the state; remove