daisyUniverse / Keebie

Easy Second Keyboard support in Linux (With layers!)
84 stars 17 forks source link

Modifier key combinations #3

Closed mritunjaymusale closed 3 years ago

mritunjaymusale commented 4 years ago

Is it possible to add modifier + regular keys combo for macros in default.json can do something like : "KEY_CTRL KEY_Y":"brave-browser-stable" or "KEY_CTRL + KEY_Y":"brave-browser-stable"

Michael-E-B commented 3 years ago

I've been getting comfortable with this code base and I thought up a way to do this, I'm going to start a branch on my fork to work on this. Hopefully I'll have something to merge soon!

Michael-E-B commented 3 years ago

Work on key combinations is going quite well! Unfinished code may be found here.

Michael-E-B commented 3 years ago

I have a question for anyone watching this issue; would you prefer key combinations or key sequences?

Currently I have sequences implemented, this means that the order keys are pressed in matters, i.e. to trigger KEY_LEFTCTRL+KEY_H one must first press and hold left control, then press H, but not any other sequence.

I could easily switch the combinations where the order keys are pressed doesn't mater, only which keys are pressed.

Sequences have the advantage of allowing more possible bindings, but combinations have the advantage of being easer to remember and execute as well as being in line with how almost every program uses modifier keys.

As an aside: my current system allows for sequences of an arbitrary number of arbitrary keys, not just modifier keys.

Michael-E-B commented 3 years ago

I merged settings that allow for key combinations, if you made any multi key binding before this merge you may wish to change the multiKeyMode setting to "sequence" to make them continue working.