summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-06-01 15:22:07 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-06-02 13:31:40 +0900
commitd6b8f0a69116607ae9a761e04c530c6cf2970157 (patch)
treee3c7a57a033860819afa74ad59868791bb08ca5b /src
parent95628c1efaa1476e2a5f05ed09e216603ac78a1f (diff)
Evas: Send key events through eo callbacks
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_evas/ecore_evas.c50
-rw-r--r--src/lib/ecore_input_evas/ecore_input_evas.c2
-rw-r--r--src/lib/efl/interfaces/efl_input_interface.eo2
3 files changed, 43 insertions, 11 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index aecbe4e700..24c287fdee 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -4502,15 +4502,45 @@ _direct_mouse_out_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_IO *info)
4502} 4502}
4503 4503
4504static Eina_Bool 4504static Eina_Bool
4505_direct_key_down_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *info EINA_UNUSED) 4505_direct_key_updown_cb(Ecore_Evas *ee, const Ecore_Event_Key *info, Eina_Bool down)
4506{ 4506{
4507 return EINA_FALSE; 4507 Efl_Event_Key_Data *ev;
4508} 4508 Efl_Event_Key *evt;
4509 Evas *e = ee->evas;
4510 Eina_Bool processed;
4509 4511
4510static Eina_Bool 4512 /* Unused information:
4511_direct_key_up_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *info EINA_UNUSED) 4513 * window
4512{ 4514 * root_window
4513 return EINA_FALSE; 4515 * event_window
4516 * same_screen
4517 * modifiers (already passed to evas, no need to do anything)
4518 */
4519
4520 evt = eo_add(EFL_EVENT_KEY_CLASS, e);
4521 ev = eo_data_scope_get(evt, EFL_EVENT_KEY_CLASS);
4522 if (!ev) return EINA_FALSE;
4523
4524 ev->timestamp = info->timestamp;
4525 ev->pressed = down;
4526 eina_stringshare_replace(&ev->keyname, info->keyname);
4527 eina_stringshare_replace(&ev->key, info->key);
4528 eina_stringshare_replace(&ev->string, info->string);
4529 eina_stringshare_replace(&ev->compose, info->compose);
4530 ev->keycode = info->keycode;
4531 ev->data = info->data;
4532 ev->event_flags = 0;
4533 ev->device = NULL; /* FIXME */
4534
4535 if (down)
4536 eo_event_callback_call(e, EFL_EVENT_KEY_DOWN, evt);
4537 else
4538 eo_event_callback_call(e, EFL_EVENT_KEY_UP, evt);
4539
4540 processed = ev->evas_done;
4541 eo_unref(evt);
4542
4543 return processed;
4514} 4544}
4515 4545
4516static Eina_Bool 4546static Eina_Bool
@@ -4538,11 +4568,11 @@ _ecore_evas_input_direct_cb(void *window, int type, const void *info)
4538 else if (type == ECORE_EVENT_MOUSE_OUT) 4568 else if (type == ECORE_EVENT_MOUSE_OUT)
4539 return _direct_mouse_out_cb(ee, (const Ecore_Event_Mouse_IO *) info); 4569 return _direct_mouse_out_cb(ee, (const Ecore_Event_Mouse_IO *) info);
4540 else if (type == ECORE_EVENT_KEY_DOWN) 4570 else if (type == ECORE_EVENT_KEY_DOWN)
4541 return _direct_key_down_cb(ee, (const Ecore_Event_Key *) info); 4571 return _direct_key_updown_cb(ee, (const Ecore_Event_Key *) info, EINA_TRUE);
4572 else if (type == ECORE_EVENT_KEY_UP)
4573 return _direct_key_updown_cb(ee, (const Ecore_Event_Key *) info, EINA_FALSE);
4542 else if (type == ECORE_EVENT_MOUSE_BUTTON_CANCEL) 4574 else if (type == ECORE_EVENT_MOUSE_BUTTON_CANCEL)
4543 return _direct_mouse_cancel_cb(ee, (const Ecore_Event_Mouse_Button *) info); 4575 return _direct_mouse_cancel_cb(ee, (const Ecore_Event_Mouse_Button *) info);
4544 else if (type == ECORE_EVENT_KEY_UP)
4545 return _direct_key_up_cb(ee, (const Ecore_Event_Key *) info);
4546 else if (type == ECORE_EVENT_AXIS_UPDATE) 4576 else if (type == ECORE_EVENT_AXIS_UPDATE)
4547 return _direct_axis_update_cb(ee, (const Ecore_Event_Axis_Update *) info); 4577 return _direct_axis_update_cb(ee, (const Ecore_Event_Axis_Update *) info);
4548 else 4578 else
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c
index b0d86b6a12..c06b30d7a1 100644
--- a/src/lib/ecore_input_evas/ecore_input_evas.c
+++ b/src/lib/ecore_input_evas/ecore_input_evas.c
@@ -429,7 +429,7 @@ _ecore_event_evas_key(Ecore_Event_Key *e, Ecore_Event_Press press)
429 else 429 else
430 { 430 {
431 if (!lookup->direct || 431 if (!lookup->direct ||
432 !lookup->direct(lookup->window, ECORE_EVENT_KEY_DOWN, e)) 432 !lookup->direct(lookup->window, ECORE_EVENT_KEY_UP, e))
433 { 433 {
434 evas_event_feed_key_up_with_keycode(lookup->evas, 434 evas_event_feed_key_up_with_keycode(lookup->evas,
435 e->keyname, 435 e->keyname,
diff --git a/src/lib/efl/interfaces/efl_input_interface.eo b/src/lib/efl/interfaces/efl_input_interface.eo
index ad1281b6a5..13ef5dc778 100644
--- a/src/lib/efl/interfaces/efl_input_interface.eo
+++ b/src/lib/efl/interfaces/efl_input_interface.eo
@@ -13,5 +13,7 @@ interface Efl.Input.Interface ()
13 pointer,in: Efl.Event.Pointer; 13 pointer,in: Efl.Event.Pointer;
14 pointer,out: Efl.Event.Pointer; 14 pointer,out: Efl.Event.Pointer;
15 pointer,wheel: Efl.Event.Pointer; 15 pointer,wheel: Efl.Event.Pointer;
16 key,down: Efl.Event.Key;
17 key,up: Efl.Event.Key;
16 } 18 }
17} 19}