Lingua

CoreWebView2AcceleratorKeyPressedEventArgs.IsBrowserAcceleratorKeyEnabled Property

Definition

This IsBrowserAcceleratorKeyEnabled property allows developers to control whether the browser handles accelerator keys such as Ctrl+P or F3, etc.

public bool IsBrowserAcceleratorKeyEnabled { get; set; }
member this.IsBrowserAcceleratorKeyEnabled : bool with get, set
Public Property IsBrowserAcceleratorKeyEnabled As Boolean

Property Value

Remarks

The AreBrowserAcceleratorKeysEnabled API is a convenient setting for developers to disable all the browser accelerator keys together. This setting also sets the default value for the IsBrowserAcceleratorKeyEnabled property.

By default, AreBrowserAcceleratorKeysEnabled is true and IsBrowserAcceleratorKeyEnabled is true. When developers change AreBrowserAcceleratorKeysEnabled setting to false, this will change default value for IsBrowserAcceleratorKeyEnabled to false. If developers want specific keys to be handled by the browser after changing the AreBrowserAcceleratorKeysEnabled setting to false, they need to enable these keys by setting IsBrowserAcceleratorKeyEnabled to true.

The AcceleratorKeyPressed event is raised any time an accelerator key is pressed, regardless of whether accelerator keys are enabled or not.

This API will give the event arg higher priority over the AreBrowserAcceleratorKeysEnabled setting when we handle the keys.

With IsBrowserAcceleratorKeyEnabled property, if developers mark IsBrowserAcceleratorKeyEnabled as false, the browser will skip the WebView2 browser feature accelerator key handling process, but the event propagation continues, and web content will receive the key combination.

This property does not disable accelerator keys related to movement and text editing, such as:

  • Home, End, Page Up, and Page Down
  • Ctrl-X, Ctrl-C, Ctrl-V
  • Ctrl-A for Select All
  • Ctrl-Z for Undo

Applies to