forked from enlightenment/efl
add more keyboard support on Windows CE
SVN revision: 39238
This commit is contained in:
parent
648fa70e12
commit
5ea28a9f21
|
@ -232,14 +232,19 @@ _ecore_wince_window_procedure(HWND window,
|
||||||
switch (data->message)
|
switch (data->message)
|
||||||
{
|
{
|
||||||
/* Keyboard input notifications */
|
/* Keyboard input notifications */
|
||||||
|
case WM_CHAR:
|
||||||
|
_ecore_wince_event_handle_key_press(data, 0);
|
||||||
|
break;
|
||||||
case WM_HOTKEY:
|
case WM_HOTKEY:
|
||||||
_ecore_wince_event_handle_key_press(data);
|
_ecore_wince_event_handle_key_press(data, 1);
|
||||||
break;
|
break;
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
_ecore_wince_event_handle_key_press(data);
|
case WM_SYSKEYDOWN:
|
||||||
|
_ecore_wince_event_handle_key_press(data, 1);
|
||||||
break;
|
break;
|
||||||
case WM_KEYUP:
|
case WM_KEYUP:
|
||||||
_ecore_wince_event_handle_key_release(data);
|
case WM_SYSKEYUP:
|
||||||
|
_ecore_wince_event_handle_key_release(data, 1);
|
||||||
break;
|
break;
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
_ecore_wince_event_handle_focus_in(data);
|
_ecore_wince_event_handle_focus_in(data);
|
||||||
|
|
|
@ -49,7 +49,8 @@ static int _ecore_wince_event_char_get(int key,
|
||||||
/***** Global functions *****/
|
/***** Global functions *****/
|
||||||
|
|
||||||
void
|
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;
|
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));
|
e = (Ecore_WinCE_Event_Key_Down *)malloc(sizeof(Ecore_WinCE_Event_Key_Down));
|
||||||
if (!e) return;
|
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->keyname,
|
||||||
&e->keysymbol,
|
&e->keysymbol,
|
||||||
&e->keycompose))
|
&e->keycompose))
|
||||||
{
|
{
|
||||||
free(e);
|
free(e);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
|
e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
|
||||||
|
@ -81,7 +96,8 @@ _ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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;
|
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));
|
e = (Ecore_WinCE_Event_Key_Up *)calloc(1, sizeof(Ecore_WinCE_Event_Key_Up));
|
||||||
if (!e) return;
|
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->keyname,
|
||||||
&e->keysymbol,
|
&e->keysymbol,
|
||||||
&e->keycompose))
|
&e->keycompose))
|
||||||
{
|
{
|
||||||
free(e);
|
free(e);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e->window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
|
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 *****/
|
/***** Private functions definitions *****/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_wince_event_free_key_down(void *data,
|
_ecore_wince_event_free_key_down(void *data __UNUSED__,
|
||||||
void *ev)
|
void *ev)
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Event_Key_Down *e;
|
Ecore_WinCE_Event_Key_Down *e;
|
||||||
|
@ -567,7 +597,7 @@ _ecore_wince_event_free_key_down(void *data,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_wince_event_free_key_up(void *data,
|
_ecore_wince_event_free_key_up(void *data __UNUSED__,
|
||||||
void *ev)
|
void *ev)
|
||||||
{
|
{
|
||||||
Ecore_WinCE_Event_Key_Up *e;
|
Ecore_WinCE_Event_Key_Up *e;
|
||||||
|
@ -766,6 +796,16 @@ _ecore_wince_event_keystroke_get(int key,
|
||||||
ks = "F24";
|
ks = "F24";
|
||||||
kc = "";
|
kc = "";
|
||||||
break;
|
break;
|
||||||
|
case VK_APPS:
|
||||||
|
kn = "Application";
|
||||||
|
ks = "Application";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_MENU:
|
||||||
|
kn = "Menu";
|
||||||
|
ks = "Menu";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* other non keystroke characters */
|
/* other non keystroke characters */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -49,8 +49,8 @@ extern Ecore_WinCE_Window *_ecore_wince_event_last_window;
|
||||||
extern HINSTANCE _ecore_wince_instance;
|
extern HINSTANCE _ecore_wince_instance;
|
||||||
|
|
||||||
|
|
||||||
void _ecore_wince_event_handle_key_press(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);
|
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_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_button_release(Ecore_WinCE_Callback_Data *msg, int button);
|
||||||
void _ecore_wince_event_handle_motion_notify(Ecore_WinCE_Callback_Data *msg);
|
void _ecore_wince_event_handle_motion_notify(Ecore_WinCE_Callback_Data *msg);
|
||||||
|
|
Loading…
Reference in New Issue