From: caro Date: Thu, 26 Feb 2009 07:24:50 +0000 (+0000) Subject: add more keyboard support on Windows CE X-Git-Tag: build/2012-07-04.173327~2718 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d88139ecd32eee6b534c866c6d8b95c46d3cd14;p=profile%2Fivi%2Fecore.git add more keyboard support on Windows CE git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@39238 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore_wince/ecore_wince.c b/src/lib/ecore_wince/ecore_wince.c index 4a3d59e..02966d9 100644 --- a/src/lib/ecore_wince/ecore_wince.c +++ b/src/lib/ecore_wince/ecore_wince.c @@ -232,14 +232,19 @@ _ecore_wince_window_procedure(HWND window, switch (data->message) { /* Keyboard input notifications */ + case WM_CHAR: + _ecore_wince_event_handle_key_press(data, 0); + break; case WM_HOTKEY: - _ecore_wince_event_handle_key_press(data); + _ecore_wince_event_handle_key_press(data, 1); break; case WM_KEYDOWN: - _ecore_wince_event_handle_key_press(data); + case WM_SYSKEYDOWN: + _ecore_wince_event_handle_key_press(data, 1); break; case WM_KEYUP: - _ecore_wince_event_handle_key_release(data); + case WM_SYSKEYUP: + _ecore_wince_event_handle_key_release(data, 1); break; case WM_SETFOCUS: _ecore_wince_event_handle_focus_in(data); diff --git a/src/lib/ecore_wince/ecore_wince_event.c b/src/lib/ecore_wince/ecore_wince_event.c index 8f2e97a..7d8b198 100644 --- a/src/lib/ecore_wince/ecore_wince_event.c +++ b/src/lib/ecore_wince/ecore_wince_event.c @@ -49,7 +49,8 @@ static int _ecore_wince_event_char_get(int key, /***** Global functions *****/ void -_ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg) +_ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg, + int is_keystroke) { Ecore_WinCE_Event_Key_Down *e; @@ -58,13 +59,27 @@ _ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg) e = (Ecore_WinCE_Event_Key_Down *)malloc(sizeof(Ecore_WinCE_Event_Key_Down)); if (!e) return; - if (!_ecore_wince_event_keystroke_get(LOWORD(msg->window_param), + if (is_keystroke) + { + if (!_ecore_wince_event_keystroke_get(LOWORD(msg->window_param), + &e->keyname, + &e->keysymbol, + &e->keycompose)) + { + free(e); + return; + } + } + else + { + if (!_ecore_wince_event_char_get(LOWORD(msg->window_param), &e->keyname, &e->keysymbol, &e->keycompose)) - { - free(e); - return; + { + free(e); + return; + } } e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA); @@ -81,7 +96,8 @@ _ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg) } void -_ecore_wince_event_handle_key_release(Ecore_WinCE_Callback_Data *msg) +_ecore_wince_event_handle_key_release(Ecore_WinCE_Callback_Data *msg, + int is_keystroke) { Ecore_WinCE_Event_Key_Up *e; @@ -90,13 +106,27 @@ _ecore_wince_event_handle_key_release(Ecore_WinCE_Callback_Data *msg) e = (Ecore_WinCE_Event_Key_Up *)calloc(1, sizeof(Ecore_WinCE_Event_Key_Up)); if (!e) return; - if (!_ecore_wince_event_keystroke_get(LOWORD(msg->window_param), + if (is_keystroke) + { + if (!_ecore_wince_event_keystroke_get(LOWORD(msg->window_param), + &e->keyname, + &e->keysymbol, + &e->keycompose)) + { + free(e); + return; + } + } + else + { + if (!_ecore_wince_event_char_get(LOWORD(msg->window_param), &e->keyname, &e->keysymbol, &e->keycompose)) - { - free(e); - return; + { + free(e); + return; + } } e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA); @@ -554,7 +584,7 @@ _ecore_wince_event_handle_delete_request(Ecore_WinCE_Callback_Data *msg) /***** Private functions definitions *****/ static void -_ecore_wince_event_free_key_down(void *data, +_ecore_wince_event_free_key_down(void *data __UNUSED__, void *ev) { Ecore_WinCE_Event_Key_Down *e; @@ -567,7 +597,7 @@ _ecore_wince_event_free_key_down(void *data, } static void -_ecore_wince_event_free_key_up(void *data, +_ecore_wince_event_free_key_up(void *data __UNUSED__, void *ev) { Ecore_WinCE_Event_Key_Up *e; @@ -766,6 +796,16 @@ _ecore_wince_event_keystroke_get(int key, ks = "F24"; kc = ""; break; + case VK_APPS: + kn = "Application"; + ks = "Application"; + kc = ""; + break; + case VK_MENU: + kn = "Menu"; + ks = "Menu"; + kc = ""; + break; default: /* other non keystroke characters */ return 0; diff --git a/src/lib/ecore_wince/ecore_wince_private.h b/src/lib/ecore_wince/ecore_wince_private.h index 85ad0f7..eedab27 100644 --- a/src/lib/ecore_wince/ecore_wince_private.h +++ b/src/lib/ecore_wince/ecore_wince_private.h @@ -49,8 +49,8 @@ extern Ecore_WinCE_Window *_ecore_wince_event_last_window; extern HINSTANCE _ecore_wince_instance; -void _ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg); -void _ecore_wince_event_handle_key_release(Ecore_WinCE_Callback_Data *msg); +void _ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg, int is_keystroke); +void _ecore_wince_event_handle_key_release(Ecore_WinCE_Callback_Data *msg, int is_keystroke); void _ecore_wince_event_handle_button_press(Ecore_WinCE_Callback_Data *msg, int button); void _ecore_wince_event_handle_button_release(Ecore_WinCE_Callback_Data *msg, int button); void _ecore_wince_event_handle_motion_notify(Ecore_WinCE_Callback_Data *msg);