yqrashawn / GokuRakuJoudo

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

Touch bar buttons: OK as "from" in karabiner but goku can't represent this? #138

Closed gimbo closed 3 years ago

gimbo commented 3 years ago

Hi there.

This seems to be a valid manipulator in Karabiner:

        {
          "from" : {
            "apple_vendor_keyboard_key_code" : "mission_control"
          },
          "to" : [ {
            "key_code" : "f3"
          } ],
          "type" : "basic"
        }

On my M1 MBP at least, this remaps the mission control button in the touch bar "control strip" to F3 — seems to work fine.

I can't see any way to create this rule from goku, however; AFAICS there's no way to express the apple_vendor_keyboard_key_code part, and if I try just e.g. ":mission_control", this fails too:

        [:mission_control :f3]

produces

ERROR: invalid key code :mission_control can't be used in from
Failed!

Am I missing something, or is this a genuine current limitation of goku?

yqrashawn commented 3 years ago

https://github.com/yqrashawn/yqdotfiles/blob/61dae1e5363a37e01dfca779c64c99639a11b39f/.config/karabiner.edn#L96 check this line, goku will convert the rule as is if there's a :type :basic so the below code should work

{:from {:apple_vendor_keyboard_key_code :mission_control}
 :to [{:key_code :f3}]
 :type :basic}
gimbo commented 3 years ago

Awesome — works perfectly. Thanks so much. I think this is getting deeper into the goku way than I've managed to do so far, just working from the examples, so this is very interesting...