diff options
| author | YAMAMOTO Mitsuharu | 2007-05-16 08:15:44 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2007-05-16 08:15:44 +0000 |
| commit | e4f5123fcee92bfedf16d0e1ed38899f08608fc9 (patch) | |
| tree | eb63486c047b3bd15468aa2499e3a582aa2cab01 /src | |
| parent | 5a83f85cd7ea82ae4867d15e4c680b5378a8e46b (diff) | |
| download | emacs-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')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/macterm.c | 17 |
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 @@ | |||
| 1 | 2007-05-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert | ||
| 4 | dead key repeat and up events. | ||
| 5 | |||
| 1 | 2007-05-13 Chong Yidong <cyd@stupidchicken.com> | 6 | 2007-05-13 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 7 | ||
| 3 | * xterm.c (XTread_socket): Revert last change. | 8 | * 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) | |||
| 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). */ |
| 9172 | static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | 9172 | static 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 | } |