summaryrefslogtreecommitdiff
path: root/src/lib/ecore_cocoa
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-10-08 17:20:28 -0300
committerGuilherme Iscaro <iscaro@profusion.mobi>2016-10-10 14:20:47 -0300
commit0897715c8da0428331c9288bcef55e5fe53638b1 (patch)
treeba2a77e81b7e69f1c61f53ecb262a0b33bdc83c9 /src/lib/ecore_cocoa
parent16ee5b7a5f8ae5fbed46e7d5cedae6d0c80462cc (diff)
Ecore_Cocoa: Fix repeat modifers keys.
Some values were repeated.
Diffstat (limited to 'src/lib/ecore_cocoa')
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa.m17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m
index 0ab07e8ca3..7400eb9cbb 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa.m
@@ -96,10 +96,11 @@ _ecore_cocoa_event_modifiers(NSUInteger mod)
96 unsigned int modifiers = 0; 96 unsigned int modifiers = 0;
97 97
98 if (mod & NSEventModifierFlagShift) modifiers |= ECORE_EVENT_MODIFIER_SHIFT; 98 if (mod & NSEventModifierFlagShift) modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
99 if (mod & NSEventModifierFlagShift) modifiers |= ECORE_EVENT_MODIFIER_CTRL; 99 if (mod & NSEventModifierFlagControl) modifiers |= ECORE_EVENT_MODIFIER_CTRL;
100 if (mod & NSEventModifierFlagOption) modifiers |= ECORE_EVENT_MODIFIER_ALTGR; 100 if (mod & NSEventModifierFlagOption) modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
101 if (mod & NSEventModifierFlagOption) modifiers |= ECORE_EVENT_MODIFIER_WIN; 101 if (mod & NSEventModifierFlagCommand) modifiers |= ECORE_EVENT_MODIFIER_WIN;
102 if (mod & NSEventModifierFlagNumericPad) modifiers |= ECORE_EVENT_LOCK_NUM; 102 if (mod & NSEventModifierFlagNumericPad) modifiers |= ECORE_EVENT_LOCK_NUM;
103 if (mod & NSEventModifierFlagCapsLock) modifiers |= ECORE_EVENT_LOCK_CAPS;
103 104
104 DBG("key modifiers: 0x%lx, %u", mod, modifiers); 105 DBG("key modifiers: 0x%lx, %u", mod, modifiers);
105 return modifiers; 106 return modifiers;
@@ -246,14 +247,16 @@ _ecore_cocoa_feed_events(void *anEvent)
246 // Turn special key flags on 247 // Turn special key flags on
247 if (flags & NSEventModifierFlagShift) 248 if (flags & NSEventModifierFlagShift)
248 evDown->key = "Shift_L"; 249 evDown->key = "Shift_L";
249 else if (flags & NSEventModifierFlagShift) 250 else if (flags & NSEventModifierFlagControl)
250 evDown->key = "Control_L"; 251 evDown->key = "Control_L";
251 else if (flags & NSEventModifierFlagOption) 252 else if (flags & NSEventModifierFlagOption)
252 evDown->key = "Alt_L"; 253 evDown->key = "Alt_L";
253 else if (flags & NSEventModifierFlagOption) 254 else if (flags & NSEventModifierFlagCommand)
254 evDown->key = "Super_L"; 255 evDown->key = "Super_L";
255 else if (flags & NSEventModifierFlagCapsLock) 256 else if (flags & NSEventModifierFlagCapsLock)
256 evDown->key = "Caps_Lock"; 257 evDown->key = "Caps_Lock";
258 else if (flags & NSEventModifierFlagNumericPad)
259 evDown->key = "Num_Lock";
257 260
258 if (evDown->key) 261 if (evDown->key)
259 { 262 {
@@ -278,14 +281,16 @@ _ecore_cocoa_feed_events(void *anEvent)
278 // Turn special key flags off 281 // Turn special key flags off
279 if (changed_flags & NSEventModifierFlagShift) 282 if (changed_flags & NSEventModifierFlagShift)
280 evUp->key = "Shift_L"; 283 evUp->key = "Shift_L";
281 else if (changed_flags & NSEventModifierFlagShift) 284 else if (changed_flags & NSEventModifierFlagControl)
282 evUp->key = "Control_L"; 285 evUp->key = "Control_L";
283 else if (changed_flags & NSEventModifierFlagOption) 286 else if (changed_flags & NSEventModifierFlagOption)
284 evUp->key = "Alt_L"; 287 evUp->key = "Alt_L";
285 else if (changed_flags & NSEventModifierFlagOption) 288 else if (changed_flags & NSEventModifierFlagCommand)
286 evUp->key = "Super_L"; 289 evUp->key = "Super_L";
287 else if (changed_flags & NSEventModifierFlagCapsLock) 290 else if (changed_flags & NSEventModifierFlagCapsLock)
288 evUp->key = "Caps_Lock"; 291 evUp->key = "Caps_Lock";
292 else if (changed_flags & NSEventModifierFlagNumericPad)
293 evUp->key = "Num_Lock";
289 294
290 if (evUp->key) 295 if (evUp->key)
291 { 296 {