Skip to main content
The s&box editor supports keyboard shortcuts for common actions. You can also define your own shortcuts in an editor project.

Defining custom shortcuts

Static shortcuts

A static shortcut runs regardless of which widget is focused, as long as the main editor window is in focus. Add the [Shortcut] attribute to any static function:
[Shortcut("scene.toggle-gizmos", "SHIFT+G")]
static void ToggleGizmos()
{
    // Runs when SHIFT+G is pressed in the editor
}

Widget shortcuts

A widget shortcut only runs when a specific widget (or a window containing it) is in focus:
[Shortcut("mesh.merge", "M", typeof(SceneViewportWidget), ShortcutType.Widget)]
private void Merge()
{
    // Runs when M is pressed while a SceneViewportWidget is focused
}
The [Shortcut] attribute takes:
  1. A unique shortcut name (used for rebinding)
  2. The default key binding
  3. (Optional) The widget type that must be in focus
  4. (Optional) ShortcutTypeWidget, Window, or Application
Users can rebind all shortcuts in the editor preferences.

Built-in shortcuts reference

Scene and play mode

ActionShortcut
Play / StopF5
Save sceneCtrl+S
Save allCtrl+Shift+S
Open sceneCtrl+O
New sceneCtrl+N

Transform tools

ActionShortcut
Select toolQ
Translate (move)W
RotateE
ScaleR
Toggle local/world spaceX

Scene viewport navigation

ActionShortcut
Focus selected objectF
Frame all objectsA
Orbit cameraAlt + Left Mouse
Pan cameraAlt + Middle Mouse or Middle Mouse drag
ZoomScroll Wheel or Alt + Right Mouse
Fly camera (hold)Right Mouse + W A S D

Selection and editing

ActionShortcut
Select allCtrl+A
Deselect allEscape
DuplicateCtrl+D
DeleteDelete
UndoCtrl+Z
RedoCtrl+Y or Ctrl+Shift+Z
CutCtrl+X
CopyCtrl+C
PasteCtrl+V

Hierarchy and assets

ActionShortcut
Rename selectedF2
Expand all in treeCtrl + Right Arrow
Collapse all in treeCtrl + Left Arrow
Search in Asset BrowserCtrl+F
You can rebind any shortcut in Edit → Preferences → Keybinds. Shortcuts defined with [Shortcut] in your editor project also appear there and can be rebound by users.