KeyMapper icon indicating copy to clipboard operation
KeyMapper copied to clipboard

allow parallel triggers to be pressed in any order

Open sds100 opened this issue 5 years ago • 4 comments

  • this will break people's key maps. see https://discord.com/channels/717499872219103263/717726028893519942/843875612082438164 in discord server.

Developer TODO (don't remove)

  • [ ] Do this automatically for any trigger that is prefixed with modifier keys. Do not do it if two key maps with different order of modifier keys in the prefix, execute different actions. This means the user explicitly wants the modifier keys to do different things in different orders. See comment below.
  • [ ] Shift left and Shift right (etc) are treated the same unless, the user explicitly mapped them differently.
  • [ ] Add a user-facing toggle?? There are people that want Vol down + vol up and Vol up + vol down to have different actions. One could do the same behavior as described above for modifier keys and avoid a user-facing toggle, but this could potentially break people's existing key maps.

sds100 avatar Feb 12 '21 17:02 sds100

not planned, #988 expected to retain this behaviour

jambl3r avatar Mar 15 '25 22:03 jambl3r

  • this will break people's key maps

That caveat appears to be valid only if the change were to be enforced globally.

IIUC, a per-mapping toggle (maybe "permute" or "ignore order of modifiers"?) in the triggers tab is one of the two key improvements that, used together, would perfectly allow to replace e. g.

  • Meta Left -> Shift Left -> D
  • Meta Left -> Shift Right -> D
  • Meta Right -> Shift Left -> D
  • Meta Right -> Shift Right -> D
  • Shift Left -> Meta Left -> D
  • Shift Left -> Meta Right -> D
  • Shift Right -> Meta Left -> D
  • Shift Right -> Meta Right -> D

with just one entry, e. g.

  • Meta -> Shift -> D; ignore sides; ignore order

without breaking existing key maps of people who don't want to use the toggle.

The other key to the simplification is a per-trigger toggle "ignore left/right", or "ignore side of modifiers" (for ambidextrous keys).

Having to specify every permutation/side variant explicitly for it to work is a major reason why I'm using 100+ keymaps. If "ignore order" and "ignore side" toggles were available, that list would collapse to about 35 real bindings.

GfEW avatar Mar 17 '26 05:03 GfEW

We can definitely consider this with #988

jambl3r avatar Mar 19 '26 11:03 jambl3r

To be more precise, whilst "ignore sides" naturally applies per key (modifier), "ignore order" would ideally be a choice per connector (the joint between recorded key events): (1)

  • (a) together (ignore order)
  • (b) together
  • (c) serial

with

  • "together" mode from pre-existing keymaps defaulting to (b), for full compatibility
  • precedence (a) > (b) > (c). (2)

Amongst more mundane applications (compose key etc.), this would finally allow proper emacs style \C-xfoo prefix maps everywhere, yay!

(1) These variants could e. g. be denoted as follows:

  • (a) * (circle / recycling / exchange symbol)
  • (b) + (already there, could be improved on directional clarity)
  • (c) -> (already there).

(2) This formally represents the intuitive associative precedence, where e. g. X * Y -> Z means

  • X_down and Y_down, in any order,
  • then X_up and Y_up, in any order,
  • then Z_down
  • then Z_up..

GfEW avatar Mar 20 '26 06:03 GfEW