Class Mouse
A mouse input device.
Inherited Members
Namespace: UnityEngine.InputSystem
Syntax
public class Mouse : Pointer, IInputStateCallbackReceiver
Remarks
Adds a scroll wheel and a typical 3-button setup with a left, middle, and right button.
To control cursor display and behavior, use
Properties
backButton
Declaration
public ButtonControl backButton { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
clickCount
Declaration
public IntegerControl clickCount { get; }
Property Value
Type | Description |
---|---|
IntegerControl |
current
The mouse that was added or updated last or null if there is no mouse connected to the system.
Declaration
public static Mouse current { get; }
Property Value
Type | Description |
---|---|
Mouse |
forwardButton
Declaration
public ButtonControl forwardButton { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
leftButton
The left mouse button.
Declaration
public ButtonControl leftButton { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
middleButton
The middle mouse button.
Declaration
public ButtonControl middleButton { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
rightButton
The right mouse button.
Declaration
public ButtonControl rightButton { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
scroll
The horizontal and vertical scroll wheels.
Declaration
public Vector2Control scroll { get; }
Property Value
Type | Description |
---|---|
Vector2Control |
Methods
FinishSetup()
Declaration
protected override void FinishSetup()
Overrides
MakeCurrent()
Declaration
public override void MakeCurrent()
Overrides
OnAdded()
Declaration
protected override void OnAdded()
Overrides
OnEvent(InputEventPtr)
Declaration
protected void OnEvent(InputEventPtr eventPtr)
Parameters
Type | Name | Description |
---|---|---|
InputEventPtr | eventPtr |
OnNextUpdate()
Declaration
protected void OnNextUpdate()
OnRemoved()
Declaration
protected override void OnRemoved()
Overrides
WarpCursorPosition(Vector2)
Move the operating system's mouse cursor.
Declaration
public void WarpCursorPosition(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | New position in player window space. |
Remarks
The position property will not update immediately but rather will update in the next input update.
Explicit Interface Implementations
IInputStateCallbackReceiver.OnNextUpdate()
Declaration
void IInputStateCallbackReceiver.OnNextUpdate()
Implements
IInputStateCallbackReceiver.OnStateEvent(InputEventPtr)
Declaration
void IInputStateCallbackReceiver.OnStateEvent(InputEventPtr eventPtr)
Parameters
Type | Name | Description |
---|---|---|
InputEventPtr | eventPtr |