forked from enlightenment/efl
ecore_win32: fix key events on Windows.
@fix Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This commit is contained in:
parent
836c0535f0
commit
113d794973
|
@ -22,7 +22,8 @@ lib/ecore_win32/ecore_win32_private.h \
|
||||||
lib/ecore_win32/ecore_win32_dnd_enumformatetc.h \
|
lib/ecore_win32/ecore_win32_dnd_enumformatetc.h \
|
||||||
lib/ecore_win32/ecore_win32_dnd_data_object.h \
|
lib/ecore_win32/ecore_win32_dnd_data_object.h \
|
||||||
lib/ecore_win32/ecore_win32_dnd_drop_source.h \
|
lib/ecore_win32/ecore_win32_dnd_drop_source.h \
|
||||||
lib/ecore_win32/ecore_win32_dnd_drop_target.h
|
lib/ecore_win32/ecore_win32_dnd_drop_target.h \
|
||||||
|
ecore_win32_keysym_table.h
|
||||||
|
|
||||||
lib_ecore_win32_libecore_win32_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WIN32_CFLAGS@
|
lib_ecore_win32_libecore_win32_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WIN32_CFLAGS@
|
||||||
lib_ecore_win32_libecore_win32_la_LIBADD = @ECORE_WIN32_LIBS@
|
lib_ecore_win32_libecore_win32_la_LIBADD = @ECORE_WIN32_LIBS@
|
||||||
|
|
|
@ -223,6 +223,7 @@ struct _Ecore_Win32_Event_Mouse_In
|
||||||
int x; /**< The x coordinate where the mouse leaved */
|
int x; /**< The x coordinate where the mouse leaved */
|
||||||
int y; /**< The y coordinate where the mouse entered */
|
int y; /**< The y coordinate where the mouse entered */
|
||||||
unsigned long timestamp; /**< The time the event occurred */
|
unsigned long timestamp; /**< The time the event occurred */
|
||||||
|
unsigned int modifiers; /**< The keyboard modifiers */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -235,6 +236,7 @@ struct _Ecore_Win32_Event_Mouse_Out
|
||||||
int x; /**< The x coordinate where the mouse leaved */
|
int x; /**< The x coordinate where the mouse leaved */
|
||||||
int y; /**< The y coordinate where the mouse leaved */
|
int y; /**< The y coordinate where the mouse leaved */
|
||||||
unsigned long timestamp; /**< The time the event occurred */
|
unsigned long timestamp; /**< The time the event occurred */
|
||||||
|
unsigned int modifiers; /**< The keyboard modifiers */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -76,76 +76,20 @@ _ecore_win32_window_procedure(HWND window,
|
||||||
coord = GetMessagePos();
|
coord = GetMessagePos();
|
||||||
data->x = GET_X_LPARAM(coord);
|
data->x = GET_X_LPARAM(coord);
|
||||||
data->y = GET_Y_LPARAM(coord);
|
data->y = GET_Y_LPARAM(coord);
|
||||||
data->discard_ctrl = EINA_FALSE;
|
|
||||||
|
|
||||||
switch (data->message)
|
switch (data->message)
|
||||||
{
|
{
|
||||||
/* Keyboard input notifications */
|
/* Keyboard input notifications */
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
case WM_SYSKEYDOWN:
|
case WM_SYSKEYDOWN:
|
||||||
if ((data->message == WM_KEYDOWN) &&
|
INF("key down message");
|
||||||
(data->window_param == VK_CONTROL) &&
|
_ecore_win32_event_handle_key_press(data);
|
||||||
((HIWORD(data->data_param) & KF_EXTENDED) == 0))
|
|
||||||
{
|
|
||||||
/* Ctrl left key is pressed */
|
|
||||||
BOOL res;
|
|
||||||
MSG next_msg;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* we check if the next message
|
|
||||||
* - is a WM_KEYDOWN
|
|
||||||
* - has the same timestamp than the Ctrl one
|
|
||||||
* - is the key press of the right Alt key
|
|
||||||
*/
|
|
||||||
res = PeekMessage(&next_msg, data->window,
|
|
||||||
WM_KEYDOWN, WM_KEYDOWN,
|
|
||||||
PM_NOREMOVE);
|
|
||||||
if (res &&
|
|
||||||
(next_msg.wParam == VK_MENU) &&
|
|
||||||
(next_msg.time == data->timestamp) &&
|
|
||||||
(HIWORD(next_msg.lParam) & KF_EXTENDED))
|
|
||||||
{
|
|
||||||
INF("discard left Ctrl key press (sent by AltGr key press)");
|
|
||||||
data->discard_ctrl = EINA_TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ecore_win32_event_handle_key_press(data, 1);
|
|
||||||
return 0;
|
|
||||||
case WM_CHAR:
|
|
||||||
case WM_SYSCHAR:
|
|
||||||
INF("char message");
|
|
||||||
_ecore_win32_event_handle_key_press(data, 0);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
/* case WM_CHAR: */
|
||||||
|
/* case WM_SYSCHAR: */
|
||||||
case WM_KEYUP:
|
case WM_KEYUP:
|
||||||
case WM_SYSKEYUP:
|
case WM_SYSKEYUP:
|
||||||
INF("key up message");
|
INF("key up message");
|
||||||
if ((data->window_param == VK_CONTROL) &&
|
|
||||||
((HIWORD(data->data_param) & KF_EXTENDED) == 0))
|
|
||||||
{
|
|
||||||
/* Ctrl left key is pressed */
|
|
||||||
BOOL res;
|
|
||||||
MSG next_msg;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* we check if the next message
|
|
||||||
* - is a WM_KEYUP or WM_SYSKEYUP
|
|
||||||
* - has the same timestamp than the Ctrl one
|
|
||||||
* - is the key release of the right Alt key
|
|
||||||
*/
|
|
||||||
res = PeekMessage(&next_msg, data->window,
|
|
||||||
WM_KEYUP, WM_SYSKEYUP,
|
|
||||||
PM_NOREMOVE);
|
|
||||||
if (res &&
|
|
||||||
((next_msg.message == WM_KEYUP) ||
|
|
||||||
(next_msg.message == WM_SYSKEYUP)) &&
|
|
||||||
(next_msg.wParam == VK_MENU) &&
|
|
||||||
(next_msg.time == data->timestamp) &&
|
|
||||||
(HIWORD(next_msg.lParam) & KF_EXTENDED))
|
|
||||||
{
|
|
||||||
INF("discard left Ctrl key release (sent by AltGr key release)");
|
|
||||||
data->discard_ctrl = EINA_TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ecore_win32_event_handle_key_release(data);
|
_ecore_win32_event_handle_key_release(data);
|
||||||
return 0;
|
return 0;
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -57,7 +57,6 @@ struct _Ecore_Win32_Callback_Data
|
||||||
unsigned long timestamp;
|
unsigned long timestamp;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
Eina_Bool discard_ctrl;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Ecore_Win32_Window
|
struct _Ecore_Win32_Window
|
||||||
|
@ -135,7 +134,7 @@ extern unsigned long _ecore_win32_event_last_time;
|
||||||
extern Ecore_Win32_Window *_ecore_win32_event_last_window;
|
extern Ecore_Win32_Window *_ecore_win32_event_last_window;
|
||||||
|
|
||||||
|
|
||||||
void _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg, int is_keystroke);
|
void _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg);
|
||||||
void _ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg);
|
void _ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg);
|
||||||
void _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg, int button);
|
void _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg, int button);
|
||||||
void _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg, int button);
|
void _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg, int button);
|
||||||
|
|
Loading…
Reference in New Issue