aboutsummaryrefslogtreecommitdiffstats
path: root/src/macterm.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2007-05-16 08:15:44 +0000
committerYAMAMOTO Mitsuharu2007-05-16 08:15:44 +0000
commite4f5123fcee92bfedf16d0e1ed38899f08608fc9 (patch)
treeeb63486c047b3bd15468aa2499e3a582aa2cab01 /src/macterm.c
parent5a83f85cd7ea82ae4867d15e4c680b5378a8e46b (diff)
downloademacs-e4f5123fcee92bfedf16d0e1ed38899f08608fc9.tar.gz
emacs-e4f5123fcee92bfedf16d0e1ed38899f08608fc9.zip
[USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert
dead key repeat and up events.
Diffstat (limited to 'src/macterm.c')
-rw-r--r--src/macterm.c17
1 files changed, 13 insertions, 4 deletions
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)
9164 9164
9165/* Normally, ConvertEventRefToEventRecord will correctly handle all 9165/* Normally, ConvertEventRefToEventRecord will correctly handle all
9166 events. However the click of the mouse wheel is not converted to a 9166 events. However the click of the mouse wheel is not converted to a
9167 mouseDown or mouseUp event. Likewise for dead key down events. 9167 mouseDown or mouseUp event. Likewise for dead key events. This
9168 This calls ConvertEventRef, but then checks to see if it is a mouse 9168 calls ConvertEventRefToEventRecord, but then checks to see if it is
9169 up/down, or a dead key down carbon event that has not been 9169 a mouse up/down, or a dead key Carbon event that has not been
9170 converted, and if so, converts it by hand (to be picked up in the 9170 converted, and if so, converts it by hand (to be picked up in the
9171 XTread_socket loop). */ 9171 XTread_socket loop). */
9172static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) 9172static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
9173{ 9173{
9174 OSStatus err; 9174 OSStatus err;
9175 Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); 9175 Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec);
9176 EventKind action;
9176 9177
9177 if (result) 9178 if (result)
9178 return result; 9179 return result;
@@ -9201,6 +9202,14 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
9201 switch (GetEventKind (eventRef)) 9202 switch (GetEventKind (eventRef))
9202 { 9203 {
9203 case kEventRawKeyDown: 9204 case kEventRawKeyDown:
9205 action = keyDown;
9206 goto keystroke_common;
9207 case kEventRawKeyRepeat:
9208 action = autoKey;
9209 goto keystroke_common;
9210 case kEventRawKeyUp:
9211 action = keyUp;
9212 keystroke_common:
9204 { 9213 {
9205 unsigned char char_codes; 9214 unsigned char char_codes;
9206 UInt32 key_code; 9215 UInt32 key_code;
@@ -9214,7 +9223,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
9214 NULL, &key_code); 9223 NULL, &key_code);
9215 if (err == noErr) 9224 if (err == noErr)
9216 { 9225 {
9217 eventRec->what = keyDown; 9226 eventRec->what = action;
9218 eventRec->message = char_codes | ((key_code & 0xff) << 8); 9227 eventRec->message = char_codes | ((key_code & 0xff) << 8);
9219 result = 1; 9228 result = 1;
9220 } 9229 }