UserInputService.IsMouseButtonPressed
State queries — accepts the same key formats as iskeypressed.
Syntax
UserInputService.IsMouseButtonPressed(button: any) -> boolean
Parameters
| Parameter | Type | Description |
|---|---|---|
button | any | The button value used by the call. |
Returns
| Type | Description |
|---|---|
boolean | Boolean |
Description
UserInputService.IsMouseButtonPressed is part of the Services library. Service shims are pumped by the external tick loop and expose the parts of Roblox services the VM supports.
The call is a predicate: it inspects the current state and returns a boolean without modifying anything.
The aliases IsKeyDown(key) resolve to the same implementation.
Example
print(UserInputService.IsMouseButtonPressed(1))
print(UserInputService.IsKeyDown("f"))
Notes
- Aliases:
IsKeyDown(key). - Service signals are pumped by the external tick loop.