Public bug reported:

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
ProcVersionSignature: Ubuntu 3.5.0-22.34-generic 3.5.7.2
Uname: Linux 3.5.0-22-generic i686
NonfreeKernelModules: wl
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_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: java-common
UpgradeStatus: Upgraded to quantal on 2012-11-19 (62 days ago)

** Affects: java-common (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 quantal running-unity third-party-packages

** Attachment added: "Java file to output what keys it is detecting."
   https://bugs.launchpad.net/bugs/1102616/+attachment/3493090/+files/Test.java

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1102616

Title:
  java keyListener fails to detect miscellaneous compatibility settings
  for numPad

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/java-common/+bug/1102616/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to