SUGGESTED FIX
------- canvas.c -------
*** /tmp/dEoaadN Sat Apr 13 00:57:51 2002
--- canvas.c Sat Apr 13 00:53:46 2002
***************
*** 1060,1065 ****
--- 1060,1068 ----
if (modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK) {
xevent->xkey.state |= awt_AltMask;
}
+ if (modifiers & java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK) {
+ xevent->xkey.state |= awt_ModeSwitchMask;
+ }
if (modifiers & java_awt_event_InputEvent_BUTTON1_DOWN_MASK) {
xevent->xkey.state |= Button1Mask;
}
***************
*** 1582,1602 ****
(jchar) (mapsToUnicodeChar ? keysym :
java_awt_event_KeyEvent_CHAR_UNDEFINED),
modifiers,
! keyLocation, event);
! if ((keyEventId == java_awt_event_KeyEvent_KEY_PRESSED) &&
! mapsToUnicodeChar) {
! awt_post_java_key_event(client_data,
! java_awt_event_KeyEvent_KEY_TYPED,
! NULL,
! event->xkey.time,
! java_awt_event_KeyEvent_VK_UNDEFINED,
! (jchar) keysym,
! modifiers,
! java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN,
! event);
}
}
}
--- 1585,1640 ----
(jchar) (mapsToUnicodeChar ? keysym :
java_awt_event_KeyEvent_CHAR_UNDEFINED),
modifiers,
! keyLocation,
! event);
! /* If this was a keyPressed event, we may need to post a
! * keyTyped event, too. Otherwise, return.
! */
! if (keyEventId == java_awt_event_KeyEvent_KEY_RELEASED) {
! return;
! }
! DTRACE_PRINTLN("This is a keyPressed event");
! /* Now get real keysym which looks at modifiers for keyTyped event.
! * XtGetActionKeySym() returns wrong value with Kana Lock,
! * so use XtTranslateKeycode().
! */
! XtTranslateKeycode(event->xkey.display, (KeyCode) event->xkey.keycode,
! event->xkey.state, &mods, &keysym);
! DTRACE_PRINTLN6("%s: type=%d, xkeycode=%x, xstate=%x, keysym=%x, xmods=%d",
! "In handleKeyEvent keysym>=256 ", event->type, event->xkey.keycode,
! event->xkey.state, keysym, mods);
!
! if (keysym == NoSymbol) {
! return;
}
+
+ /* Map the real keysym to a Java keycode */
+ keysymToAWTKeyCode(keysym, &keycode, &mapsToUnicodeChar, &keyLocation);
+ DTRACE_PRINTLN3("In handleKeyEvent: keysym=%x, AWTkeycode=%x, mapsToUnicodeChar=%d",
+ keysym, keycode, mapsToUnicodeChar);
+
+ /* If it doesn't map to a Unicode character, don't post a keyTyped event */
+ if (!mapsToUnicodeChar) {
+ return;
+ }
+
+ handleVendorKeySyms(event, &keysym);
+ adjustKeySym(event, &keysym);
+ DTRACE_PRINT4("In handleKeyEvent: type=%d, xkeycode=%x, xstate=%x, keysym=%x",
+ event->type, event->xkey.keycode, event->xkey.state, keysym);
+ DTRACE_PRINTLN2(", AWTkeycode=%x, AWTmodifiers=%d", keycode, modifiers);
+
+ awt_post_java_key_event(client_data,
+ java_awt_event_KeyEvent_KEY_TYPED,
+ NULL,
+ event->xkey.time,
+ java_awt_event_KeyEvent_VK_UNDEFINED,
+ (jchar) keysym,
+ modifiers,
+ java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN,
+ event);
}
}
###@###.### 2002-04-14
|
EVALUATION
The entries for VK_AT, VK_CIRCUMFLEX, VK_COLON, etc., have already been
added to the keymap table in Merlin and Ladybird. This is probably not
the cause of the original complaint about the dead keys, since none of
these are dead keys (circumflex is not the same as dead circumflex).
It would be nice to know what locales the original submitter was using
(if that is applicable to his Linux distribution).
eric.hawkes@eng 2001-01-15
The modmap the submitter is using is the French Canadian modmap, according
to the comments in the modmap file.
eric.hawkes@eng 2001-02-08
There seem to be three separate bugs in this report. The one about
VK_AT, VK_CIRCUMFLEX, VK_COLON, etc. is a duplicate of 4347983 (see also
4295215). I have asked that the one about ()[] be decomposed into a
separate bug report. I will need more information, such as the locale,
keyboard, and xmodmap before I can investigate it.
eric.hawkes@eng 2001-02-23
I tried the French Canadian xmodmap with a US keyboard under linux and
merlin build 53 (the modmap is a /usr/share/xmodmap/xmodmap.qc).
The dead key seemed to work more-or-less correctly in that the correct
characters appeared in the textfield.
[ then e produced an e with a circumflex over it.
] then c produced a c with a cedilla
shift [ resulted in ^
shift ] then e resulted in an e with an umlaut over it
In these four cases, the events for the dead keys were not present, but the
events for the other keys were.
The right Alt key served as an AltGraph.
AltGr [ produced [
AltGr ] produced ]
but as the submitter said, key events were seen only for AltGraph, not for
[ and ]
Since the characters were correctly generated, I'm leaving this as a P4.
eric.hawkes@eng 2001-02-24
I am now concerned that the characters could not be entered into Swing
components, although they would be entered into AWT components.
Raising priority to P3.
BTW, this could possibly be solved by 4423661.
eric.hawkes@eng 2001-03-08
Probably fixed in merlin, but we should verify after beta3.
###@###.### 2001-08-25
Apparently, this still exists in Merlin. I see two problems:
1) in canvas.c modify_Event, we aren't OR-ing in the ALT_GRAPH_DOWN modifier.
2) I think the way we determine whether we need to post a KEY_TYPED event
is wrong. I believe we are determinging the value of mapsToUnicodeChar by
translating the keysym without modifiers, when we need to take them into
account. In the case of the french canadian keyboard, this is a problem:
You type a bracketright by AltGraph - dead_cedilla. dead_cedilla is a
dead key, and therefore does not map to a unicode character. However,
we should be posting a KEY_TYPED event for bracketright here.
The solution is to translate the keysym using the modifiers (shift or AltGr),
and post a KEY_TYPED (or not) based on that outcome.
###@###.### 2002-03-01
Since a French Canadian keyboard is necessary to verify this fix, it will not
be necessary for SQE to verify this bug.
###@###.### 2002-04-17
|