Volt

iswindowactive

Checks if the game window is currently focused.

Syntax

iswindowactive() -> boolean

Aliases

  • isrbxactive
  • isgameactive

Returns

TypeDescription
booleanTrue if game window is focused

Description

iswindowactive returns whether the Roblox game window is currently the active/focused window. This is useful for input simulation to ensure inputs only occur when the game is focused.

Example

-- Only simulate input when game is focused
if iswindowactive() then
    keypress(0x20) -- Press space
    task.wait(0.1)
    keyrelease(0x20)
end

Wait for Focus

-- Wait until game is focused before executing
repeat task.wait() until iswindowactive()
print("Game is now focused!")

On this page