Keymouse
Control your mouse on macOS with fast, Vim-style keyboard navigation.

Demo: toggling mouse mode, moving with H J K L, clicking, and jumping the cursor with the grid system.
Features
- Global keyboard-driven mouse control on macOS (
CGEventTap) - Toggleable mouse mode (
F8) so normal typing is unaffected when off - Cursor movement with configurable keys (defaults:
H J K L) - Speed modifiers for movement/scroll (defaults:
Shiftfast,Option/Altslow) - Scroll control with configurable keys (defaults:
U N B M) - Left/right click from keyboard (defaults:
F/D) - Recursive 3x3 jump grid with translucent overlay and depth indicator
- Multi-monitor aware grid targeting on the display under the cursor
- Automatic event-tap re-enable if macOS temporarily disables the tap
Installation
Option 1: Install from crates.io (recommended)
Run it:
Option 2: Download a prebuilt binary from GitHub Releases
Latest release:
Example (Apple Silicon / arm64):
Option 3: Build from source
Clone the repository:
Build a release binary:
The compiled binary will be available at:
Usage
1) Start Keymouse
If you built from source:
Validate your config without starting the event loop:
2) Grant macOS permissions
Grant permissions to the app that launches Keymouse (usually Terminal/iTerm):
System Settings->Privacy & Security->AccessibilitySystem Settings->Privacy & Security->Input Monitoring
3) Toggle mouse mode
- Press
F8to turn mouse mode on/off. - When mouse mode is off, all keys behave normally.
- When mouse mode is on, keydown/keyup events are intercepted by Keymouse.
4) Control the pointer
- Move:
H J K L - Scroll:
U N B M - Click:
F(left),D(right) - Modifiers:
Shift= fast,Option/Alt= slow
5) Use jump grid mode
- Press
;(defaultgrid_key) to show the 3x3 grid on the display under the cursor. - Select cells with
Q/W/E,A/S/D,Z/X/Cto zoom recursively. - Optional alternates in grid mode:
Fmaps to middle-left,Gmaps to center. - Press
Enterto move cursor to the selected region center. - Press
Escto cancel grid mode.
Default keymap
| Key | Action |
|---|---|
F8 |
Toggle mouse mode |
H J K L |
Move cursor |
Shift + move/scroll keys |
Fast movement/scroll |
Option + move/scroll keys |
Slow movement/scroll |
U N B M |
Scroll up/down/left/right |
F |
Left click |
D |
Right click |
; |
Enter grid mode |
Q/W/E/A/S/D/Z/X/C |
Select grid cell recursively |
Enter |
Confirm grid jump |
Esc |
Cancel grid mode |
Quit
Use Ctrl+C in the terminal running Keymouse.
Configuration
Keymouse loads configuration from:
~/.config/keymouse/config.toml
If the file is missing, Keymouse uses built-in defaults. At startup, it also writes an example file to that path so you can customize bindings.
Example config.toml:
= "k"
= "j"
= "h"
= "l"
= "u"
= "n"
= "b"
= "m"
= ";"
= "enter"
= "f"
= "d"
= "shift"
= "option"
Supported key names for bindings are currently:
- Letters used by default (
a b c d e f g h j k l m n q s u w x z) ;(or"semicolon"),"enter"/"return","escape"/"esc","f8"- Modifiers:
"shift"and"option"/"alt"(for modifier fields)
Unknown key names fall back to default values.
Troubleshooting
- If Keymouse exits with an event tap error, re-check Accessibility and Input Monitoring permissions for the launching app.
- If keyboard control stops after long inactivity or heavy system load, macOS may have disabled the tap; Keymouse now attempts to re-enable it automatically.
Roadmap
- Vim-style cursor movement
- Grid jump navigation
- Multi-monitor support
- Recursive grid zoom
- Custom key bindings
- Configuration file
- Homebrew installation
Contributing
Contributions, suggestions, and feature requests are welcome. Open an issue to discuss ideas, or submit a pull request with a focused change.
License
MIT. See LICENSE.