Quick links: blog post · documentation
This is an AutoHotKey (v2) script that can turn motions from pointing devices (mice, trackballs, trackpads, etc.) into custom actions.
Thus you can program your mouse to have "gestures" or do general input conversions (e.g. moving the mouse to scroll, change volume, press keys, and so on) regardless of driver/manufacturer.
A little video:
ScrollBall-examples.mp4
The script uses Raw Input API to track motions from individual pointing devices and briefly locks the cursor when conditions are satisfied.
This approach allows the script to do its work without the cursor drifting around the screen (further reading).
- Download AutoHotKey (v2) if you don't have it yet.
- Checkout (or just download) this repository.
- Create a script with your own configuration (see documentation) or have a look at examples.
- Run your script by dragging it onto AutoHotKey64.exe or through a context menu (if using AHK installer)
For a convenient AHK script editing experience, I recommend VS Code with AHKv2 plugin.
Personally I'm primarily proficient in doing funny things with Windows.
Someone else might know how to carry over the idea to other platforms.
Or perhaps it'll run under WINE? I bet that WINE simulates at least a single mouse for Raw Input API.
A script by Vadym "YellowAfterlife" Diachenko
Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license.