8163265: [macosx] numpad 0 instead of VK_0
authormhalder
Thu, 19 Oct 2017 13:52:37 +0530
changeset 47392 ec9f4dda4018
parent 47391 a29594840024
child 47393 82b49fe76dec
8163265: [macosx] numpad 0 instead of VK_0 Reviewed-by: serb, azvegint Contributed-by: manajit.halder@oracle.com
src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m
test/jdk/java/awt/keyboard/AllKeyCode/AllKeyCode.java
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m	Wed Oct 18 22:06:24 2017 -0700
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m	Thu Oct 19 13:52:37 2017 +0530
@@ -482,7 +482,8 @@
         offset = ch - '0';
         // make sure in range for decimal digits
         if (offset >= 0 && offset <= 9)    {
-            jboolean numpad = (flags & NSNumericPadKeyMask) != 0;
+            jboolean numpad = ((flags & NSNumericPadKeyMask) &&
+                               (key > 81 && key < 93));
             *postsTyped = YES;
             if (numpad) {
                 *keyCode = offset + java_awt_event_KeyEvent_VK_NUMPAD0;
--- a/test/jdk/java/awt/keyboard/AllKeyCode/AllKeyCode.java	Wed Oct 18 22:06:24 2017 -0700
+++ b/test/jdk/java/awt/keyboard/AllKeyCode/AllKeyCode.java	Thu Oct 19 13:52:37 2017 +0530
@@ -24,7 +24,7 @@
 /**
  * @test
  * @key headful
- * @bug 8149456 8147834 8150230 8155740
+ * @bug 8149456 8147834 8150230 8155740 8163265
  * @requires os.family == "mac"
  * @summary Tests key codes for all keys supported in Java for Mac OS X.
  * @run main AllKeyCode