Bug 85997 - [patch] java/jdk15 1.5.0p1_3 causes keyboard problems with NumLock enabled
Summary: [patch] java/jdk15 1.5.0p1_3 causes keyboard problems with NumLock enabled
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-java (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-12 01:10 UTC by Nick Fishman
Modified: 2006-05-12 15:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Fishman 2005-09-12 01:10:08 UTC
I just recently noticed this problem. When I'm working in a java-based program, say JEdit, if the Numlock on my keyboard is on, I cannot press backspace, I cannot use the arrow keys, and no key on the right-most portion of the keyboard works (that includes any of the number keys arranged in a 3x3 pattern, the +, enter, delete, *, /, and any other keys I'm leaving out). I don't remember this being an issue with JDK 1.4.

To work around this issue, I have to disable numlock entirely and use the number keys on the top of the keyboard. Besides the fact that this is an inconvenience, it affects any and every program running under the Java virtual machine, so it seems to be a problem in Java itself. To reiterate, if the numlock is turned on, no control characters whatsoever work (tab, backspace, not even the enter key on both sides).

Fix: 

Unknown.
How-To-Repeat:       Use any program with the Java Virtual Machine (i.e. JEdit, BlueJ, DrJava, JBidWatcher; any program that handles input from the user). Make sure NumLock is turned on, then attempt to press enter, use the arrow keys, backspace, +, -, etc.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2005-09-12 05:47:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->phantom

Over to maintainer.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2006-03-31 09:56:18 UTC
State Changed
From-To: open->feedback

Submitter: does this problem still recur? 


Comment 3 Mark Linimon freebsd_committer freebsd_triage 2006-03-31 09:56:18 UTC
Responsible Changed
From-To: phantom->freebsd-java

Reassign from phantom since he has been inactive for more than one year. 

Hat:	gnats-admin
Comment 4 Jonathan Chen 2006-04-03 19:53:17 UTC
The problem still occurs for me under jdk-1.5.0p2_6.
--
Jonathan Chen <jonc@chen.org.nz>
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2006-04-03 22:48:17 UTC
State Changed
From-To: feedback->open

Submitter notes that this is still a problem.
Comment 6 Kurt Miller 2006-04-19 23:35:17 UTC
This patch fixes the numlock problems described in this PR
for both toolkits:

