# RegisterCustomHandler(string, Action<string, EntityId[]>, Func<string, EditorWindow, bool>)

> Registers a handler for custom non-Object based selection in selection history.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static void RegisterCustomHandler(string key, Action<string, EntityId[]> handler, Func<string, EditorWindow, bool> validator = null)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A unique string that identifies the selection handler.**** (\[Action\<string, EntityId\[]>]\(https\://learn.microsoft.com/dotnet/api/system.action)): A function that handles custom non-Object based selection in selection history.**** (\[Func\<string, EditorWindow, bool>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): A function that validates custom non-Object based selection in selection history. Use the Validator to confirm that the given selection represented by `customData` is still valid within the given window (optional).

### Remarks

The Editor's selection history normally tracks only regular Object-based selection. If you have an Editor window or an Editor tool that has a custom "selection" concept and you want that to participate in the selection history, use [Selection.RegisterCustomHandler](/engine/6000.7/script-reference/unityeditor/selection/registercustomhandler.md) and [Selection.SetCustomSelection](/engine/6000.7/script-reference/unityeditor/selection/setcustomselection.md). Unity calls this handler when a user navigates back to a selection entry that was recorded with [Selection.SetCustomSelection](/engine/6000.7/script-reference/unityeditor/selection/setcustomselection.md). The handler decodes the custom selection data from `customData` string, and can optionally use the passed `selectedObjects` EntityIDs. Additional Resources: [Selection.RegisterCustomHandler](/engine/6000.7/script-reference/unityeditor/selection/registercustomhandler.md), [Selection.SetCustomSelection](/engine/6000.7/script-reference/unityeditor/selection/setcustomselection.md).
