Skip to content
Sectr99Public

About

Turn a cheap USB/Bluetooth rotary knob into a layered controller for Windows: per-app layers, readable actions, per-program volume. Rust tray app.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knurl icon

Knurl

Turn a cheap USB / Bluetooth rotary knob into a layered controller for Windows.

Knurl settings window

Knurl is a small tray app for Windows 10 and 11. Turning and pressing the knob runs actions you choose: scrolling, zoom, media keys, keyboard shortcuts, or one program's own volume in the Windows mixer. Actions are grouped into layers. Double-tap the knob to switch layers, or let Knurl switch for you when you focus a particular app or browser tab.

It was built for the ANTICATER VK-01 desk knob, but works with any knob that can be set to send F13 / F14 / F15 (and optionally F16 / F17 for turning while held).

Features

  • Layers of actions for turn clockwise, turn counter-clockwise and press, plus two more for turning while holding the knob down (or tap, then turn).
  • Switch layers by double-tap, triple-tap or the tray menu, with a small popup showing where you are.
  • Per-app layers: a layer can follow the focused program (chrome, code) or a window title (title:YouTube), so the knob does the right thing in each app.
  • Actions you can read: key names (Ctrl + Shift + Z), short function names (Scroll Down, Zoom +, Play/Pause), Open …, Type …, steps separated by commas. Checked as you type, with suggestions, or record a shortcut straight from the keyboard.
  • Per-program volume: Discord Volume +, Spotify Mute and so on change that program's volume in the Windows mixer, not the system volume (handy with an external DAC). Media Volume + follows whatever is playing: Spotify, a browser tab, a video player.
  • Templates for Discord, YouTube, Spotify, video editing, VS Code, Teams, Zoom, Photoshop, Figma and Excel.
  • Feel: speed, acceleration for fast spins, and a rate limit per layer.
  • Knob setup from the tray, battery level and warnings over Bluetooth, start with Windows.
  • Two styles from the Bench design system, each in light and dark: Instrument (graphite and amber, mono readouts; the default) and Native (quiet, at home on Windows).

Layer popup, Instrument style  Layer popup, Native style

Screenshots

Media layer General settings
Media layer: turn for the playing app's volume, hold and turn to skip tracks Style, appearance, gesture, tap timing, backup and the names you can use
Templates Native style, light
Start a layer from a template Native style, light

Getting started

  1. Build (needs Rust and the Windows SDK, which comes with Visual Studio Build Tools):
    cd knurl
    cargo build --release
    
  2. Run knurl\target\release\knurl.exe. Knurl lives in the tray; right-click it for the menu.
  3. Set up the knob: with the VK-01 plugged in over USB, choose Set up knob in the tray menu. This maps its turns and press to F13 / F15 / F14, and turns while held to F16 / F17. The mapping is stored on the knob itself. Other knobs: map them to F13 (counter-clockwise), F14 (press) and F15 (clockwise) with their own software.
  4. Optional: Install to this PC copies Knurl to %LOCALAPPDATA%\Programs\Knurl with a Start-menu entry, and Start with Windows launches it at sign-in.

Settings open from the tray (or by launching Knurl again). They're saved to %APPDATA%\Knurl\config.json; editing that file by hand works too, and Knurl reloads it on the fly.

Needs the Microsoft Edge WebView2 runtime for the settings window (included with Windows 11).

How it works

The knob reports F13–F17 instead of volume and brightness keys, so nothing else on the PC reacts to it. Knurl registers those keys as hotkeys, turns taps and turns into gestures, and sends the current layer's action with SendInput or the Windows audio session API. The tray and popup are native Win32 (the popup is drawn with Direct2D); the settings window is a single HTML page in WebView2, only loaded while it's open.

knurl/src/    main.rs  app, tray, hotkeys      knob.rs   gestures       action.rs  sending input
              names.rs action names            config.rs settings       apps.rs    per-app layers
              audio.rs per-app volume          system.rs install, knob  popup.rs   layer popup
              theme.rs dark mode               webui.rs  settings window
knurl/ui/     settings.html, bench.css (design system), icons.js, assets.css (generated fonts + logo)

cargo test runs the unit tests.

Credits

License

MIT. The bundled IBM Plex fonts (OFL 1.1) keep their own license.

About

Turn a cheap USB/Bluetooth rotary knob into a layered controller for Windows: per-app layers, readable actions, per-program volume. Rust tray app.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages