Title: [282124] trunk/Tools
Revision
282124
Author
[email protected]
Date
2021-09-07 19:12:00 -0700 (Tue, 07 Sep 2021)

Log Message

[Win] PlatformWebView::simulateSpacebarKeyPress sends wrong scan code for the space key and Alt key
https://bugs.webkit.org/show_bug.cgi?id=229928

Reviewed by Don Olmstead.

PlatformWebView::simulateSpacebarKeyPress sent 39, but it should be 0x39.
PlatformWebView::simulateAltKeyPress sent 38, but it should be 0x38.

* TestWebKitAPI/win/PlatformWebViewWin.cpp:
(TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
(TestWebKitAPI::PlatformWebView::simulateAltKeyPress):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (282123 => 282124)


--- trunk/Tools/ChangeLog	2021-09-08 02:02:33 UTC (rev 282123)
+++ trunk/Tools/ChangeLog	2021-09-08 02:12:00 UTC (rev 282124)
@@ -1,3 +1,17 @@
+2021-09-07  Fujii Hironori  <[email protected]>
+
+        [Win] PlatformWebView::simulateSpacebarKeyPress sends wrong scan code for the space key and Alt key
+        https://bugs.webkit.org/show_bug.cgi?id=229928
+
+        Reviewed by Don Olmstead.
+
+        PlatformWebView::simulateSpacebarKeyPress sent 39, but it should be 0x39.
+        PlatformWebView::simulateAltKeyPress sent 38, but it should be 0x38.
+
+        * TestWebKitAPI/win/PlatformWebViewWin.cpp:
+        (TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
+        (TestWebKitAPI::PlatformWebView::simulateAltKeyPress):
+
 2021-09-07  Jonathan Bedard  <[email protected]>
 
         [git-webkit] Support callbacks as main arguments (Follow-up fix)

Modified: trunk/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp (282123 => 282124)


--- trunk/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp	2021-09-08 02:02:33 UTC (rev 282123)
+++ trunk/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp	2021-09-08 02:12:00 UTC (rev 282124)
@@ -111,9 +111,9 @@
     HWND window = WKViewGetWindow(m_view);
 
     // These values match what happens when you press the spacebar in Notepad, as observed by Spy++.
-    ::SendMessageW(window, WM_KEYDOWN, VK_SPACE, (1 << repeatCountBitOffset) | (39 << scanCodeBitOffset));
-    ::SendMessageW(window, WM_CHAR, ' ', (1 << repeatCountBitOffset) | (39 << scanCodeBitOffset));
-    ::SendMessageW(window, WM_KEYUP, VK_SPACE, (1 << repeatCountBitOffset) | (39 << scanCodeBitOffset) | (1 << previousStateBitOffset) | (1 << transitionStateBitOffset));
+    ::SendMessageW(window, WM_KEYDOWN, VK_SPACE, (1 << repeatCountBitOffset) | (0x39 << scanCodeBitOffset));
+    ::SendMessageW(window, WM_CHAR, ' ', (1 << repeatCountBitOffset) | (0x39 << scanCodeBitOffset));
+    ::SendMessageW(window, WM_KEYUP, VK_SPACE, (1 << repeatCountBitOffset) | (0x39 << scanCodeBitOffset) | (1 << previousStateBitOffset) | (1 << transitionStateBitOffset));
 }
 
 void PlatformWebView::simulateAltKeyPress()
@@ -121,8 +121,8 @@
     HWND window = WKViewGetWindow(m_view);
 
     // These values match what happens when you press the Alt key in Notepad, as observed by Spy++.
-    ::SendMessageW(window, WM_SYSKEYDOWN, VK_MENU, (1 << repeatCountBitOffset) | (38 << scanCodeBitOffset) | (1 << contextCodeBitOffset));
-    ::SendMessageW(window, WM_SYSKEYUP, VK_MENU, (1 << repeatCountBitOffset) | (38 << scanCodeBitOffset) | (1 << previousStateBitOffset) | (1 << transitionStateBitOffset));
+    ::SendMessageW(window, WM_SYSKEYDOWN, VK_MENU, (1 << repeatCountBitOffset) | (0x38 << scanCodeBitOffset) | (1 << contextCodeBitOffset));
+    ::SendMessageW(window, WM_SYSKEYUP, VK_MENU, (1 << repeatCountBitOffset) | (0x38 << scanCodeBitOffset) | (1 << previousStateBitOffset) | (1 << transitionStateBitOffset));
 }
 
 void PlatformWebView::simulateRightClick(unsigned x, unsigned y)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to