The Input API provides access to mouse, keyboard, and UI-hover information from Lua scripts.
These functions are intended to be used inside on_frame().
π± Mouse Input
Mouse Position
x, y=get_mouse_pos()
Returns the cursor position inside the game/overlay window.
x, y=get_mouse_pos_desktop()
Returns the cursor position in desktop/screen coordinates.
Mouse Delta
dx, dy=get_mouse_delta()
Movement since last frame in overlay space.
dx, dy=get_mouse_delta_desktop()
Movement since last frame in desktop space.
Scroll Wheel
amount=get_scroll_delta()
Positive for scroll up, negative for scroll down.
Movement Event
Returns true if the mouse moved this frame.
Hover Detection
Returns true if the mouse is inside the rectangle (x, y, w, h).
β¨οΈ Keyboard Input
Key Down
Returns true while key is held.
Raw Down
Reflects OS-level down state before filtering.
Fired
Behaves like text input
Toggle
Toggles each time the key is pressed (flip-flop behavior).
Single Press
True only on the first frame the key is pressed.
Previous State
State from the previous frame.
π Full Key State
Returns all internal state fields for a virtual key.