yqrashawn / GokuRakuJoudo

config karabiner with ease
GNU General Public License v3.0
1.16k stars 121 forks source link

Simultaneous keys with optional modifiers #114

Closed Vermoot closed 3 years ago

Vermoot commented 3 years ago

H!

I've just started using Goku to make my karabiner config, and what a difference it's made!

One thing I like, as a frenchman, is to map accented letters on combos, so in karabiner-speak, simultaneous events. For example, I do ER to type é.

Here's what it looks like in my karabiner.edn file:

           :des "Combo accents"
           :rules [
             [[:e :r] [:quote :e]]

What I'd like to be able to do is use those with optional modifiers, especially shift, to be able to type capitalised accented letters. Here's what I thought it would look like:

           :des "Combo accents"
           :rules [
             [[:##e :##r] [:quote :##e]]

Unfortunately, this doesn't work. What's the right way of doing this? Thanks

yqrashawn commented 3 years ago

I missed this feature when implementing goku. I'll find time to add it. Related issue https://github.com/yqrashawn/GokuRakuJoudo/issues/72#issuecomment-669022383

yqrashawn commented 3 years ago

Hi, this is fixed now.

For rule simultaneously press any modifier + e and same any modifier + r ----to----> insert same any modifier + quote then insert same any modifier + e can be done like below

[{:sim [:e :r] :modi {:optional [:any] }} [:quote :e]]

simultaneously press option + e and option + r ----to----> insert quote then insert option + e

[{:sim [:e :r] :modi {:mandatory [:left_option]}} [:quote :!Oe]]

For deatils about modifiers in from, you can checkout karabiner's documentation https://karabiner-elements.pqrs.org/docs/json/complex-modifications-manipulator-definition/from/modifiers/#frommodifiersmandatory