Engine

core.engine.is_input_blocked

Client

Retrieves whether game input is currently blocked by a UI

Syntax

local result = core.engine.is_input_blocked()

Scripts must check this themselves to stop reacting to game input.

  • Covers — the console, the main menu, the splash and any visible, non-overlay webview that has focus without forward_input.
  • Not covered — forward_input webviews and overlays don't count, so the player can keep moving while they are open.
  • Your responsibility — key binds and polled input (util.input.is_pressed, util.input.get_cursor_velocity) keep reporting while a UI is open, so check this flag each frame before moving or rotating.

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
boolresulttrue if a UI is blocking game input, false otherwise

Examples

Checks if game input is currently blocked
core.engine.print("info", "Input blocked:", core.engine.is_input_blocked())
Ignores movement and camera input while a UI is open
util.event.on("sandbox:process", function(delta)
    if core.engine.is_input_blocked() then return end

    local velocity = util.input.get_cursor_velocity()
    -- Rotate the camera using velocity
end)

On this page