Interface IMouseEvent
Interface for mouse events.
Namespace: UnityEngine.UIElements
Syntax
public interface IMouseEvent
Properties
actionKey
Returns true if the platform-specific action key is pressed. This key is Cmd on macOS, and Ctrl on all other platforms.
Declaration
bool actionKey { get; }
Property Value
Type | Description |
---|---|
Boolean |
altKey
Return true if the Alt key is pressed.
Declaration
bool altKey { get; }
Property Value
Type | Description |
---|---|
Boolean |
button
Integer that indicates which mouse button is pressed: 0 is the left button, 1 is the right button, 2 is the middle button.
Declaration
int button { get; }
Property Value
Type | Description |
---|---|
Int32 |
clickCount
The number of times the button is pressed.
Declaration
int clickCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
commandKey
Return true if the Windows/Command key is pressed.
Declaration
bool commandKey { get; }
Property Value
Type | Description |
---|---|
Boolean |
ctrlKey
Return true if the Ctrl key is pressed.
Declaration
bool ctrlKey { get; }
Property Value
Type | Description |
---|---|
Boolean |
localMousePosition
The mouse position in the current target coordinate system.
Declaration
Vector2 localMousePosition { get; }
Property Value
Type | Description |
---|---|
Vector2 |
modifiers
Flag set holding the pressed modifier keys (Alt, Ctrl, Shift, Windows/Command).
Declaration
EventModifiers modifiers { get; }
Property Value
Type | Description |
---|---|
EventModifiers |
mouseDelta
Mouse position difference between the last mouse event and this one.
Declaration
Vector2 mouseDelta { get; }
Property Value
Type | Description |
---|---|
Vector2 |
mousePosition
The mouse position in the panel coordinate system.
Declaration
Vector2 mousePosition { get; }
Property Value
Type | Description |
---|---|
Vector2 |
pressedButtons
A bitmask that describes the currently pressed buttons.
Declaration
int pressedButtons { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Pressing a mouse button sets a bit; releasing the button clears it. The left mouse button sets/clears Bit 0. The right mouse button sets/clears Bit 1. The middle mouse button sets/clears Bit 2. Additional buttons set/clear other bits.
shiftKey
Return true if the Shift key is pressed.
Declaration
bool shiftKey { get; }
Property Value
Type | Description |
---|---|
Boolean |