elm+evas - windows - fix alt+f4 to work without losing alt key

fixes  T5581
This commit is contained in:
Vincent Torri 2017-06-15 15:58:05 +09:00 committed by Carsten Haitzler (Rasterman)
parent cbea6e4386
commit c233274529
2 changed files with 25 additions and 2 deletions

View File

@ -75,14 +75,14 @@ _ecore_win32_window_procedure(HWND window,
{
/* Keyboard input notifications */
case WM_KEYDOWN:
/*case WM_SYSKEYDOWN:*/
case WM_SYSKEYDOWN:
INF("key down message");
_ecore_win32_event_handle_key_press(data);
return 0;
/* case WM_CHAR: */
/* case WM_SYSCHAR: */
case WM_KEYUP:
/*case WM_SYSKEYUP:*/
case WM_SYSKEYUP:
INF("key up message");
_ecore_win32_event_handle_key_release(data);
return 0;

View File

@ -97,6 +97,7 @@ struct _Efl_Ui_Win_Data
struct
{
Ecore_Win32_Window *win;
Ecore_Event_Handler *key_down_handler;
} win32;
#endif
@ -2803,6 +2804,9 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd)
if (sd->pointer.ee) ecore_evas_free(sd->pointer.ee);
sd->pointer.surf = NULL;
#endif
#ifdef HAVE_ELEMENTARY_WIN32
ecore_event_handler_del(sd->win32.key_down_handler);
#endif
if (sd->type == ELM_WIN_INLINED_IMAGE)
{
@ -3715,6 +3719,23 @@ _elm_win_property_change(void *data,
}
#endif
#ifdef HAVE_ELEMENTARY_WIN32
static Eina_Bool
_elm_win_key_down(void *data,
int type EINA_UNUSED,
void *event)
{
ELM_WIN_DATA_GET(data, sd);
Ecore_Event_Key *e = event;
if ((e->modifiers & ECORE_EVENT_MODIFIER_ALT) &&
(strcmp(e->key, "F4") == 0))
_elm_win_delete_request(sd->ee);
return ECORE_CALLBACK_PASS_ON;
}
#endif
static void
_elm_win_focus_highlight_hide(void *data EINA_UNUSED,
Evas_Object *obj,
@ -5012,6 +5033,8 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
_elm_win_cocoawindow_get(sd);
#endif
#ifdef HAVE_ELEMENTARY_WIN32
sd->win32.key_down_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
_elm_win_key_down, obj);
_internal_elm_win_win32window_get(sd);
#endif