Mercurial > emacs
comparison src/macterm.c @ 56277:fd126130c3cd
macterm.c (mac_get_emulated_btn)
(mac_event_to_emacs_modifiers): Fix emulated mouse button
support to correctly mask out modifiers.
author | Steven Tamm <steventamm@mac.com> |
---|---|
date | Tue, 29 Jun 2004 06:23:08 +0000 |
parents | 98f2b9da67f0 |
children | 3d525d0266de |
comparison
equal
deleted
inserted
replaced
56276:b04610e283ce | 56277:fd126130c3cd |
---|---|
7016 mac_get_emulated_btn ( UInt32 modifiers ) | 7016 mac_get_emulated_btn ( UInt32 modifiers ) |
7017 { | 7017 { |
7018 int result = 0; | 7018 int result = 0; |
7019 if (!NILP (Vmac_emulate_three_button_mouse)) { | 7019 if (!NILP (Vmac_emulate_three_button_mouse)) { |
7020 int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse); | 7020 int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse); |
7021 if (modifiers & controlKey) | 7021 if (modifiers & cmdKey) |
7022 result = cmdIs3 ? 2 : 1; | 7022 result = cmdIs3 ? 2 : 1; |
7023 else if (modifiers & optionKey) | 7023 else if (modifiers & optionKey) |
7024 result = cmdIs3 ? 1 : 2; | 7024 result = cmdIs3 ? 1 : 2; |
7025 } | 7025 } |
7026 return result; | 7026 return result; |
7036 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, | 7036 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, |
7037 sizeof (UInt32), NULL, &mods); | 7037 sizeof (UInt32), NULL, &mods); |
7038 if (!NILP (Vmac_emulate_three_button_mouse) && | 7038 if (!NILP (Vmac_emulate_three_button_mouse) && |
7039 GetEventClass(eventRef) == kEventClassMouse) | 7039 GetEventClass(eventRef) == kEventClassMouse) |
7040 { | 7040 { |
7041 mods &= ~(optionKey & cmdKey); | 7041 mods &= ~(optionKey | cmdKey); |
7042 } | 7042 } |
7043 return mac_to_emacs_modifiers (mods); | 7043 return mac_to_emacs_modifiers (mods); |
7044 } | 7044 } |
7045 | 7045 |
7046 /* Given an event ref, return the code to use for the mouse button | 7046 /* Given an event ref, return the code to use for the mouse button |