yqrashawn / GokuRakuJoudo

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

Is it possible to map the hyperkey with more than two keys? #166

Closed llity closed 2 years ago

llity commented 2 years ago

Hello,

Mapped a lot of hyper keys with "alone, hold" to switch the hyper key. but I found there need more examples for Goku usage.

Could you provide more examples of Goku's advanced usage? especially, :alone and :held parameters to bind two hotkeys.

Thanks.

{:description
      "Command_L (⌘) + Space → Switch input source (F18) ",
      :manipulators
      [{:from
        {:key_code "spacebar",
         :modifiers
         {:mandatory ["left_command"], :optional ["caps_lock"]}},
        :to [{:key_code "f18"}],
        :type "basic"}]}
     {:description
      "Command_R (⌘) + Space → Switch input source (F18) ",
      :manipulators
      [{:from
        {:key_code "spacebar",
         :modifiers
         {:mandatory ["right_command"], :optional ["caps_lock"]}},
        :to [{:key_code "f18"}],
        :type "basic"}]}
     {:description
      "Tap CapsLock (⇪) → Escape (⎋); Hold CapsLock (⇪) → Control (⌃)",
      :manipulators
      [{:from {:key_code "caps_lock", :modifiers {:optional ["any"]}},
        :to [{:key_code "left_control", :lazy true}],
        :to_if_alone [{:key_code "escape"}],
        :to_if_held_down [{:key_code "left_control"}],
        :type "basic"}]}
     {:description
      "Tap Control_L (⌃) → CapsLock (⇪); Hold Control_L (⌃) → Super Key (⌃⌥⌘)",
      :manipulators
      [{:from
        {:key_code "left_control",
         :modifiers {:optional ["caps_lock"]}},
        :to
        [{:key_code "left_command",
          :lazy true,
          :modifiers ["left_control" "left_option"]}],
        :to_if_alone
        [{:hold_down_milliseconds 100, :key_code "caps_lock"}],
        :to_if_held_down
        [{:key_code "left_command",
          :modifiers ["left_control" "left_option"]}],
        :type "basic"}]}
     {:description "Hold Tab (⇥) → Hyper Key (⇧⌃⌥⌘)",
      :manipulators
      [{:from {:key_code "tab", :modifiers {:optional ["caps_lock"]}},
        :to
        [{:key_code "left_shift",
          :lazy true,
          :modifiers ["left_command" "left_control" "left_option"]}],
        :to_if_alone [{:key_code "tab"}],
        :to_if_held_down
        [{:key_code "left_shift",
          :modifiers ["left_command" "left_control" "left_option"]}],
        :type "basic"}]}
     {:description "Hold Escape (⎋) → Hyper Key (⇧⌃⌘)",
      :manipulators
      [{:from
        {:key_code "escape", :modifiers {:optional ["caps_lock"]}},
        :to
        [{:key_code "left_shift",
          :lazy true,
          :modifiers ["left_command" "left_control"]}],
        :to_if_alone [{:key_code "escape"}],
        :to_if_held_down
        [{:key_code "left_shift",
          :modifiers ["left_command" "left_control"]}],
        :type "basic"}]}
     {:description "Hold grave_accent_and_tilde (`) → Hyper Key (⇧⌃)",
      :manipulators
      [{:from
        {:key_code "grave_accent_and_tilde",
         :modifiers {:optional ["caps_lock"]}},
        :to
        [{:key_code "left_shift",
          :lazy true,
          :modifiers ["left_control"]}],
        :to_if_alone [{:key_code "grave_accent_and_tilde"}],
        :to_if_held_down
        [{:key_code "left_shift", :modifiers ["left_control"]}],
        :type "basic”}]}