MacOS Hack: Scroll with Hotkeys and Mouse Movement
Here's a solution to enable scrolling with hotkeys and then control the scroll with mouse movement:
Option 1: Using Karabiner-Elements (Recommended)
-
Install Karabiner-Elements (free and open-source):
-
Create a custom complex modification:
- Open Karabiner-Elements
- Go to "Complex Modifications" > "Add Rule"
- Click "Import more rules from the Internet" and search for "scroll" or create a custom JSON configuration
-
Example JSON configuration (save as scroll_with_mouse.json):
{
"title": "Scroll with Mouse Movement",
"rules": [
{
"description": "Hold key to enable mouse scroll",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"mouse_movement": {
"x": 0,
"y": 100
}
}
],
"to_if_alone": [
{
"key_code": "spacebar"
}
],
"conditions": [
{
"type": "variable_if",
"name": "scroll_mode",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "f19",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"set_variable": {
"name": "scroll_mode",
"value": 1
}
}
]
},
{
"type": "basic",
"from": {
"key_code": "f20",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"set_variable": {
"name": "scroll_mode",
"value": 0
}
}
]
}
]
}
]
}
- Usage:
- Press F19 to activate scroll mode
- Move mouse to scroll (vertical movement controls scroll)
- Press F20 to deactivate scroll mode
Option 2: Using BetterTouchTool (Paid)
-
Install BetterTouchTool from https://folivora.ai/
-
Create a new trigger:
- Set trigger to your preferred hotkey
- Add action "Enable Mouse Scroll Mode"
- Configure scroll sensitivity and direction
Option 3: Using AppleScript with Mouse Keys
-
Enable Mouse Keys in System Preferences > Accessibility > Pointer Control > Mouse Keys
-
Create an AppleScript to toggle Mouse Keys:
tell application "System Preferences"
reveal anchor "mouse" of pane "com.apple.preference.universalaccess"
end tell
tell application "System Events" to tell process "System Preferences"
click checkbox "Enable Mouse Keys" of window "Accessibility"
end tell
- Assign this script to a hotkey using Automator or a third-party app like Keyboard Maestro
Notes:
- The Karabiner-Elements solution is the most flexible and free
- You may need to adjust the mouse movement sensitivity
- Some applications might not respond to synthetic scroll events
- Consider using modifier keys (like Control or Option) as your activation hotkey
Would you like me to elaborate on any specific part of these solutions?