summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichelle Legrand <michelle.legrand@openwide.fr>2015-01-22 11:24:42 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-02-05 16:38:07 +0100
commit73634580f8949547b0dbd5f072eb57fa1e273401 (patch)
tree8b2255cb5c0a4434b6e8de0a486657eb9fe7ed33
parent48fff1478c52cbd76b9d300e0019c829250a0bd4 (diff)
ecore_cocoa: Handle more special characters and capital characters.
This improve the situation and only affect Ecore_Cocoa code base by detecting a useful charactere. Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/ecore_cocoa/Ecore_Cocoa_Keys.h1
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa.m66
2 files changed, 36 insertions, 31 deletions
diff --git a/src/lib/ecore_cocoa/Ecore_Cocoa_Keys.h b/src/lib/ecore_cocoa/Ecore_Cocoa_Keys.h
index 69a487248f..f66ae9188e 100644
--- a/src/lib/ecore_cocoa/Ecore_Cocoa_Keys.h
+++ b/src/lib/ecore_cocoa/Ecore_Cocoa_Keys.h
@@ -242,6 +242,7 @@ static const struct _ecore_cocoa_keys_s keystable[] =
242{ NSEndFunctionKey, "End", "" }, 242{ NSEndFunctionKey, "End", "" },
243{ NSPageUpFunctionKey, "Page_Up", "" }, 243{ NSPageUpFunctionKey, "Page_Up", "" },
244{ NSPageDownFunctionKey, "Page_Down", "" }, 244{ NSPageDownFunctionKey, "Page_Down", "" },
245{ NSDeleteFunctionKey, "Delete", "\010"},
245 246
246{ NSF1FunctionKey, "F1", "" }, 247{ NSF1FunctionKey, "F1", "" },
247{ NSF2FunctionKey, "F2", "" }, 248{ NSF2FunctionKey, "F2", "" },
diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m
index 119e66f62f..3529df6963 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa.m
@@ -291,26 +291,29 @@ ecore_cocoa_feed_events(void *anEvent)
291 compose=EINA_FALSE; 291 compose=EINA_FALSE;
292 } 292 }
293 293
294 if ([keychar length] > 0){ 294 if ([keychar length] > 0)
295 for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i)
296 { 295 {
297 if (keystable[i].code == [keychar characterAtIndex:0]) 296 for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i)
298 { 297 {
299 DBG("Key pressed : %s\n", keystable[i].name); 298 if (keystable[i].code == [keychar characterAtIndex:0])
300 ev->keyname = keystable[i].name; 299 {
301 ev->key = keystable[i].name; 300 DBG("Key pressed: %s %d\n", keystable[i].name, [keychar characterAtIndex:0]);
302 ev->string = keystable[i].compose; 301 ev->keyname = keystable[i].name;
303 ev->window = (Ecore_Window)window.ecore_window_data; 302 ev->key = keystable[i].name;
304 ev->event_window = ev->window; 303 ev->string = keystable[i].compose;
305 ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL); 304 ev->window = (Ecore_Window)window.ecore_window_data;
306 return pass; 305 ev->event_window = ev->window;
307 } 306 ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL);
307 return pass;
308 }
309 }
310 }
311 else
312 {
313 compose=EINA_TRUE;
314 edit = [[event window] fieldEditor:YES forObject:nil];
315 [edit interpretKeyEvents:[NSArray arrayWithObject:event]];
308 } 316 }
309 }else{
310 compose=EINA_TRUE;
311 edit = [[event window] fieldEditor:YES forObject:nil];
312 [edit interpretKeyEvents:[NSArray arrayWithObject:event]];
313 }
314 317
315 break; 318 break;
316 } 319 }
@@ -328,21 +331,22 @@ ecore_cocoa_feed_events(void *anEvent)
328 ev->timestamp = time; 331 ev->timestamp = time;
329 ev->modifiers = _ecore_cocoa_event_modifiers([event modifierFlags]); 332 ev->modifiers = _ecore_cocoa_event_modifiers([event modifierFlags]);
330 333
331 if ([keychar length] > 0){ 334 if ([keychar length] > 0)
332 for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i)
333 { 335 {
334 if (keystable[i].code == tolower([keychar characterAtIndex:0])) 336 for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i)
335 { 337 {
336 ev->keyname = keystable[i].name; 338 if (keystable[i].code == [keychar characterAtIndex:0])
337 ev->key = keystable[i].name; 339 {
338 ev->string = keystable[i].compose; 340 ev->keyname = keystable[i].name;
339 ev->window = (Ecore_Window)window.ecore_window_data; 341 ev->key = keystable[i].name;
340 ev->event_window = ev->window; 342 ev->string = keystable[i].compose;
341 ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL); 343 ev->window = (Ecore_Window)window.ecore_window_data;
342 return pass; 344 ev->event_window = ev->window;
343 } 345 ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL);
346 return pass;
347 }
348 }
344 } 349 }
345 }
346 350
347 break; 351 break;
348 } 352 }