Platforms
Rebind runs on Windows, macOS, and Linux, and the same scripts move between them.
The core runtime and the namespaces most scripts use — HID, remapping (Bind) and
the input hooks, Macro/Timer/Math/Net/File/JSON/Regex/Config/Process/System.Exec,
UI/Log/Input, and the Run/Sleep/After/Async globals — are identical on
all three OSes. A few namespaces depend on OS-specific APIs and are limited or absent
on some platforms. This page maps what runs where, and why.
Platform support
The table below lists every namespace with platform-specific behavior. Everything not in the table is fully cross-platform.
| Namespace | Windows | macOS | Linux |
|---|---|---|---|
| Screen | Full (GDI) | Full (CoreGraphics) | Stub (Screen.List via display-info) |
| Window | Full (Win32) | Enumeration + Kill/IsActive/WaitActive/WaitClose; rest best-effort | Stub |
| Clipboard | Full (Win32) | Full (arboard) | Stub |
| Pipe | Full (shared memory) | Not available | Not available |
| Registry | Full (Win32) | Not available | Not available |
| Dialog | Full (native) | Full (native) | Requires Zenity/KDialog/YAD |
| System.Exec | cmd.exe /C | sh -c | sh -c |
The rest — Input, Macro, Timer, Math, JSON, Hash, Codec, Env,
Log, File, Net, UI, Bind, Script, Regex, Config — is fully
cross-platform. Software and hardware mode run the same scripts; neither changes this
table — namespace availability is a property of the OS, not the transport. The one
capability split between modes is mouse_block: suppressing or transforming mouse
movement requires a Rebind device on every OS, because the cursor is drawn below
anything a host process can intercept. Key, button, and scroll blocking work in both
modes. For hardware setup, see Hardware.
- Screen samples pixels on Windows (GDI BitBlt) and macOS (CoreGraphics /
ScreenCaptureKit). On Linux pixel sampling is stubbed, not absent:
Screen.GetPixelColoris still callable but returns a fixed"000000"(black) instead of a real pixel, andScreen.SearchForColorreturnsnil— neither raises an error. OnlyScreen.List(display enumeration) is real on Linux. - Window is full on Windows. On macOS, enumeration (
Find,List) plusKill,IsActive,WaitActive, andWaitCloseare real. The manipulation calls split two ways:Move,Activate,Minimize,Maximize,Restore, andCloseare silent no-ops — they return success and do nothing, so apcallaround them will not catch an error — while the Accessibility-gated callsSetTitle,SetAlwaysOnTop,SetTransparency,GetClass,Hide, andShowraise a “not supported on macOS without accessibility” error you can guard withpcall.Window.GetTitlereturns an empty string on macOS; titles are only available via thetitlefield onWindow.List/Window.Findentries. On Linux, Window is a stub. - Pipe (shared-memory IPC) and Registry are Windows-only. They raise an error on macOS and Linux. POSIX shared-memory support for Pipe is planned.
- Clipboard works on Windows and macOS; it is a stub on Linux.
- Dialog is native on Windows and macOS; on Linux it needs Zenity, KDialog, or YAD installed.
If you target multiple platforms, guard the OS-specific calls. pcall catches the
“not available” error a Windows-only namespace raises on macOS or Linux:
local ok = pcall(function()
Registry.Write([[HKCU\Software\MyScript]], "REG_SZ", "Profile", "default")
end)
if not ok then
-- portable fallback: persist to the script directory
Config.WriteTOML("profile.toml", { profile = "default" })
end