Skip to main content

Module shortcut

Module shortcut 

Source
Expand description

Global shortcut parsing, registration, rebind, and active-shortcut tracking.

This module owns generic "Modifier+Modifier+Key" label parsing and the register/unregister mechanics of [tauri_plugin_global_shortcut]. It has no opinion on which shortcuts a product allows or defaults to — that policy (e.g. restricting users to a fixed allow-list of labels) belongs to the app.

Structs§

ActiveShortcutState
Tracks the shortcut label currently registered, so callers can unregister only that specific shortcut (rather than every shortcut in the process) when the user rebinds their hotkey.

Functions§

parse_shortcut
Parse a shortcut label of the form "Modifier+Modifier+Key" (e.g. "Ctrl+Shift+Space", "Alt+F1", "Cmd+K") into a [Shortcut].
register_shortcut
Register new_label’s shortcut, first unregistering whatever shortcut is currently tracked in state if it differs. No-ops if new_label is already the active shortcut (re-registering an already-registered hotkey errors upstream).