# 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 Dispose() to release them.

## Definition

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

## GetPooled(Event)

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 `Dispose()` to release them.

```csharp
public static T GetPooled(Event systemEvent)
```

### Parameters

**** (\[Event]\(/engine/6000.7/script-reference/unityengine/event)): An IMGUI mouse event.

### Returns

| Type | Description           |
| ---- | --------------------- |
| T    | An initialized event. |

## GetPooled(Touch, EventModifiers)

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 `Dispose()` to release them.

```csharp
public static T GetPooled(Touch touch, EventModifiers modifiers = EventModifiers.None)
```

### Parameters

**** (\[Touch]\(/engine/6000.7/script-reference/unityengine/touch)): A [Touch](/engine/6000.7/script-reference/unityengine/touch.md) structure from the InputManager.**** (\[EventModifiers]\(/engine/6000.7/script-reference/unityengine/eventmodifiers)): The modifier keys held down during the event.

### Returns

| Type | Description           |
| ---- | --------------------- |
| T    | An initialized event. |

## GetPooled(PenData, EventModifiers)

Gets a pointer 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 `Dispose()` to release them.

```csharp
public static T GetPooled(PenData pen, EventModifiers modifiers = EventModifiers.None)
```

### Parameters

**** (\[PenData]\(/engine/6000.7/script-reference/unityengine/pendata)): A [PenData](/engine/6000.7/script-reference/unityengine/pendata.md) structure from the InputManager containing pen event information.**** (\[EventModifiers]\(/engine/6000.7/script-reference/unityengine/eventmodifiers)): The modifier keys held down during the event.

### Returns

| Type | Description           |
| ---- | --------------------- |
| T    | An initialized event. |

## GetPooled(IPointerEvent)

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 `Dispose()` to release them.

```csharp
public static T GetPooled(IPointerEvent triggerEvent)
```

### Parameters

**** (\[IPointerEvent]\(/engine/6000.7/script-reference/unityengine/uielements/ipointerevent)): The event that sent this event.

### Returns

| Type | Description           |
| ---- | --------------------- |
| T    | An initialized event. |
