summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2007-05-16 08:15:44 +0000
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2007-05-16 08:15:44 +0000
commite4f5123fcee92bfedf16d0e1ed38899f08608fc9 (patch)
treeeb63486c047b3bd15468aa2499e3a582aa2cab01
parent5a83f85cd7ea82ae4867d15e4c680b5378a8e46b (diff)
downloademacs-e4f5123fcee92bfedf16d0e1ed38899f08608fc9.tar.gz
[USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert
dead key repeat and up events.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/macterm.c17
2 files changed, 18 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 503b82881dd..9bf43195c1d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert
+ dead key repeat and up events.
+
2007-05-13 Chong Yidong <cyd@stupidchicken.com>
* xterm.c (XTread_socket): Revert last change.
diff --git a/src/macterm.c b/src/macterm.c
index bee1af5ab71..1acb521f47b 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -9164,15 +9164,16 @@ mac_get_mouse_btn (EventRef ref)
/* Normally, ConvertEventRefToEventRecord will correctly handle all
events. However the click of the mouse wheel is not converted to a
- mouseDown or mouseUp event. Likewise for dead key down events.
- This calls ConvertEventRef, but then checks to see if it is a mouse
- up/down, or a dead key down carbon event that has not been
+ mouseDown or mouseUp event. Likewise for dead key events. This
+ calls ConvertEventRefToEventRecord, but then checks to see if it is
+ a mouse up/down, or a dead key Carbon event that has not been
converted, and if so, converts it by hand (to be picked up in the
XTread_socket loop). */
static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
{
OSStatus err;
Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec);
+ EventKind action;
if (result)
return result;
@@ -9201,6 +9202,14 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
switch (GetEventKind (eventRef))
{
case kEventRawKeyDown:
+ action = keyDown;
+ goto keystroke_common;
+ case kEventRawKeyRepeat:
+ action = autoKey;
+ goto keystroke_common;
+ case kEventRawKeyUp:
+ action = keyUp;
+ keystroke_common:
{
unsigned char char_codes;
UInt32 key_code;
@@ -9214,7 +9223,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
NULL, &key_code);
if (err == noErr)
{
- eventRec->what = keyDown;
+ eventRec->what = action;
eventRec->message = char_codes | ((key_code & 0xff) << 8);
result = 1;
}