Skip to content

Commit 72b4c1c

Browse files
authored
Update NetWebView2Lib.au3
1 parent 06ea432 commit 72b4c1c

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

NetWebView2Lib.au3

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,10 +1326,21 @@ Func __NetWebView2_Events__OnDownloadStateChanged($oWebV2M, $hGUI, $sState, $sUR
13261326
EndFunc ;==>__NetWebView2_Events__OnDownloadStateChanged
13271327

13281328
Func __NetWebView2_Events__OnAcceleratorKeyPressed($oWebV2M, $hGUI, $oArgs)
1329+
$hGUI = HWnd("0x" & Hex($hGUI, 16))
1330+
Local Const $sArgsList = '[Handled=' & $oArgs.Handled & '; KeyEventKind=' & $oArgs.KeyEventKind & '; KeyEventLParam=' & $oArgs.KeyEventLParam & '; VirtualKey=' & $oArgs.VirtualKey & ']'
1331+
Local Const $s_Prefix = "[NetWebView2Lib:EVENT: OnAcceleratorKeyPressed]: GUI:" & $hGUI & " ARGS: " & ((IsObj($oArgs)) ? ($sArgsList) : ('ERRROR'))
13291332
#forceref $oWebV2M
1333+
;~ https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2acceleratorkeypressedeventargs?view=webview2-dotnet-1.0.705.50
1334+
;~ ConsoleWrite($oArgs.Handled & @CRLF) ; Indicates whether the AcceleratorKeyPressed event is handled by host.
1335+
;~ ConsoleWrite($oArgs.KeyEventKind & @CRLF) ; Gets the key event kind that caused the event to run
1336+
;~ ConsoleWrite($oArgs.KeyEventLParam & @CRLF) ; Gets the LPARAM value that accompanied the window message.
1337+
;~ ConsoleWrite('>> PhysicalKeyStatus=' & $oArgs.PhysicalKeyStatus & @CRLF) ; Gets a CoreWebView2PhysicalKeyStatus representing the information passed in the LPARAM of the window message. ==> ; https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2physicalkeystatus?view=webview2-dotnet-1.0.705.50
1338+
;~ ConsoleWrite($oArgs.VirtualKey & @CRLF) ; Gets the Win32 virtual key code of the key that was pressed or released.
1339+
1340+
If $oArgs.VirtualKey = 27 Then ; ESC 27 1b 033 Escape, next character is not echoed ; https://www.autoitscript.com/autoit3/docs/appendix/ascii.htm
1341+
;~ $oWebV2M.CancelDownloads($_sURLDownload_InProgress)
1342+
EndIf
13301343

1331-
$hGUI = HWnd("0x" & Hex($hGUI, 16))
1332-
Local Const $s_Prefix = "[NetWebView2Lib:EVENT: OnAcceleratorKeyPressed]: GUI:" & $hGUI & " ARGS: " & ((IsObj($oArgs)) ? ('OBJECT') : ('ERRROR'))
13331344
__NetWebView2_Log(@ScriptLineNumber, (StringLen($s_Prefix) > 150 ? StringLeft($s_Prefix, 150) & "..." : $s_Prefix), 1)
13341345
EndFunc ;==>__NetWebView2_Events__OnAcceleratorKeyPressed
13351346
#EndRegion ; NetWebView2Lib UDF - === EVENT HANDLERS ===

0 commit comments

Comments
 (0)