A high-performance, low-level macOS keyboard remapper designed to turn the useless Caps Lock key into a power-user navigation layer. Designed for environments where you are restricted from installing third-party software but have the freedom to run your own compiled binaries.
Note: This entire project was 100% vibe coded. ## ✨ Features
- Vim Navigation: Use
HJKLas Arrow keys when Caps Lock (remapped to Control) is held. - Smart Jumps: Supports
OptionandShiftmodifiers while using Vim navigation for word selection. - Tab & Line Navigation:
[and]act asCmd+Left/Rightfor instant browser tab switching or jumping to the start/end of lines. - Screenshot UI:
CapsLock + Ptriggers the macOS screenshot utility (Cmd+Shift+5). - Flamoji Trigger:
CapsLock + .induces the Flamoji picker. Can rebind to show the native MacOS emoji panel as well (which sucks btw). - Zero Latency: Built with CoreGraphics for hardware-level event manipulation.
mokr operates at the lowest possible user-space layer on macOS:
CGEventTap(HID Level): The tool hooks into the.cgSessionEventTapstream at the.headInsertEventTapposition. This ensuresmokrintercepts hardware keystrokes before they are processed by the system or any other application.- Event Transformation: When the "Control" modifier (remapped Caps Lock) is detected,
mokrswallows the original event by returningnilto the system and usesCGEvent.post()to inject new, remapped hardware events into the stream. - Ghost Process: Compiled as a native Swift binary, it runs as a detached background process with a near-zero memory footprint.
You must first remap your Caps Lock key to Control via macOS System Settings:
System Settings > Keyboard > Keyboard Shortcuts... > Modifier Keys > Caps Lock -> Control.
This project uses a standard Makefile to compile and stash the binary in a hidden directory.
make installBecause mokr intercepts hardware events, you must grant Accessibility permissions to the mokr binary (or your Terminal app) in:
System Settings > Privacy & Security > Accessibility.
| Combination | Result | Description |
|---|---|---|
Caps + H/J/K/L |
← / ↓ / ↑ / → |
Vim-style arrow movement |
Caps + [ |
Cmd + ← |
Home / Previous Tab |
Caps + ] |
Cmd + → |
End / Next Tab |
Caps + P |
Cmd + Shift + 5 |
Screenshot Selection UI |
Caps + . |
Cmd + Opt + E |
Open Flamoji Panel |
- Stop:
make stop - Full Uninstall:
make clean
Known issue: Command-based Home/End behavior ([ and ]) may vary in specific Terminal emulators depending on their internal keybinding overrides.