Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

How it works

Rebind puts a programmable layer between your input devices and your computer. Your keyboard and mouse pass through Rebind, your code transforms every event up to 8,000 times a second, and the result reaches your PC as standard USB input. Any device you already own, on Windows, macOS, and Linux. Core input is fully cross-platform; a few namespaces vary by OS — see platforms and limits.

This page explains the pipeline: how input is captured, where your scripts run, and how the result reaches your computer.

The three-stage pipeline

Input flows through Rebind in three stages: capture → script → output.

  your devices            Rebind                       your PC
 ┌────────────┐   ┌──────────────────────────┐   ┌──────────────────┐
 │ keyboard   │──▶│ capture · script · encode │──▶│ standard USB HID │
 │ mouse      │   │  (sealed)   (Luau/Rust)   │   │  keyboard/mouse  │
 └────────────┘   └──────────────────────────┘   └──────────────────┘

Your keyboard and mouse plug into Rebind instead of directly into your PC, so their raw input is captured inside a sealed environment isolated from your operating system. Each event fires your hooks — key handlers, mouse-move handlers, your tick loop, your Binds — in the Luau-on-Rust engine at up to 8,000 Hz, where you remap keys, transform movement, and automate. The result is encoded out as standard USB HID, and your operating system sees an ordinary peripheral.

-- Remap Caps Lock to Escape
Bind.Remap("CapsLock", "Escape")

Software vs hardware

The same script runs two ways; only the transport changes. Software mode emits output through your operating system’s input APIs — SendInput on Windows, CGEvent on macOS, uinput on Linux — free and with no device required, so you can write and test a script end to end before deciding where its output should come from.

Hardware output routes the result through a Teensy 4.x as real USB HID for deterministic, host-isolated timing at up to 8,000 Hz: the Rebind engine runs your scripts — up to 8,000 Hz — and output leaves through the device as real USB HID., so each event is handled in under a millisecond and your PC just sees a USB peripheral. A script declares its tick rate with a modeline, and on Windows the relay raises the system timer resolution to 1 ms so the loop runs at its declared rate.

Hardware also unlocks one capability software mode cannot offer on any OS: suppressing and transforming mouse movement (mouse_block scripts — inverters, acceleration curves, tremor filters). The operating system draws the cursor below anything a host process can intercept, so only a device that owns the input stream can rewrite motion. Keys, buttons, and scroll can be blocked in both modes.

-- Modeline: declare the tick rate at the top of a script
-- rebind: tick_rate=8000

See Quickstart to start in software mode.