yqrashawn / GokuRakuJoudo

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

`select_input_source` is not working #125

Closed wd closed 3 years ago

wd commented 3 years ago

Config snippets, I want to map right_shift to escape and change the input source id to ABC when it presses alone. The mapping for escape is working, but the input source won't change.

    :tos {
        :input_cn
            {:key :escape
             :select_input_source {
                 :input_source_id "com.apple.keylayout.ABC"
             }}
        }

    :main [
        {
            :des "right_shift(alone) -> Esc",
            :rules [
                [:right_shift :right_shift nil {:alone :input_cn}]
            ]
        },
       ..........
      ]
yqrashawn commented 3 years ago

You can use shortcusts for inputs.

First specify the input like this https://github.com/yqrashawn/yqdotfiles/blob/3cf0621f9c498807030ca5f56738655d09484b59/.config/karabiner.edn#L634 Then use it with the :input keyword in :tos or :rules like this https://github.com/yqrashawn/yqdotfiles/blob/3cf0621f9c498807030ca5f56738655d09484b59/.config/karabiner.edn#L14

I also added support for raw :select_input_source in :tos in 0.3.11.

wd commented 3 years ago

Thanks, get it working

    :input-sources {
        :abc {:input_source_id "^com\\.apple\\.keylayout\\.ABC$"}
    }
    :tos {
        :select_abc [{:input :abc}
                     {:key :escape}]
        }
    :main [
        {
            :des "right_shift(alone) -> Esc",
            :rules [
                [:right_shift :right_shift nil {:alone :select_abc}]
            ]
        },