> ## Documentation Index
> Fetch the complete documentation index at: https://developer.kodexa.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Keyboard shortcuts for task actions

> Bind keyboard shortcuts to task-template action buttons and to the default Save/Cancel buttons so reviewers can drive a task without leaving the keyboard.

A reviewer working a queue of tasks all day should not have to reach for the mouse to approve, reject, or save. Task templates let you bind a keyboard shortcut to any action button, and to the default **Save** and **Cancel** buttons, so the whole action toolbar is keyboard-drivable.

Shortcuts are **purely declarative**: there are no built-in default keys. A button is only bound to a key if you set one in the template — nothing happens by accident. Shortcuts register when the task opens and are cleared when it closes, so they never leak between tasks.

## Action-level shortcuts

Each entry under `metadata.actions[].properties` accepts two shortcut keys:

| Property         | Type                | Effect                                               |
| ---------------- | ------------------- | ---------------------------------------------------- |
| `shortcut`       | string              | Primary key combination that fires the action.       |
| `shortcutAltKey` | string \| string\[] | Optional alternate combination(s) that also fire it. |

```yaml theme={null}
metadata:
  actions:
    - uuid: approve-action
      type: approve
      label: "Approve"
      properties:
        targetStatus: approved
        statusSlug: approved
        icon: check
        color: green
        shortcut: "a"
        shortcutAltKey: "control+enter"

    - uuid: reject-action
      type: reject
      label: "Reject"
      properties:
        targetStatus: rejected
        statusSlug: rejected
        icon: close
        color: red
        shortcut: "r"
```

The shortcut respects whatever gates the button already has — if the action is disabled (for example by `onlyEnabledIfNoOpenExceptions`, a pending event subscription, or a locked task) the key does nothing, exactly like a click on the greyed-out button.

## Default Save / Cancel shortcuts

The **Save** and **Cancel** buttons are not actions, so they take their shortcuts from the template's own properties (`metadata.properties`):

| Property               | Binds                                          |
| ---------------------- | ---------------------------------------------- |
| `saveShortcut`         | Primary key for the default **Save** button.   |
| `saveShortcutAltKey`   | Alternate key(s) for **Save**.                 |
| `cancelShortcut`       | Primary key for the default **Cancel** button. |
| `cancelShortcutAltKey` | Alternate key(s) for **Cancel**.               |

```yaml theme={null}
metadata:
  properties:
    saveShortcut: "meta+s"
    saveShortcutAltKey: "control+s"
    cancelShortcut: "escape"
```

These only register when the corresponding default button is shown — setting `hideDefaultSaveButton: true` (or `hideDefaultCancelButton: true`) suppresses the button *and* its shortcut. The **Save** shortcut also honours the button's dirty/locked state: it does nothing when there is nothing to save or the task is locked.

## Key syntax

Keys use the same format across task actions and data forms. Combine a key with modifiers using `+`:

* Modifiers: `control`, `meta` (⌘), `alt`, `shift`. The aliases `ctrl`, `cmd`, `command`, and `option` are normalized for you.
* Examples: `"a"`, `"control+enter"`, `"meta+s"`, `"meta+shift+s"`, `"escape"`.

<Tip>
  Bind the primary key to the Mac-native modifier (`meta+s`) and use the alt key for the Windows/Linux equivalent (`control+s`) — the platform also cross-maps `control+…` on Mac, but declaring both keeps intent explicit.
</Tip>

## The keyboard-shortcuts help dialog

Every bound shortcut carries the button's label as its description and shows up in the global keyboard-shortcuts help dialog, opened with **⌘ + /** (or **Ctrl + /**). Task-action shortcuts appear there under **Actions**, listed alongside the shortcuts declared by the data form the reviewer is working in, so a reviewer can always discover what keys are live for the task in front of them.

<Note>
  Shortcuts are scoped per task: they register when the task opens and are cleared automatically when it closes or the toolbar unmounts. Opening a different task re-registers only that task's shortcuts, so keys never bleed across tasks.
</Note>

## Related reading

* [Task template patterns](/guides/task-templates/index) — the rest of the action toolbar
* [Gating actions on exceptions](/guides/task-templates/gating-actions-on-exceptions) — disable an action (and its shortcut) until the data is clean
