JDK-4103229 : some keys on the numpad do not work correctly when NumLock is off (Solaris)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.4,1.1.6,1.2.2
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_2.5.1,solaris_7
  • CPU: sparc
  • Submitted: 1998-01-10
  • Updated: 2000-09-06
  • Resolved: 2000-09-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 betaFixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description

Name: ccC48265			Date: 01/10/98


Some keys on the numpad do not behave correctly.
For example, the '*' and '+' keys do not work
properly whether NUM-LOCK is on or off.  Also,
the '/', '-' and '.' keys do not behave correctly
when the SHIFT key has been pressed.

The problems can be observed by running the
applet

http://java.sun.com/docs/books/tutorial/ui/components/keylistener.html
###@###.### (Jan 10, 1998):
Here are my findings: *, /, -, and . will only print when NUMLOCK=on;
when in addition to NUMLOCK=on the SHIFT-key is pressed, these character
will no longer print.  The +-key will print + only when SHIFT is pressed,
and will print = otherwise; this behavior is not affected by the state
of NUMLOCK.  Related bugs: 4083691 and 4087994.
(Review ID: 23064)
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin FIXED IN: merlin-beta INTEGRATED IN: merlin-beta
14-06-2004

EVALUATION Here are my observations based on an early build of 1.1.8 (after A but before B) and the JDK1.2fcs-K build: The . key is not supposed to show up when the NumLock is not on. When the NumLock is off, it is the DEL key. When it is on, it is the . key. The problem with the + and * keys working incorrectly was fixed by the putback for 4083691. The /, *, and - keys do not print unless the NumLock key is on. They also do not print when both the NumLock and Shift keys are on, or when the NumLock and CapsLock keys are on. On windows in 1.2, they print whether the NumLock key is on or off, and the Shift and CapsLock keys make no difference. Note: the numpad / and - are mapping to their keyChar values in the modify_event function in canvas.c, whereas the + and * keys are mapping to their keysyms after the putback for 4083691. ============================================================================ Most of the problems in this bug report have been addressed, probably by the putback for 4083691. The only remaining problem is that under other Motif applications (e.g. BugTraq), the behavior of the /*- keys differs from the bahavior seen in Java apps as follows: When the NumLock is on, and the Shift key is depressed, Motif apps will respond to /*- by entering those characters in a TextComponent. In Java, the characters will not be entered. Note that the + key will be entered in both cases. Note: In Motif applications and in Java applications, the /*- keys will not be entered unless the NumLock is depressed. This differs from Windows. eric.hawkes@eng 1999-03-29 Another note: in most applications on Solaris, the numpad /*- keys act differently depending on whether the NumLock is on or off. This is because they generate different keysyms depending on the state of the NumLock. The same is not true for the numpad + key. NumLock On NumLock Off key keycode keysym keysym --------------------------------------- / 53 65455=0xffaf 65494=0xffd6 * 54 65450=0xffaa 65495=0xffd7 - 78 65453=0xffad 65493=0xffd5 + 132 65451=0xffab 65451=0xffab From /usr/include/X11/keysymdef.h #define XK_KP_Multiply 0xFFAA #define XK_KP_Add 0xFFAB #define XK_KP_Separator 0xFFAC /* separator, often comma */ #define XK_KP_Subtract 0xFFAD #define XK_KP_Decimal 0xFFAE #define XK_KP_Divide 0xFFAF #define XK_F24 0xFFD5 #define XK_R4 0xFFD5 #define XK_F25 0xFFD6 #define XK_R5 0xFFD6 #define XK_F26 0xFFD7 #define XK_R6 0xFFD7 You can see that the /*- keys act differently by typing them into various motif applications, such as Netscape or Bugtraq. Interestingly, typing the keys at a dtterm prompt produces the same status whether or not the NumLock is down. Of course, I don't think a dtterm is a Motif application. We may be able to map both sets of keysyms to the /*- keycodes. I assume that this would be desirable, although I have to wonder if there are cases where it would not be. eric.hawkes@eng 2000-07-26 I figured out how to translate the X events so that the Java events are generated correctly. The problem seems to be that the native Motif widgets just ignore the /*- numpad keys when NumLock is off. So, the events are generated, but no characters are entered into the Motif widget. Of course, lightweight components (e.g. Swing) have the characters entered correctly, so maybe this is worth doing. eric.hawkes@eng 2000-08-20 Decided to change the X event by setting the awt_NumLockMask as the ONLY modifier in xevent->xkey.state before dispatching it to the Motif widget. This fools it into accepting the /*- key events when NumLock is off, and also when other modifiers are on. eric.hawkes@eng 2000-08-24
24-08-2000