On Fri, 11 Jul 2025 03:31:35 GMT, Alexander Zvegintsev <azveg...@openjdk.org> wrote:
>> When we try to pass `XK_KP_0` to >> [`NotifyKeyboardKeysym`](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html#org-freedesktop-portal-remotedesktop-notifykeyboardkeysym) >> in Remote Desktop API, it presses/releases `SHIFT` + `XK_KP_Insert`. >> >> To get the same result as XTest api when using `NotifyKeyboardKeysym` we >> should use `XK_KP_Insert` instead of `XK_KP_0` regardless of NumLock state. >> Similarly for other Numpad keys. > > Alexander Zvegintsev has updated the pull request incrementally with one > additional commit since the last revision: > > make sure to test both numpad states test/jdk/java/awt/event/KeyEvent/KeyCharTest/KeyCharTest.java line 87: > 85: robot.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK); > 86: > 87: testKeyRange(robot, 0x20, 0x7E); @azvegint Suppose an exception occurs when testing the first case - 0x20 to 0x7E then the finally block with NumLock is executed irrespective of whether the NumLock was set for the next test case. To avoid this we can add a separate try catch block for the 2 test ranges or another way is to check if NumLock is On/Off before setting and resetting it using `boolean isNumLockOn = toolkit.getLockingKeyState(KeyEvent.VK_NUM_LOCK);` (the 2nd option might be better). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26170#discussion_r2201432643