Yuari
Documentation
Docs/Services/UserInputService.IsMouseButtonPressed

UserInputService.IsMouseButtonPressed

State queries — accepts the same key formats as iskeypressed.

Syntax

UserInputService.IsMouseButtonPressed(button: any) -> boolean

Parameters

ParameterTypeDescription
buttonanyThe button value used by the call.

Returns

TypeDescription
booleanBoolean

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.