Skip to main content
SVAR Gantt handles keyboard input through the hotkey action. When the Gantt (or chart area) has focus and the user presses a supported key combination, the action is dispatched through the event bus and the appropriate operation is performed.

Supported shortcuts

Hotkeys are ignored when the cursor is inside an <input> or <textarea> element so they do not interfere with text editing.

How hotkeys work

The hotkey system listens for keydown events on the document. When a qualifying key combination is detected, it dispatches the hotkey action through api.exec:
The store intercepts this action and maps each key to the corresponding Gantt operation.

Arrow navigation

Arrow Up and Arrow Down move the selection through the flat task list. When triggered from the chart area (eventSource === "chart"), the Gantt also scrolls both axes (xy) to keep the selected task visible. When triggered from the grid, only vertical scrolling is applied.

Intercepting and customising hotkeys

You can intercept the hotkey action to add custom behaviour or override defaults:
To block a built-in shortcut, intercept the action and return false:

Fullscreen shortcut

The Fullscreen component from @svar-ui/svelte-core adds a fullscreen toggle button to the Gantt. It also accepts a hotkey prop that registers a keyboard shortcut to toggle fullscreen mode:
The hotkey string follows the same format used throughout the system: modifier keys joined with + in lowercase (ctrl, alt, shift, meta), followed by the key name (e.g. ctrl+shift+f, alt+enter).

Fullscreen component props

Key format reference

Key strings are normalised to lowercase with modifiers listed first: Modifier order in the string is: ctrl → alt → meta → shift → key.