6454041: decimal separator munches the character standing at the right (sk keyboard)

In a group of keysyms associated with a key, check for keypad-ness of more keysyms

Reviewed-by: art
This commit is contained in:
Yuri Nesterenko 2008-08-05 15:26:08 +04:00
parent 16436dc54d
commit 4e01039ec9
2 changed files with 14 additions and 4 deletions

View File

@ -101,10 +101,15 @@ public class XKeysym {
// Otherwise, it is [1].
int ndx = XToolkit.isXsunServer() &&
! XToolkit.isXKBenabled() ? 2 : 1;
// Even if XKB is enabled, we have another problem: some symbol tables (e.g. cz) force
// a regular comma instead of KP_comma for a decimal separator. Result is,
// bugs like 6454041. So, we will try for keypadness a keysym with ndx==0 as well.
XToolkit.awtLock();
try {
return XlibWrapper.IsKeypadKey(
XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx ) );
return (XlibWrapper.IsKeypadKey(
XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx ) ) ||
XlibWrapper.IsKeypadKey(
XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), 0 ) ));
} finally {
XToolkit.awtUnlock();
}

View File

@ -139,10 +139,15 @@ tojava // Xsun without XKB uses keysymarray[2] keysym to determine if it
tojava // Otherwise, it is [1].
tojava int ndx = XToolkit.isXsunServer() &&
tojava ! XToolkit.isXKBenabled() ? 2 : 1;
tojava // Even if XKB is enabled, we have another problem: some symbol tables (e.g. cz) force
tojava // a regular comma instead of KP_comma for a decimal separator. Result is,
tojava // bugs like 6454041. So, we will try for keypadness a keysym with ndx==0 as well.
tojava XToolkit.awtLock();
tojava try {
tojava return XlibWrapper.IsKeypadKey(
tojava XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx ) );
tojava return (XlibWrapper.IsKeypadKey(
tojava XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx ) ) ||
tojava XlibWrapper.IsKeypadKey(
tojava XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), 0 ) ));
tojava } finally {
tojava XToolkit.awtUnlock();
tojava }