onAcceleratorKeyPressed method
- @SupportedPlatforms.new(platforms: [WindowsPlatform(apiName: 'ICoreWebView2Controller.add_AcceleratorKeyPressed', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2controller?view=webview2-1.0.2849.39#add_acceleratorkeypressed')])
- AcceleratorKeyPressedDetail detail
This event runs when an accelerator key or key combo is pressed or
released while the WebView is focused.
To listen this event, InAppWebViewSettings.handleAcceleratorKeyPressed must be true.
A key is considered an accelerator if either of the following conditions are true:
CtrlorAltis currently being held.- The pressed key does not map to a character.
A few specific keys are never considered accelerators, such as Shift.
The Escape key is always considered an accelerator.
Auto-repeated key events caused by holding the key down also triggers this event. Filter out the auto-repeated key events by verifying the AcceleratorKeyPressedDetail.physicalKeyStatus property.
Officially Supported Platforms/Implementations:
- Windows WebView2 (Official API - ICoreWebView2Controller.add_AcceleratorKeyPressed)
Parameters - Officially Supported Platforms/Implementations:
detail: all platforms
Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
WindowsPlatform(
apiName: 'ICoreWebView2Controller.add_AcceleratorKeyPressed',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2controller?view=webview2-1.0.2849.39#add_acceleratorkeypressed',
),
],
)
void onAcceleratorKeyPressed(AcceleratorKeyPressedDetail detail) {}