java keyListener fails to detect miscellaneous compatibility settings for numPad
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
java-common (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
There is a miscellaneous keyboard layout setting in Ubuntu that does not work as intended for Java. This was the same for me using the default JDK and also Oracle JDK. This could be a problem at the setting level, but I am unclear where else to file this bug, since it pertains to the JDK.
Here is the miscellaneous setting:
Ubuntu Settings
Keyboard Layout
Options
Misc. Compatibility Options
Numeric keypad keys always enter digits (as in Mac OS) -> SET TO TRUE
This setting helps for those people using both a laptop keyboard with a "hidden" numpad, like on my old MacBook, and they also wish to have an external keyboard, which works for typing numbers with the number pad. Without this setting, I cannot achieve both of these features simultaneously, and it would otherwise cause me to write a script to detect whether an external keyboard is plugged in. So, this setting makes sense and works in most applications in Ubuntu. But not in Java-based applications, from what I can tell.
The attached Java file reproduces the key recognition, where this miscellaneous setting enabled still detects the special keys (home, page up, page down, etc.) as keyPressed and keyReleased events, as if the numLock is disabled. However, with the setting enabled, Java's keyTyped will detect the proper number. So, it is detecting both keys at the same time.
As a summary, there is a problem in key recognition in Java when both the miscellaneous setting in Ubuntu is enabled AND the numLock is OFF. This is a problem, for example, if you have a program written in Java that is a text editor (e.g. Netbeans). Typing the numPad 7 key will result in moving the cursor to the "Home" location AND type the number 7 in the editor. The desired effect, with this setting, would have only the number 7 being typed.
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: default-jdk 1:1.7-43ubuntu3
ProcVersionSign
Uname: Linux 3.5.0-22-generic i686
NonfreeKernelMo
ApportVersion: 2.6.1-0ubuntu9
Architecture: i386
Date: Mon Jan 21 12:48:33 2013
InstallationDate: Installed on 2012-08-25 (149 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release i386 (20120423)
MarkForUpload: True
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: java-common
UpgradeStatus: Upgraded to quantal on 2012-11-19 (62 days ago)
Status changed to 'Confirmed' because the bug affects multiple users.