# Keyboard shortcuts

The default keyboard shortcut for every tool and command, and how to change them.

_Shortcuts are written for Windows and Linux. On a Mac, use ⌘ Cmd where they say Ctrl, and ⌥ Option for Alt._

These are the default shortcuts. **Mod** is Ctrl on Windows and Linux, and ⌘ on a Mac; this page
shows them for your system. Change any of them in Settings > Keyboard Shortcuts..., where you can also
export your set and import it in another browser.

The [keyboard quick reference](https://pxstud.io/quick-reference) has the default list on one printable page, with
a practice mode. Shortcuts you've changed are listed in Settings > Keyboard Shortcuts....

A few keys are worth knowing first:

- Pressing a tool's key again switches to the next tool on the same toolbar button.
- Holding `Alt` over the canvas picks a color with the Eyedropper until you let go, and
  holding `Space` pans with a drag, whatever the tool.
- The arrow keys work as in Aseprite: with a selection they move its pixels (`Shift`: one grid
  cell); without one, `←` and `→` step through the frames (going round at the ends) and
  `↑` and `↓` through the layers. `,` and
  `.` loop inside the current tag. With the canvas focused from the keyboard,
  the arrows draw instead ([keyboard drawing](https://pxstud.io/docs/manual/guides/accessibility.md#drawing-with-the-keyboard)).
- Undo and redo go to the frame and layer they changed, so you see what they did.
- `Tab` only ever moves between controls; it's never a shortcut.
- `?` (whichever keys type a question mark on your keyboard) opens
  Settings > Keyboard Shortcuts....
- Number fields take maths: type `32*2`, `(16+8)*2` or `2^5` and press `Enter` (or leave the
  field) for the result. They accept + − × ÷, `^` (power), `%` (remainder), `!` (factorial) and
  brackets, with `.` or `,` for decimals. `↑` and `↓`, or the mouse wheel over the focused
  field, step the value (`Shift`, `PageUp` and `PageDown`: by 10).
- Number fields also scrub: drag sideways from a field's label or its small arrows to change the
  value (`Shift` for fine steps, `Alt` for big ones, `Esc` puts it back); clicking
  the number itself still edits it. Sizes in sprite pixels, such as the brush size and the line
  width, stop at the sprite's size.
- Browsers keep some keys for themselves, so a few commands use another: a new sprite is
  `Ctrl+Alt+N`, not Mod+N.
- A command can also run from a mouse button (middle, right, back or forward) or a wheel
  direction, with or without modifier keys: in Settings > Keyboard Shortcuts..., click **Add**, then
  click that button or turn the wheel on the field. They act over the canvas, where a binding
  replaces what the button or wheel does there.

## Tools

| Tool | Shortcut |
| - | - |
| Rectangular Selection | `M` |
| Elliptical Selection | `Shift+M` |
| Lasso Selection | `Q` |
| Polygonal Lasso Selection | `Shift+Q` |
| Magic Wand | `W` |
| Pencil | `B` |
| Spray | `Shift+B` |
| Scatter | `Alt+Shift+B` |
| Dither | none |
| Eraser | `E` |
| Eyedropper | `I` |
| Zoom | `Z` |
| Hand | `H` |
| Move | `V` |
| Slice | `Shift+C` |
| Paint Bucket | `G` |
| Gradient | `Shift+G` |
| Tile Stamp | none |
| Rectangle | `U` |
| Ellipse | `Shift+U` |
| Triangle | none |
| Hexagon | none |
| Star | none |
| Iso Shape | `K` |
| Contour | `D` |
| Polygon | `Shift+D` |
| Blur | `R` |
| Jumble | none |
| Dodge/Burn | `O` |
| Line | `L` |
| Curve | `Shift+L` |
| Ruler | `Shift+R` |
| Text | `T` |

## File

| Command | Shortcut |
| - | - |
| New Sprite... | `Ctrl+Alt+N` |
| Open... | `Ctrl+O` |
| Save | `Ctrl+S` |
| Save As... | `Ctrl+Shift+S` |
| Export... | `Ctrl+Alt+Shift+S` |
| Close | `Ctrl+Alt+W` |

## Edit

| Command | Shortcut |
| - | - |
| Undo | `Ctrl+Z` |
| Redo | `Ctrl+Shift+Z` or `Ctrl+Y` |
| Cut | `Ctrl+X` |
| Copy | `Ctrl+C` |
| Paste | `Ctrl+V` |
| Delete | `Del` or `Backspace` |
| Fill | `F` |
| Flip Horizontal | `Shift+H` |
| Flip Vertical | `Shift+V` |
| Command Palette... | `Ctrl+K` |
| Cel > Tween... | `Shift+T` |

## Sprite

| Command | Shortcut |
| - | - |
| Sprite Size... | `Ctrl+Alt+I` |
| Canvas Size... | `Alt+C` |

## Layer

| Command | Shortcut |
| - | - |
| New Layer | `Shift+N` |
| Tilemap > Toggle Tiles/Pixels | `Alt+T` |
| Delete Layer | `Ctrl+Alt+Shift+L` |
| Group Layers | `Ctrl+G` |
| Ungroup | `Ctrl+Shift+G` |
| Clipping Mask | `Ctrl+Alt+G` |
| Merge Down | `Ctrl+E` |
| Stamp Visible | `Ctrl+Alt+Shift+E` |

## Frame

| Command | Shortcut |
| - | - |
| New Empty Frame | `Ctrl+Shift+F` |
| New Frame | `Alt+N` |
| Delete Frame | `Ctrl+Alt+Shift+F` |
| Play/Pause | `Enter` |
| First Frame | `Home` |
| Last Frame | `End` |
| Next Frame in Tag | `.` |
| Previous Frame in Tag | `,` |

## Select

| Command | Shortcut |
| - | - |
| Select All | `Ctrl+A` |
| Deselect | `Ctrl+D` |
| Reselect | `Ctrl+Shift+D` |
| Inverse Selection | `Ctrl+Shift+I` |
| Move Selection Down | `↓` |
| Move Selection Down One Cell | `Shift+↓` |
| Move Selection Left | `←` |
| Move Selection Left One Cell | `Shift+←` |
| Move Selection Right | `→` |
| Move Selection Right One Cell | `Shift+→` |
| Move Selection Up | `↑` |
| Move Selection Up One Cell | `Shift+↑` |

## Filter

| Command | Shortcut |
| - | - |
| Invert Color... | `Ctrl+I` |

## View

| Command | Shortcut |
| - | - |
| Zoom In | `Ctrl+=` |
| Zoom Out | `Ctrl+-` |
| Actual Size | `Ctrl+0` |
| Fit to Window | `Ctrl+Shift+0` |
| Rotate View 15° Clockwise | `Ctrl+Alt+]` |
| Rotate View 15° Counterclockwise | `Ctrl+Alt+[` |
| Reset Rotation | `Ctrl+Alt+0` |
| Grid > Show Grid | `Ctrl+'` |
| Grid > Show Pixel Grid | `Ctrl+Shift+'` |
| Grid > Snap to Grid | `Shift+S` |
| Guides > Show Rulers | `Ctrl+R` |
| Guides > Show Guides | `Ctrl+;` |
| Guides > Snap to Guides | `Ctrl+Shift+;` |
| Guides > Lock Guides | `Ctrl+Alt+;` |

## Settings

| Command | Shortcut |
| - | - |
| Keyboard Shortcuts... | `?` |

## Colors

| Command | Shortcut |
| - | - |
| Swap Foreground/Background Color | `X` |

## Mouse and trackpad

What the mouse does on the canvas with the default
[Mouse and Trackpad settings](https://pxstud.io/docs/manual/guides/workspace.md#zoom-pan-and-rotate).

| Command | Shortcut |
| - | - |
| Pan the view (drag) | `Middle button` |
| Zoom (or pinch a trackpad) | `Wheel` |
| Scroll sideways | `Shift+Wheel` |
| Change the brush size | `Ctrl+Shift+Wheel` |
| The tool's right-click (most paint with the background color) | `Right button` |
| Open the tool wheel (hold) | `Back button` or `Forward button` |
