AboutSupportDeveloper GuideVersion 44.144.100.63
interface ShortcutOverride {
    command: string;
    keys: string;
    phase?: "capture" | "bubble";
    preventDefault?: boolean;
}

Properties

command: string
keys: string

The key combination of the hotkey, i.e. "Ctrl+T".

phase?: "capture" | "bubble"

Controls the event phase at which the hotkey is triggered.

  • 'capture': The hotkey fires before the event is sent to the renderer/page. This is the only phase where the preventDefault property is effective.

  • 'bubble': The hotkey fires after the page has processed the key event. This behaves exactly like a standard JavaScript event listener attached to the window:

  1. If the page calls event.preventDefault() (on either keydown or keyup), this hotkey will not fire.
  2. If the hotkey is browser-reserved (e.g. Ctrl+Tab to switch tabs for which keyup/keydown do not fire in a web browser), that action takes precedence and this hotkey will not fire.
'capture'
preventDefault?: boolean

Determines if the event should continue to the renderer.

  • true: The event is consumed immediately. It will never reach the renderer/page.
  • false: The event is sent to the renderer after this hotkey executes.

This property is only valid when phase is set to 'capture'. If phase is 'bubble', this property is ignored (as the renderer has already received and processed the event).

false