Skip to main content
rb.overlay draws on top of every app, full-screen games included, and never takes focus or clicks, so the app underneath keeps every input the overlay does not claim. Use it to show a script’s state while you play or work, to say when a job is done, or to pick an action from a menu without leaving the game. Before you start:
  • Windows or macOS. Some full-screen games hide overlays; see Limits in the overlay reference.
  • min_sdk=3.9.0. rb.overlay has no v1 name.

Count presses of a key

A strip at the top of the screen shows how often you pressed a key. Text is a list of spans, each with its own color, so the number can stand out from its label.
The handler returns nothing, so the key still reaches the app. strip.set redraws the same strip; a script that sets it every tick is fine, because the relay draws only the latest state.

Show progress, then say when it is done

A hotkey presses a key a set number of times with a pause between presses. A bar in the corner fills as it goes, and a toast reports the end.
rb.hid.press and rb.sleep wait, so the loop runs inside rb.async. The toast stays four seconds by default; pass duration in milliseconds to change it.

Pick a saved reply from a menu

A hotkey opens a menu of replies. Up and Down move the highlight, Enter or a number types the reply, and Escape closes the menu. Those keys go to the menu only while it is open.
The menu never takes focus, so the reply is typed into the app you were using. When the menu cannot open, for example while another script’s menu is open, rb.overlay.menu returns nil and the reason.

Draw your own panel

For a layout the widgets do not cover, draw a surface yourself: rectangles and lines of text placed in logical units from its top-left corner. rb.overlay.measure sizes the panel to its text. This one shows the time in the top-left corner.
Every op, placement option and limit is in the overlay reference.