Skip to content

Commit

Permalink
formatting UnhandledKeyPressed.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuhaichao518 authored Oct 25, 2023
1 parent edc9e4b commit cf1683b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions specs/UnhandledKeyPressed.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ them to receive and handle key events not handled by the browser,
same ability in WebView2.

# Description
The `UnhandledKeyPressed` event allows developers to subscribe event handlers to be run when a key event is not handled by the browser (including DOM and browser accelerators).
The `UnhandledKeyPressed` event allows developers to subscribe event handlers to be run when
a key event is not handled by the browser (including DOM and browser accelerators).

`UnhandledKeyPressed` event can be triggered by all keys, which is different from [AcceleratorKeyPressed](https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2acceleratorkeypressedeventargs?view=webview2-dotnet-1.0.705.50) event.

`UnhandledKeyPressed` event is async, which means [GetKeyState](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getkeystate) does not return the exact key state when the key event is fired. Use `UnhandledKeyPressedEventArgs.Modifiers` instead to verify whether Ctrl or Alt is down in this situation.
`UnhandledKeyPressed` event is async, which means [GetKeyState](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getkeystate)
does not return the exact key state when the key event is fired.
Use `UnhandledKeyPressedEventArgs.Modifiers` instead to verify whether Ctrl or Alt is down in this situation.

# Examples
## C++
Expand Down

0 comments on commit cf1683b

Please sign in to comment.