impossible to remap keys on japanese keyboard

Troy tjk at tksoft.com
Sun Oct 22 13:15:15 PDT 2006


Hi, 

When mapping keys to modifiers, you should alter the
modifier map instead.

To get the modifier map, use:
xmodmap -pm

To add the Hiragana_Katakana key, use:
xmodmap -e 'add Shift = Hiragana_Katakana' 

Will should add Hiragana_Katakana to the shift modifiers.
I did notice that this doesn't work, although it seems
that it should.... 

I then tested with another key, Henkan.

xmodmap -e 'add Shift = Henkan' 

This works.

If you look at the xev output, you will see that the 
state is changed after pressing and releasing the
newly mapped "keycode 208 Hiragana_katakana/Romaji" key,
as it is for Henkan as well. I.e. the state is 0x1 in
the key released output (indicating state when the key was 
still down).

I unfortunately just upgraded by only Ubuntu 5.10 to Ubuntu 6.06,
so I couldn't test with 5.10. 

In conclusion, I thought I knew how this works, but I am now
baffled as well. Sorry. I will foreward this question to the
xkb list, which is a better forum.


Troy





> 
> Dear Xorg,
> 
> The following bug appears in Ubuntu 6.06 and 6.10 but not 5.10.  It
> also appears in recent releases of Redhat, but not of SuSE.  I can
> only suppose it's a problem to do with recent versions of xorg.
> 
> I'm using a japanese laptop with a japanese keyboard.  xmodmap seems
> ineffective and does not properly remap some keys, though it is fine
> with others.
> 
> For years I have mapped
> 
> Hiragana_Katakana keysym 0xff27 keycode 208
> to Shift_R
> 
> and
> 
> backslash keysym 0x5c keycode 211 XKeysymToKeycode returns keycode 51
> to
> Pointer_Button1
> 
> Here are extracts from the relevant xmodmap file:
> 
> keycode 208 = Shift_R
> ! Hiragana_katakana Romanji
> keycode 211 = Pointer_Button1
> !backslash underscore kana_RO
> 
> This has worked fine in the past --- but suddenly with my upgrade to
> more modern linux systems, it doesn't.  I push the keys --- nothing
> happens.  For example if I hold down the key marked
> 'Hiragana_katakana' and press the key marked 'c', I get a lowercase c
> where previously I got an uppercase C.
> 
> xev seems aware of the changes made by xmodmap even if I don't get the
> results I want when I press keys.  Here is a copy of xev output before
> an xmodmap:
> 
> KeyPress event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834185467, (121,49), root:(732,493),
>     state 0x0, keycode 211 (keysym 0x5c, backslash), same_screen YES,
>     XKeysymToKeycode returns keycode: 51
>     XLookupString gives 1 bytes: (5c) "\"
>     XmbLookupString gives 1 bytes: (5c) "\"
>     XFilterEvent returns: False
> 
> KeyRelease event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834185467, (121,49), root:(732,493),
>     state 0x0, keycode 211 (keysym 0x5c, backslash), same_screen YES,
>     XKeysymToKeycode returns keycode: 51
>     XLookupString gives 1 bytes: (5c) "\"
>     XFilterEvent returns: False
> 
> KeyPress event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834186317, (121,49), root:(732,493),
>     state 0x0, keycode 208 (keysym 0xff27, Hiragana_Katakana), same_screen YES,
>     XLookupString gives 0 bytes:
>     XmbLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> KeyRelease event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834186317, (121,49), root:(732,493),
>     state 0x0, keycode 208 (keysym 0xff27, Hiragana_Katakana), same_screen YES,
>     XLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> KeyPress event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834209536, (121,49), root:(732,493),
>     state 0x0, keycode 208 (keysym 0xff27, Hiragana_Katakana), same_screen YES,
>     XLookupString gives 0 bytes:
>     XmbLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> KeyRelease event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834209536, (121,49), root:(732,493),
>     state 0x0, keycode 208 (keysym 0xff27, Hiragana_Katakana), same_screen YES,
>     XLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> KeyPress event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834210110, (121,49), root:(732,493),
>     state 0x0, keycode 211 (keysym 0x5c, backslash), same_screen YES,
>     XKeysymToKeycode returns keycode: 51
>     XLookupString gives 1 bytes: (5c) "\"
>     XmbLookupString gives 1 bytes: (5c) "\"
>     XFilterEvent returns: False
> 
> KeyRelease event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834210110, (121,49), root:(732,493),
>     state 0x0, keycode 211 (keysym 0x5c, backslash), same_screen YES,
>     XKeysymToKeycode returns keycode: 51
>     XLookupString gives 1 bytes: (5c) "\"
>     XFilterEvent returns: False
> 
> **********************************************************************************************
> 
> Here is a copy of xev output after an xmodmap:
> 
> KeyPress event, serial 28, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834365954, (156,112), root:(767,556),
>     state 0x0, keycode 211 (keysym 0xfee9, Pointer_Button1), same_screen YES,
>     XLookupString gives 0 bytes:
>     XmbLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> KeyRelease event, serial 28, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834365954, (156,112), root:(767,556),
>     state 0x0, keycode 211 (keysym 0xfee9, Pointer_Button1), same_screen YES,
>     XLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> KeyPress event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834366343, (156,112), root:(767,556),
>     state 0x0, keycode 208 (keysym 0xffe2, Shift_R), same_screen YES,
>     XKeysymToKeycode returns keycode: 116
>     XLookupString gives 0 bytes:
>     XmbLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> KeyRelease event, serial 31, synthetic NO, window 0x2800001,
>     root 0x45, subw 0x0, time 1834366343, (156,112), root:(767,556),
>     state 0x1, keycode 208 (keysym 0xffe2, Shift_R), same_screen YES,
>     XKeysymToKeycode returns keycode: 116
>     XLookupString gives 0 bytes:
>     XFilterEvent returns: False
> 
> **************************************************************************************
> 
> I note that both keys have keyboard autorepeat enabled.  Attempts to
> switch that off with
> 
> xset -r 208
> xset -r 211
> 
> fail.  Other keys that work fine, such as
> 
> Shift_L bound to keycode 64 and button 3 bound to keycode 62
> 
> and they do not autorepeat.
> 
> Does anybody have any idea what's going on, and what I can do about it?
> 
> Bellissimogiorno.
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
> 




More information about the xorg mailing list