Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetMouseButton(int)

Interface to Input.GetMouseButton. Can be overridden to provide custom input instead of using the Input class.
Read time 1 minuteLast updated 10 days ago

Definition

Warning
Deprecated. EventSystem no longer supports input override for legacy input. Install Input System package for full input binding functionality.
public virtual bool GetMouseButton(int button)

Parameters

button

The button id. Values are 0 for left button, 1 for right button, 2 for the middle button.

Returns

Type

Description

boolReturns whether the given mouse button is held down.