Version: Unity 6.2 (6000.2)
LanguageEnglish
  • C#
Method group is Obsolete

InputWrapper.GetMouseButton

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Obsolete EventSystem no longer supports input override for legacy input. Install Input System package for full input binding functionality.

Declaration

public bool GetMouseButton(int button);

Parameters

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

Returns

bool Returns whether the given mouse button is held down.

Description

Interface to Input.GetMouseButton. Can be overridden to provide custom input instead of using the Input class.