changeset 80020:5b2a1921a62f

(mac_to_emacs_modifiers): New argument UNMAPPED_MODS. All callers changed. (mac_quit_char_key_p, XTread_socket): Get Emacs modifiers from mapped modifiers together with original ones.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Mon, 04 Feb 2008 11:43:00 +0000
parents 3eb16e4c4497
children 36f5f0eec1b4
files src/macterm.c
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/macterm.c	Mon Feb 04 09:42:16 2008 +0000
+++ b/src/macterm.c	Mon Feb 04 11:43:00 2008 +0000
@@ -9045,13 +9045,13 @@
 
 static int
 #if USE_CARBON_EVENTS
-mac_to_emacs_modifiers (UInt32 mods)
+mac_to_emacs_modifiers (UInt32 mods, UInt32 unmapped_mods)
 #else
-mac_to_emacs_modifiers (EventModifiers mods)
+mac_to_emacs_modifiers (EventModifiers mods, EventModifiers unmapped_mods)
 #endif
 {
   unsigned int result = 0;
-  if (mods & shiftKey)
+  if ((mods | unmapped_mods) & shiftKey)
     result |= shift_modifier;
 
   /* Deactivated to simplify configuration:
@@ -9153,7 +9153,7 @@
   if (char_code & ~0xff)
     return 0;
 
-  emacs_modifiers = mac_to_emacs_modifiers (mapped_modifiers);
+  emacs_modifiers = mac_to_emacs_modifiers (mapped_modifiers, modifiers);
   if (emacs_modifiers & ctrl_modifier)
     c = make_ctrl_char (char_code);
 
@@ -9179,7 +9179,7 @@
     {
       mods &= ~(optionKey | cmdKey);
     }
-  return mac_to_emacs_modifiers (mods);
+  return mac_to_emacs_modifiers (mods, 0);
 }
 
 /* Given an event ref, return the code to use for the mouse button
@@ -9769,7 +9769,7 @@
   EVENT_INIT (buf);
 
   buf.kind = DRAG_N_DROP_EVENT;
-  buf.modifiers = mac_to_emacs_modifiers (modifiers);
+  buf.modifiers = mac_to_emacs_modifiers (modifiers, 0);
   buf.timestamp = TickCount () * (1000 / 60);
   XSETINT (buf.x, mouse_pos.h);
   XSETINT (buf.y, mouse_pos.v);
@@ -10255,7 +10255,7 @@
 		    read_socket_inev->kind = ASCII_KEYSTROKE_EVENT;
 		    read_socket_inev->code = code;
 		    read_socket_inev->modifiers =
-		      mac_to_emacs_modifiers (modifiers);
+		      mac_to_emacs_modifiers (modifiers, 0);
 		    read_socket_inev->modifiers |=
 		      (extra_keyboard_modifiers
 		       & (meta_modifier | alt_modifier
@@ -10901,7 +10901,7 @@
 		    inev.modifiers = mac_event_to_emacs_modifiers (eventRef);
 #else
 		    inev.code = mac_get_emulated_btn (er.modifiers);
-		    inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
+		    inev.modifiers = mac_to_emacs_modifiers (er.modifiers, 0);
 #endif
 		    XSETINT (inev.x, mouse_loc.h);
 		    XSETINT (inev.y, mouse_loc.v);
@@ -11430,7 +11430,8 @@
 		inev.code = er.message & charCodeMask;
 	      }
 
-	    inev.modifiers = mac_to_emacs_modifiers (mapped_modifiers);
+	    inev.modifiers = mac_to_emacs_modifiers (mapped_modifiers,
+						     modifiers);
 	    inev.modifiers |= (extra_keyboard_modifiers
 			       & (meta_modifier | alt_modifier
 				  | hyper_modifier | super_modifier));