2025-03-03 (Mon) [長年日記]

_ [mac] Karabiner-Elements でトラックボールも便利に

Karabiner-Elements で button5 を

  • クリックは button1 クリック
  • 長押しはシフト長押し

にする設定はこんな感じになりそう

 {
   "description": "button5 to button1 or shift",
   "manipulators": [
       {
           "from": {
               "modifiers": { "optional": ["any"] },
               "pointing_button": "button5"
           },
           "parameters": {
               "basic.to_delayed_action_delay_milliseconds": 100,
               "basic.to_if_held_down_threshold_milliseconds": 100
           },
           "to": { "key_code": "right_shift" },
           "to_after_key_up": [
               { "sticky_modifier": { "right_shift": "off" } },
               {
                   "set_variable": {
                       "name": "shift",
                       "value": false
                   }
               }
           ],
           "to_delayed_action": {
               "to_if_canceled": {
                   "conditions": [
                       {
                           "name": "shift",
                           "type": "variable_unless",
                           "value": true
                       }
                   ],
                   "pointing_button": "button1"
               },
               "to_if_invoked": {
                   "conditions": [
                       {
                           "name": "shift",
                           "type": "variable_unless",
                           "value": true
                       }
                   ],
                   "pointing_button": "button1"
               }
           },
           "to_if_held_down": [
               { "sticky_modifier": { "right_shift": "on" } },
               {
                   "set_variable": {
                       "name": "shift",
                       "value": true
                   }
               }
           ],
           "type": "basic"
       }
   ]
 }

ダブルクリックをしない人は to_if_canceled が不要

Karabiner 自体にも mouse_motion_to_scroll というのがあるけど、動作がモッサリ? カクカク? しているので私は DragScroll という別のアプリを使っている


«前の日記(2025-02-24 (Mon)) 最新