Skip to main content

register_shortcut

Function register_shortcut 

Source
pub fn register_shortcut(
    app: &AppHandle,
    state: &ActiveShortcutState,
    new_label: &str,
) -> CommandResult<()>
Expand description

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).