> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# iswindowactive

Returns `true` when the Roblox window has OS focus, `false` otherwise.

```luau theme={null}
iswindowactive(): boolean
```

The window is "active" when Roblox holds your operating system's focus.

Input functions like `mouse1click` and `keypress` require this to return `true` to fire.

## Returns

| Type      | Description                                                 |
| --------- | ----------------------------------------------------------- |
| `boolean` | `true` if the Roblox window is in focus, `false` otherwise. |

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  local active = iswindowactive()
  =======
  -- iswindowactive(): boolean
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  print("Game active: ", isrbxactive())
  ```
</CodeGroup>

<Tip>
  Use this check to avoid sending keystrokes or mouse clicks when the game window is minimized.
</Tip>
