Class MouseCaptureController
Class that manages capturing mouse events.
Namespace: UnityEngine.UIElements
Syntax
public static class MouseCaptureController : object
Methods
CaptureMouse(IEventHandler)
Assigns an event handler to capture mouse events.
Declaration
public static void CaptureMouse(this IEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
IEventHandler | handler | The event handler that captures mouse events. |
Remarks
If an event handler is already set to capture mouse events, the event handler is replaced with the handler specified by this method.
HasMouseCapture(IEventHandler)
Checks if the event handler is capturing the mouse.
Declaration
public static bool HasMouseCapture(this IEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
IEventHandler | handler | Event handler to check. |
Returns
Type | Description |
---|---|
Boolean | True if the handler captures the mouse. |
IsMouseCaptured()
Checks if there is a handler capturing the mouse.
Declaration
public static bool IsMouseCaptured()
Returns
Type | Description |
---|---|
Boolean | True if a handler is capturing the mouse, false otherwise. |
ReleaseMouse()
Stops an event handler from capturing the mouse.
Declaration
public static void ReleaseMouse()
ReleaseMouse(IEventHandler)
Stops an event handler from capturing the mouse.
Declaration
public static void ReleaseMouse(this IEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
IEventHandler | handler | The event handler to stop capturing the mouse. If this handler is not assigned to capturing the mouse, nothing happens. |