Skip to content

Keyboard Shortcuts

Status: ✅ Implemented — @Action(shortcut = ...), @Trigger(type = OnEnter)

Let expert users complete frequent tasks without touching the mouse.

Users who spend hours in a backoffice application are slowed down every time they must reach for the mouse to trigger a common action. A keyboard-hostile interface is the Desktop Denial anti-pattern: it penalises the users who know the system best.

Action shortcuts — @Action(shortcut = ...)

Section titled “Action shortcuts — @Action(shortcut = ...)”

Attach a keyboard shortcut to any action. The shortcut is active whenever the view that owns the action is focused.

@Action(shortcut = "ctrl+s")
public void save() {
orderService.save(this);
}
@Action(shortcut = "ctrl+enter")
public void submit() {
workflowService.submit(this);
}
@Action(shortcut = "escape")
public void cancel() { }

Shortcut strings follow standard modifier notation: ctrl, shift, alt, meta (⌘ on Mac), combined with a key name (s, enter, escape, f2, etc.).

Enter key on forms — @Trigger(type = OnEnter)

Section titled “Enter key on forms — @Trigger(type = OnEnter)”

Use @Trigger(type = TriggerType.OnEnter) to fire an action when the user presses Enter anywhere in a form, without attaching the shortcut to a specific action button.

@Trigger(type = TriggerType.OnEnter, calledActionId = "search")
public class ProductSearch {
private String name;
public List<Product> search() {
return productRepo.search(name);
}
}

Consistent conventions across the application reinforce the Consistency principle.

ActionSuggested shortcut
Save / SubmitCtrl+S
Confirm / SendCtrl+Enter
Cancel / CloseEscape
New recordCtrl+N
DeleteCtrl+Delete
Search / FilterEnter (via @Trigger)
  • Keyboard-first — frequent tasks require no mouse gesture
  • Consistency — the same shortcut does the same thing everywhere in the app
  • Workflow over screens — shortcuts let users stay in flow without stopping to navigate