Skip to main content
rb.input reads input as Rebind sees it: which keys, mouse buttons and controller buttons are held and for how long, the cursor position, the modifiers, controller axes, and the devices Rebind has identified. A script reaches for it inside a handler or bind to check what else is held at that moment. This script runs on F and lets it through. With Ctrl held it logs the cursor position, and with W held it logs how long W has been down:
code uses the names handlers receive, with case ignored. An unknown name returns false or 0, except that rb.input.axis raises on one. A controller button name such as "PadA" needs min_sdk=3.11.0; see Controllers. For the exclusive-capture rule of down and up handlers, see Input events. rb.input is updated before handlers and binds run. In a down handler or bind callback the pressed key already reads as held. In an up handler or a bind’s release it already reads as released, so rb.input.duration returns 0 there. To time a press, use the up handler’s duration_ms, or record rb.system.time() in the bind callback and compare in release. A key another device still holds keeps reading as held.