UI Toolbox logoUI Toolbox

Keyboard shortcuts

The workspace runs a WindowCommand for each shortcut. workspace.RunCommand(command) runs the same commands from code.

Command Default keys Action
NextWindow Ctrl+Tab, Ctrl+F6 Focus the bottom-most window. Repeat to visit every window.
PreviousWindow Ctrl+Shift+Tab, Ctrl+Shift+F6 Go back to the previous window.
CloseWindow Ctrl+W, Ctrl+F4 Close the focused window. A tab group closes with all its tabs.
ToggleMinimize Ctrl+M Minimize the focused window, or restore it.
ToggleMaximize F11 Maximize the focused window, or restore it.
MoveLeft, MoveRight, MoveUp, MoveDown Ctrl+Arrows Move the focused window by keyboard-step pixels. It stays in the viewport.
ResizeNarrower, ResizeWider, ResizeShorter, ResizeTaller Ctrl+Shift+Arrows Move the right or bottom edge by keyboard-step pixels, within the minimum size and the viewport.

Move and resize do nothing on a minimized or maximized window.

With the Input System package

When the com.unity.inputsystem package is installed and the active input handler includes it, the shortcuts are Input System actions:

Players can rebind with the standard Input System APIs on workspace.ActiveInputActionMap:

var action = workspace.ActiveInputActionMap!.FindAction(nameof(WindowCommand.CloseWindow));
action.Disable();
action.PerformInteractiveRebinding(bindingIndex).OnComplete(op => { op.Dispose(); action.Enable(); }).Start();

// Save and load the player's keys.
PlayerPrefs.SetString("tb-keys", workspace.ActiveInputActionMap.asset.SaveBindingOverridesAsJson());
workspace.ActiveInputActionMap.asset.LoadBindingOverridesFromJson(PlayerPrefs.GetString("tb-keys"));

ActiveInputActionMap is null until the workspace attaches to a runtime panel, and when the asset has no UIToolbox map. With no UIToolbox map, the workspace logs a warning and uses the fixed keys.

Gamepad

The default asset also has gamepad bindings:

Command Gamepad
NextWindow, PreviousWindow Right shoulder, left shoulder
CloseWindow View (select)
ToggleMinimize Right stick press
ToggleMaximize Y (north button)
Move Right stick
Resize Left trigger + right stick

Focus and the focus ring

Without the Input System package

The workspace reads the default keys from UI Toolkit KeyDownEvent. These keys are fixed. On macOS, Cmd replaces Ctrl.

Rules for both