For thread safety, this property is not safe to read in an unsynchronized thread.
This function returns an array of
InputObject|InputObjects corresponding to the mouse buttons currently being pressed down.
Mouse buttons that are tracked by this function include:
|MouseButton1||The left mouse button.|
|MouseButton2||The right mouse button.|
|MouseButton3||The middle mouse button.|
If the user is not pressing any mouse button down when the function is called, it will return an empty array.
UserInputService is client-side only, this function can only be used in a
An array of
Check which MouseButtons are Pressed
This example checks if the user pressed MouseButton1, MouseButton2, or both mouse buttons on
The example can be extended to behave differently depending on which mouse buttons are pressed.