United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4960727 xkb (X Keyboard Extension) support should be fixed in XAWT.
JDK-4960727 : xkb (X Keyboard Extension) support should be fixed in XAWT.

Details
Type:
Bug
Submit Date:
2003-11-27
Status:
Resolved
Updated Date:
2005-06-17
Project Name:
JDK
Resolved Date:
2005-06-07
Component:
client-libs
OS:
linux_redhat_9.0,linux
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Duplicate:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
Name: ynR10250			Date: 11/27/2003

On the system with Gnome & xkb, use any layout with non-latin
       additional group of symbols (for instance, Russian). There's
       an example of InputDevice section in XFree86 config file:
            Section "InputDevice"   
               Identifier  "Keyboard0"
               Driver      "keyboard"
               Option      "XkbRules" "xfree86"
               Option      "XkbModel" "pc105"
               Option      "XkbLayout" "us,ru"
               Option      "XkbOptions" "grp:shift_toggle"
            EndSection

    The same layout, at least in theory, may be created at runtime
    by calling 
       setxkbmap -layout "us,ru" -option "grp:shift_toggle"  -rules xfree86 -model pc105
    Switch between groups by pressing left then right Shift.   
    
    Compile and run a simplest test:
    
    import java.awt.*;
    public class AcTest {
        static Frame frame = null;
        static TextField tf = null;
        public static void main( String args [] ) {
            frame = new Frame("Input test");
            tf = new TextField();
            frame.add( tf);
            frame.setSize(200,80);
            frame.setLocation(300,300);
            frame.setVisible( true );
        }
    }
    
    Switch to Russian, select text field and type 'q': 
    there must be 0x0439 character added but will be no input at all.
    Also, no events generated.

    
======================================================================

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-09-17
EVALUATION

Name: ynR10250			Date: 12/01/2003

it looks like xkb-based localization never worked neither in 1.4.2
 nor with motif toolkit in 1.5.0b29. Installing Gnome+xkb on Solaris, we
 get (in XAWT) Arabic right-to-left output instead of Russian which is only 
 slightly better than nothing. To fix, we need to map most keysyms>256
 to correct Unicode characters. It may be not altogether easy, so I suggest
 commiting the fix to dragonfly.
###@###.###


======================================================================

Name: dmR10075			Date: 12/23/2003


To map keysym to unicode characters we can use XwcLookupString. It returns
string consisting of characters, in a simple case it will be exactly one character of
input we need. 

How we can't get AWT key code so easily. The question is - do we need to get it? If I press
russian letter 'A' which AWT key code should I get in KEY_PRESSED?
We probably can perform complex lookup since the map AWT keycode <-> X11 key sym 
is only for Latin-1 character+some additional characters. We can probably ask for keyboard 
mapping for different mapping planes, find one which contains keysym for the current 
keycode which maps into AWT key code and return that AWT key code.
###@###.### 2003-12-23

======================================================================

Name: dmR10075			Date: 12/24/2003


I investigated XKB and found no way to get first Latin-1 plane of the keyboard if the input is currently
on another plane(group <-> plane). It seems like, since XKB limits group count to 4, Gnome decides to 
not use XKB groups but rather reinstall 1st group with different maps when switch happens. In my 
configuration, there is always only one group and it is the current group. So, for non-Latin-1 groups,
we will always get AWT keycode 0 because we are unable to map local-specific keysym into Latin-1. 
Possible fix might be to bring ALL keysyms into Java API(as constants, into KeyEvent, in addition to 
Latin-1 and some special keysyms). 
###@###.### 2003-12-24

======================================================================

After fix to 4360364, XAWT version should work properly with XKB in Mustang, on both Linux and Solaris. 
Note that Solaris may be shipped with Xorg which doesn't work without XKB.
###@###.### 2005-05-25 09:56:02 GMT
                                     
2005-05-25



Hardware and Software, Engineered to Work Together