Vonng / Capslock

Make Capslock Great Again!
Apache License 2.0
1.42k stars 285 forks source link

可以支持配合鼠标滚动实现桌面切换吗? #32

Closed zeyios closed 1 year ago

zeyios commented 3 years ago

Is your feature request related to a problem? Please describe. 在mac配合使用鼠标的时候,左右切换桌面比较难操作,我现在使用 caps+q / e 来实现左右切换桌面。

Describe the solution you'd like 可以支持按下caps,同时滚动鼠标轮轴就可以左右切换桌面吗?

miozus commented 3 years ago

################################################################
#                        Hyper MouseKey                        #
################################################################
  - description: Hyper MouseKey
    manipulators:
    #==========================================================#
    # (  mouse wheel )  ->    ( desktop switch )               #
    #==========================================================#
    - description: 'mouse_wheel_up = ctrl + left (prev desktop)'
      type: basic
      from: { mouse_key: { vertical_wheel: -32 }, modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
      to: [ { key_code: left_arrow , modifiers: [ left_control ] } ]
    - description: 'mouse_wheel_down = ctrl + right (next desktop)'
      type: basic
      from: { mouse_key: { vertical_wheel: 32 }, modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
      to: [ { key_code: left_arrow , modifiers: [ left_control ] } ]

按住 capslock 同时滚动鼠标轮轴就可以左右切换桌面的实现.yml

思路这样,你试着模仿,复制和修改 capslock.json,然后测试(我没鼠标)

参考 karabiner:to.mouse-key

🤔 from.any

You can use from.any as follows. These matches all key codes, consumer key codes or pointing buttons. "any": "key_code" "any": "consumer_key_code" "any": "pointing_button"

但官网文档给出的输入按键,仅支持三种类型,所以这条路可能会失败。