8163265: [macosx] numpad 0 instead of VK_0
Reviewed-by: serb, azvegint
Contributed-by: manajit.halder@oracle.com
--- 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