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(InputDeviceBuilder)
Declaration
protected override void FinishSetup(InputDeviceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
InputDeviceBuilder | builder |
Overrides
MakeCurrent()
Declaration
public override void MakeCurrent()
Overrides
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.OnBeforeWriteNewState(Void*, Void*)
Declaration
void IInputStateCallbackReceiver.OnBeforeWriteNewState(void *oldStatePtr, void *newStatePtr)
Parameters
Type | Name | Description |
---|---|---|
System.Void* | oldStatePtr | |
System.Void* | newStatePtr |
Implements
IInputStateCallbackReceiver.OnCarryStateForward(Void*)
Declaration
bool IInputStateCallbackReceiver.OnCarryStateForward(void *statePtr)
Parameters
Type | Name | Description |
---|---|---|
System.Void* | statePtr |
Returns
Type | Description |
---|---|
System.Boolean |