WheelEvent
This event is sent when the mouse wheel moves.
Read time 3 minutesLast updated 2 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: MouseEventBase<WheelEvent>
- Implements: IDisposable, IMouseEvent
public class WheelEvent : MouseEventBase<WheelEvent>, IDisposable, IMouseEvent
Remarks
The mouse wheel event is sent to the visual element under the mouse when the mouse scroll wheel value changes. A WheelEvent uses the default mouse event propagation path: it trickles down, bubbles up and can be cancelled. Disabled elements won't receive this event by default.
Static Fields
Value | Description |
|---|---|
| scrollDeltaPerTick | The magnitude of WheelEvent.delta that corresponds to exactly one tick of the scroll wheel. |
Constructors
Constructor | Description |
|---|---|
| WheelEvent() | Constructor. Use GetPooled() to get an event from a pool of reusable events. |
Properties
Property | Description |
|---|---|
| delta | The amount of scrolling applied with the mouse wheel. |
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 |