Class Mouse
A mouse input device.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: UnityEngine.Experimental.Input
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
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 |
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.