MouseEventBase<T>
The base class for mouse events.
Read time 3 minutesLast updated 2 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: EventBase<T>
- Implements: IDisposable, IMouseEvent
public abstract class MouseEventBase<T> : EventBase<T>, IDisposable, IMouseEvent where T : MouseEventBase<T>, new()
Remarks
Refer to the Mouse events manual page for more information and examples.
Properties
Property | Description |
|---|---|
| actionKey | Returns true if the platform-specific action key is pressed. |
| altKey | Returns true if the Alt key is pressed. |
| button | A value that indicates which mouse button was pressed or released (if any) to cause this event: 0 is the left button, 1 is the right button, 2 is the middle button. A negative value indicates that no mouse button changed state during this event. |
| clickCount | The number of times a button is pressed consecutively. |
| commandKey | Returns true if the Windows/Cmd key is pressed. |
| ctrlKey | Returns true if the Ctrl key is pressed. |
| currentTarget | The current target of the event. The current target is the element in the propagation path for which event handlers are currently being executed. |
| localMousePosition | The mouse position in the current target coordinate system. |
| modifiers | Flags that hold pressed modifier keys (Alt, Ctrl, Shift, Windows/Cmd). |
| mouseDelta | Gets the difference between the mouse's position during the previous mouse event and its position during the current mouse event. |
| mousePosition | The mouse position in the panel coordinate system. |
| pressedButtons | A bitmask that describes the currently pressed buttons. |
| shiftKey | Returns true if the Shift key is pressed. |
Methods
Method | Description |
|---|---|
| Init | Resets the event members to their initial values. |
Static Methods
Method | Description |
|---|---|
| GetPooled | Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use |