aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_win32/ecore_win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_win32/ecore_win32.c')
-rw-r--r--libraries/ecore/src/lib/ecore_win32/ecore_win32.c61
1 files changed, 57 insertions, 4 deletions
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32.c b/libraries/ecore/src/lib/ecore_win32/ecore_win32.c
index 19ca3ed..b571d74 100644
--- a/libraries/ecore/src/lib/ecore_win32/ecore_win32.c
+++ b/libraries/ecore/src/lib/ecore_win32/ecore_win32.c
@@ -73,18 +73,44 @@ _ecore_win32_window_procedure(HWND window,
73 data->message = message; 73 data->message = message;
74 data->window_param = window_param; 74 data->window_param = window_param;
75 data->data_param = data_param; 75 data->data_param = data_param;
76 data->time = GetMessageTime(); 76 data->timestamp = GetMessageTime();
77 coord = GetMessagePos(); 77 coord = GetMessagePos();
78 point = MAKEPOINTS(coord); 78 point = MAKEPOINTS(coord);
79 data->x = point.x; 79 data->x = point.x;
80 data->y = point.y; 80 data->y = point.y;
81 data->discard_ctrl = EINA_FALSE;
81 82
82 switch (data->message) 83 switch (data->message)
83 { 84 {
84 /* Keyboard input notifications */ 85 /* Keyboard input notifications */
85 case WM_KEYDOWN: 86 case WM_KEYDOWN:
86 case WM_SYSKEYDOWN: 87 case WM_SYSKEYDOWN:
87 INF("keydown message"); 88 if ((data->message == WM_KEYDOWN) &&
89 (data->window_param == VK_CONTROL) &&
90 ((HIWORD(data->data_param) & KF_EXTENDED) == 0))
91 {
92 /* Ctrl left key is pressed */
93 BOOL res;
94 MSG next_msg;
95
96 /*
97 * we check if the next message
98 * - is a WM_KEYDOWN
99 * - has the same timestamp than the Ctrl one
100 * - is the key press of the right Alt key
101 */
102 res = PeekMessage(&next_msg, data->window,
103 WM_KEYDOWN, WM_KEYDOWN,
104 PM_NOREMOVE);
105 if (res &&
106 (next_msg.wParam == VK_MENU) &&
107 (next_msg.time == data->timestamp) &&
108 (HIWORD(next_msg.lParam) & KF_EXTENDED))
109 {
110 INF("discard left Ctrl key press (sent by AltGr key press)");
111 data->discard_ctrl = EINA_TRUE;
112 }
113 }
88 _ecore_win32_event_handle_key_press(data, 1); 114 _ecore_win32_event_handle_key_press(data, 1);
89 return 0; 115 return 0;
90 case WM_CHAR: 116 case WM_CHAR:
@@ -95,6 +121,33 @@ _ecore_win32_window_procedure(HWND window,
95 case WM_KEYUP: 121 case WM_KEYUP:
96 case WM_SYSKEYUP: 122 case WM_SYSKEYUP:
97 INF("keyup message"); 123 INF("keyup message");
124 if ((data->window_param == VK_CONTROL) &&
125 ((HIWORD(data->data_param) & KF_EXTENDED) == 0))
126 {
127 /* Ctrl left key is pressed */
128 BOOL res;
129 MSG next_msg;
130
131 /*
132 * we check if the next message
133 * - is a WM_KEYUP or WM_SYSKEYUP
134 * - has the same timestamp than the Ctrl one
135 * - is the key release of the right Alt key
136 */
137 res = PeekMessage(&next_msg, data->window,
138 WM_KEYUP, WM_SYSKEYUP,
139 PM_NOREMOVE);
140 if (res &&
141 ((next_msg.message == WM_KEYUP) ||
142 (next_msg.message == WM_SYSKEYUP)) &&
143 (next_msg.wParam == VK_MENU) &&
144 (next_msg.time == data->timestamp) &&
145 (HIWORD(next_msg.lParam) & KF_EXTENDED))
146 {
147 INF("discard left Ctrl key release (sent by AltGr key release)");
148 data->discard_ctrl = EINA_TRUE;
149 }
150 }
98 _ecore_win32_event_handle_key_release(data); 151 _ecore_win32_event_handle_key_release(data);
99 return 0; 152 return 0;
100 case WM_SETFOCUS: 153 case WM_SETFOCUS:
@@ -492,7 +545,7 @@ _ecore_win32_window_procedure(HWND window,
492 545
493HINSTANCE _ecore_win32_instance = NULL; 546HINSTANCE _ecore_win32_instance = NULL;
494double _ecore_win32_double_click_time = 0.25; 547double _ecore_win32_double_click_time = 0.25;
495long _ecore_win32_event_last_time = 0; 548unsigned long _ecore_win32_event_last_time = 0;
496Ecore_Win32_Window *_ecore_win32_event_last_window = NULL; 549Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
497int _ecore_win32_log_dom_global = -1; 550int _ecore_win32_log_dom_global = -1;
498 551
@@ -777,7 +830,7 @@ ecore_win32_double_click_time_get(void)
777 * 830 *
778 * This function returns the last event time. 831 * This function returns the last event time.
779 */ 832 */
780EAPI long 833EAPI unsigned long
781ecore_win32_current_time_get(void) 834ecore_win32_current_time_get(void)
782{ 835{
783 return _ecore_win32_event_last_time; 836 return _ecore_win32_event_last_time;