InputEscapeManager is a static class that manages escape actions in a stack-like manner. It allows pushing, popping, and executing registered escape actions. This system ensures that only the most recent escape action is executed when triggered.
Info: UIViewActionEscape uses InputEscapeManager. While Luna UI uses this to exit from UIViews, it can also be used for other purposes beyond UI.
You can push an action onto the escape stack, optionally providing a unique key and an insertion index.
// Method signature:
public static void Push(Action action, Guid? key = null, int insert = -1)
// Simple usage:
InputEscapeManager.Push(() => Debug.Log("Escape action triggered"));
// With a specific key:
Guid actionKey = Guid.NewGuid();
InputEscapeManager.Push(() => Debug.Log("Keyed escape action"), actionKey);
// Inserting at a specific position:
InputEscapeManager.Push(() => Debug.Log("Inserted action"), null, 0);Pops and executes the most recent escape action.
// Simple usage:
InputEscapeManager.Pop();
// Popping a specific action by key, ignoring order:
InputEscapeManager.Pop(actionKey);
// Popping without execution:
InputEscapeManager.PopWithoutExecute(actionKey);Temporarily block escape actions from executing
//To temporarily block escape actions from executing:
InputEscapeManager.SetBlocked(true);
//To allow execution again:
InputEscapeManager.SetBlocked(false);Triggered when an escape action occurs. By default, it calls Pop() to execute the last action. Can be triggered manually to execute the last action.
Settings
Theme
Light
Contrast
Material
Dark
Dim
Material Dark
System
Sidebar(Light & Contrast only)
Font Family
DM Sans
Wix
Inclusive Sans
AR One Sans
Direction