# CapturePointer(IEventHandler, int)

> Captures the pointer.

## Definition

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

```csharp
public static void CapturePointer(this IEventHandler handler, int pointerId)
```

### Parameters

**** (\[IEventHandler]\(/engine/6000.0/script-reference/unityengine/uielements/ieventhandler)): The VisualElement that captures the pointer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The pointer to capture.

### Remarks

When a VisualElement captures a pointer, all pointer events are sent to the element, regardless of which element is under the pointer.
