fix focus and key events in rage to have dummy button always

This commit is contained in:
Carsten Haitzler 2014-08-15 15:19:36 +09:00
parent b634bf7244
commit 5f473687dd
1 changed files with 8 additions and 1 deletions

View File

@ -325,7 +325,14 @@ win_add(void)
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT,
_cb_mouse_move, win);
evas_object_event_callback_add(win, EVAS_CALLBACK_KEY_DOWN,
// a dummy button to collect key events and have focus
o = elm_button_add(win);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, o);
elm_object_focus_set(o, EINA_TRUE);
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN,
_cb_key_down, win);
return win;