Pressing and releasing the numpad-5 key produces X-events when the numlock
is off, but does not produce keypressed/keyreleased Java events. We ought to
give some indication that a key has been pressed/released. However, we should
not produce a keytyped event unless a unicode character is generated.
Here is the result of running xev on a sparc (Solaris 9 update 2)
KeyPress event, serial 23, synthetic NO, window 0x1680001,
root 0x31, subw 0x0, time 2576694049, (163,460), root:(475,532),
state 0x0, keycode 99 (keysym 0xffdc, F31), same_screen YES,
XLookupString gives 0 characters: ""
KeyRelease event, serial 23, synthetic NO, window 0x1680001,
root 0x31, subw 0x0, time 2576694147, (163,460), root:(475,532),
state 0x0, keycode 99 (keysym 0xffdc, F31), same_screen YES,
XLookupString gives 0 characters: ""
A synonym for XK_F31 is XK_R11 which doesn't help much.
keysymdef.h says:
#define XK_F31 0xFFDC
#define XK_R11 0xFFDC
Here is a section of my xmodmap:
keycode 74 = Multi_key
keycode 75 = F27 F27 KP_7 Home
keycode 76 = Up F28 KP_8
keycode 77 = F29 F29 KP_9 Prior
keycode 78 = F24 F24 KP_Subtract
keycode 79 = F17 F17 SunOpen
keycode 80 = F18 F18 SunPaste
keycode 81 = End
keycode 82 =
...
keycode 96 = Return
keycode 97 = KP_Enter
keycode 98 = Left F30 KP_4
keycode 99 = F31 F31 KP_5
keycode 100 = Right F32 KP_6
keycode 101 = KP_Insert KP_Insert KP_0
keycode 102 = F19 F19 Find
keycode 103 = Prior
Interestingly, my Linux xmodmap says:
keycode 83 = KP_Left KP_4
keycode 84 = KP_Begin KP_5
keycode 85 = KP_Right KP_6
keysymdef.h
#define XK_KP_Page_Down 0xFF9B
#define XK_KP_End 0xFF9C
#define XK_KP_Begin 0xFF9D
#define XK_KP_Insert 0xFF9E
#define XK_KP_Delete 0xFF9F
#define XK_Prior 0xFF55 /* Prior, previous */
#define XK_Page_Up 0xFF55
#define XK_Next 0xFF56 /* Next */
#define XK_Page_Down 0xFF56
#define XK_End 0xFF57 /* EOL */
#define XK_Begin 0xFF58 /* BOL */
Note that on Solaris, the numpad /*- keys produce F24, F25, F26, but in
Java we map them to /*- anyway. dtterm acts similar to Java. dtterm also
produces a 5 when the numpad 5 key is pressed, but numlock is off (F31).
However, some applications, e.g. bugtraq, do not produce /*-5 when numlock
is off. StarOffice accepts - but not /* .