A keyboard utility that turns Space into a powerful modifier key, giving you mouse control, cursor navigation, and desktop management — all without leaving the home row.
Hold Space down to activate CLX mode. Release it to type a normal space (if no other key was pressed).
| Keys | Action |
|---|---|
Space + W |
Move mouse up |
Space + A |
Move mouse left |
Space + S |
Move mouse down |
Space + D |
Move mouse right |
Space + E |
Left click (hold to drag) |
Space + Q |
Right click (hold to drag) |
Space + R |
Scroll up |
Space + F |
Scroll down |
Space + Shift + R/F |
Horizontal scroll |
Mouse movement uses a physics model with acceleration and friction — the longer you hold, the faster it moves, and it glides to a smooth stop.
| Keys | Action |
|---|---|
Space + H |
← Left arrow |
Space + J |
↓ Down arrow |
Space + K |
↑ Up arrow |
Space + L |
→ Right arrow |
Space + Y |
Home |
Space + O |
End |
Space + U |
Page Down |
Space + I |
Page Up |
Space + T |
Backspace/Delete |
Space + G |
Enter |
Space + N |
Tab |
Space + P |
Shift+Tab |
Hold any cursor key for turbo repeat — it accelerates the longer you hold.
Modifier keys (Shift, Ctrl, Option/Alt, Cmd/Win) are passed through, so Space + Shift + L sends Shift+Right (extend selection).
| Keys | Action |
|---|---|
Space + 1 |
Switch to previous desktop |
Space + 2 |
Switch to next desktop |
Space + X |
Close window/tab (Cmd+W) |
Space + / or Space + \ |
Quit CLX |
The program registers global hotkeys using golang.design/x/hotkey. When Space is held:
- All CLX sub-modules activate and register their own hotkeys.
- On Space release, all sub-hotkeys are unregistered.
- If no CLX key was pressed during the hold, a regular space keystroke is sent.
Mouse and scroll movement run a physics simulation in a background goroutine: applying acceleration, capping velocity, and decaying with friction each tick (every 10ms). This gives smooth, natural-feeling cursor control from the keyboard.
- macOS — primary target. Uses AppleScript (
mack) for desktop switching. - Windows — supported via
mods_windows.go(uses Win key as Cmd equivalent).
- Go 1.19+
- macOS: grant Accessibility permission to the terminal app (System Preferences → Privacy & Security → Accessibility)
git clone https://github.com/snomiao/capslockx-mac
cd capslockx-mac
go build -o clx
chmod +x clx
./clx# Requires Node.js
npm install -g nodemon
bash watch.shwatch.sh builds and relaunches CLX automatically whenever a .go file changes.
bash x-build-win-from-linux.sh| Package | Purpose |
|---|---|
golang.design/x/hotkey |
Global hotkey registration |
github.com/go-vgo/robotgo |
Mouse/keyboard automation |
github.com/andybrewer/mack |
AppleScript bridge (macOS desktop switching) |
golang.design/x/mainthread |
Run on OS main thread (required by macOS) |
- Space as modifier key
- Mouse control with physics (WASD)
- Mouse buttons (Q/E)
- Scroll (R/F)
- Cursor control (HJKL)
- Page/Home/End navigation
- Desktop switching (1/2)
- CapsLock as alternative modifier
- Jump to specific desktop (1–8)
- Horizontal scroll (Shift+R/F)
- Smooth physics for cursor movement