Index: j2se/src/solaris/native/sun/awt/canvas.c
===================================================================
RCS file: /home/Java/CVS/JDK2/javasrc_1_5_scsl/j2se/src/solaris/native/sun/awt/canvas.c,v
retrieving revision 1.2
diff -u -r1.2 canvas.c
--- j2se/src/solaris/native/sun/awt/canvas.c	10 Jan 2005 15:09:40 -0000	1.2
+++ j2se/src/solaris/native/sun/awt/canvas.c	19 Apr 2006 22:21:51 -0000
@@ -258,10 +258,10 @@
     {java_awt_event_KeyEvent_VK_DOWN, XK_Down, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
 
     /* Keypad equivalents of Triangular Navigation Block */
-    {java_awt_event_KeyEvent_VK_KP_LEFT, XK_KP_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
-    {java_awt_event_KeyEvent_VK_KP_UP, XK_KP_Up, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
-    {java_awt_event_KeyEvent_VK_KP_RIGHT, XK_KP_Right, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
-    {java_awt_event_KeyEvent_VK_KP_DOWN, XK_KP_Down, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
+    {java_awt_event_KeyEvent_VK_LEFT, XK_KP_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
+    {java_awt_event_KeyEvent_VK_UP, XK_KP_Up, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
+    {java_awt_event_KeyEvent_VK_RIGHT, XK_KP_Right, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
+    {java_awt_event_KeyEvent_VK_DOWN, XK_KP_Down, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
 
     /* Other vendor-specific Triangular Navigation Block */
     {java_awt_event_KeyEvent_VK_LEFT, osfXK_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
@@ -1349,7 +1349,7 @@
 {
     KeySym originalKeysym = *keysym;
 
-#if !defined(__linux__) 	// XXXBSD: applies to FreeBSD?
+#if !defined(__linux__) && !defined(_ALLBSD_SOURCE)
     /* The following code on Linux will cause the keypad keys
      * not to echo on JTextField when the NumLock is on. The
      * keysyms will be 0, because the last parameter 2 is not defined.
Index: j2se/src/solaris/native/sun/xawt/XWindow.c
===================================================================
RCS file: /home/Java/CVS/JDK2/javasrc_1_5_scsl/j2se/src/solaris/native/sun/xawt/XWindow.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 XWindow.c
--- j2se/src/solaris/native/sun/xawt/XWindow.c	8 Nov 2004 22:27:40 -0000	1.1.1.1
+++ j2se/src/solaris/native/sun/xawt/XWindow.c	19 Apr 2006 22:21:51 -0000
@@ -204,10 +204,10 @@
     {java_awt_event_KeyEvent_VK_DOWN, XK_Down, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
 
     /* Keypad equivalents of Triangular Navigation Block */
-    {java_awt_event_KeyEvent_VK_KP_LEFT, XK_KP_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
-    {java_awt_event_KeyEvent_VK_KP_UP, XK_KP_Up, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
-    {java_awt_event_KeyEvent_VK_KP_RIGHT, XK_KP_Right, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
-    {java_awt_event_KeyEvent_VK_KP_DOWN, XK_KP_Down, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
+    {java_awt_event_KeyEvent_VK_LEFT, XK_KP_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
+    {java_awt_event_KeyEvent_VK_UP, XK_KP_Up, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
+    {java_awt_event_KeyEvent_VK_RIGHT, XK_KP_Right, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
+    {java_awt_event_KeyEvent_VK_DOWN, XK_KP_Down, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD},
 
     /* Other vendor-specific Triangular Navigation Block */
     {java_awt_event_KeyEvent_VK_LEFT, osfXK_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
@@ -742,7 +742,7 @@
 {
     KeySym originalKeysym = *keysym;
 
-#ifndef __linux__
+#if !defined(__linux__) && !defined(_ALLBSD_SOURCE)
     /* The following code on Linux will cause the keypad keys
      * not to echo on JTextField when the NumLock is on. The
      * keysyms will be 0, because the last parameter 2 is not defined.
Comment 7 Greg Lewis freebsd_committer freebsd_triage 2006-04-25 21:10:51 UTC
State Changed
From-To: open->closed

Committed Kurt's fix. Thanks!
Comment 8 lapo.luchini 2006-05-03 10:54:02 UTC
Is this really "closed"?

I hadn't time to recompile the JDK yet (sorry for the noise, if this
patch does indeed fix it all) and moreover I'm using diablo right now
(the bug is the very same...) but reading the patch it seems to change
only numpad-arrows stuff..?

As the original reporter said "I cannot press backspace, I cannot use
the arrow keys" and no insert/home/delete/end/pageup/pagedown.
Comment 9 Thierry Thomas freebsd_committer freebsd_triage 2006-05-11 20:18:47 UTC
On Wed, 03 May 2006 11:54:02 +0200,  Lapo Luchini <lapo.luchini@gmail.com>
 wrote:
>  Is this really "closed"?
>  
>  I hadn't time to recompile the JDK yet (sorry for the noise, if this
>  patch does indeed fix it all) and moreover I'm using diablo right now
>  (the bug is the very same...) but reading the patch it seems to change
>  only numpad-arrows stuff..?
>  
>  As the original reporter said "I cannot press backspace, I cannot use
>  the arrow keys" and no insert/home/delete/end/pageup/pagedown.

The problem is still reported to me by Mercury's users (port
net-im/mercury), and I can confirm it myself: the "enter" key does not
work, and neither backspace (^H works).

Could you please re-open this PR?

Truly yours,
-- 
Th. Thomas.
Comment 10 Kurt Miller 2006-05-12 15:40:13 UTC
I just reconfirmed the problem is fixed with
both jedit and mercury. Please ensure you running
with the latest java/jdk15 that includes the
corrections.

Regards,
-Kurt