# CaptureMouse(IEventHandler)

> Assigns an event handler to capture mouse events.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public static void CaptureMouse(this IEventHandler handler)
```

### Parameters

**** (\[IEventHandler]\(/engine/6000.0/script-reference/unityengine/uielements/ieventhandler)): 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.
