Struct MouseState
Combine a single pointer with buttons and a scroll wheel.
Namespace: UnityEngine.InputSystem.LowLevel
Syntax
public struct MouseState : IInputStateTypeInfo
Fields
buttons
Button mask for which buttons on the mouse are currently pressed.
Declaration
public ushort buttons
Field Value
Type | Description |
---|---|
UInt16 | Button state mask. |
See Also
clickCount
Number of clicks performed in succession.
Declaration
public ushort clickCount
Field Value
Type | Description |
---|---|
UInt16 | Successive click count. |
See Also
delta
Screen-space motion delta of the mouse in pixels.
Declaration
public Vector2 delta
Field Value
Type | Description |
---|---|
Vector2 | Mouse movement. |
See Also
position
Screen-space position of the mouse in pixels.
Declaration
public Vector2 position
Field Value
Type | Description |
---|---|
Vector2 | Position of mouse on screen. |
See Also
scroll
Scroll-wheel delta of the mouse.
Declaration
public Vector2 scroll
Field Value
Type | Description |
---|---|
Vector2 | Scroll wheel delta. |
See Also
Properties
format
Returns Format.
Declaration
public readonly FourCC format { get; }
Property Value
Type | Description |
---|---|
FourCC |
Implements
See Also
Format
Memory format identifier for MouseState.
Declaration
public static readonly FourCC Format { get; }
Property Value
Type | Description |
---|---|
FourCC | Returns "MOUS". |
See Also
Methods
WithButton(MouseButton, Boolean)
Set the button mask for the given button.
Declaration
public MouseState WithButton(MouseButton button, bool state = true)
Parameters
Type | Name | Description |
---|---|---|
MouseButton | button | Button whose state to set. |
Boolean | state | Whether to set the bit on or off. |
Returns
Type | Description |
---|---|
MouseState | The same MouseState with the change applied. |