Ecore_Win32_Window *window; /**< The window that received the event */
int x; /**< The x coordinate where the mouse leaved */
int y; /**< The y coordinate where the mouse entered */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
Ecore_Win32_Window *window; /**< The window that received the event */
int x; /**< The x coordinate where the mouse leaved */
int y; /**< The y coordinate where the mouse leaved */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
struct _Ecore_Win32_Event_Window_Focus_In
{
Ecore_Win32_Window *window; /**< The window that received the event */
- long long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
struct _Ecore_Win32_Event_Window_Focus_Out
{
Ecore_Win32_Window *window; /**< The window that received the event */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
int y; /**< The y coordinate of the top left corner of the damaged region */
int width; /**< The width of the damaged region */
int height; /**< The time the event occurred */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
struct _Ecore_Win32_Event_Window_Create
{
Ecore_Win32_Window *window; /**< The window that received the event */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
struct _Ecore_Win32_Event_Window_Destroy
{
Ecore_Win32_Window *window; /**< The window that received the event */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
struct _Ecore_Win32_Event_Window_Hide
{
Ecore_Win32_Window *window; /**< The window that received the event */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
struct _Ecore_Win32_Event_Window_Show
{
Ecore_Win32_Window *window; /**< The window that received the event */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
int y; /**< The new y coordinate of the top left corner */
int width; /**< The new width */
int height; /**< The new height */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
Ecore_Win32_Window *window; /**< The window that received the event */
int width; /**< The new width */
int height; /**< The new height */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
struct _Ecore_Win32_Event_Window_Delete_Request
{
Ecore_Win32_Window *window; /**< The window that received the event */
- long time; /**< The time the event occurred */
+ unsigned long timestamp; /**< The time the event occurred */
};
/**
/* Core */
-EAPI int ecore_win32_init();
-EAPI int ecore_win32_shutdown();
-EAPI int ecore_win32_screen_depth_get();
-EAPI void ecore_win32_double_click_time_set(double t);
-EAPI double ecore_win32_double_click_time_get(void);
-EAPI long ecore_win32_current_time_get(void);
+EAPI int ecore_win32_init();
+EAPI int ecore_win32_shutdown();
+EAPI int ecore_win32_screen_depth_get();
+EAPI void ecore_win32_double_click_time_set(double t);
+EAPI double ecore_win32_double_click_time_get(void);
+EAPI unsigned long ecore_win32_current_time_get(void);
/* Window */
data->message = message;
data->window_param = window_param;
data->data_param = data_param;
- data->time = GetMessageTime();
+ data->timestamp = GetMessageTime();
coord = GetMessagePos();
point = MAKEPOINTS(coord);
data->x = point.x;
data->y = point.y;
+ data->discard_ctrl = EINA_FALSE;
switch (data->message)
{
/* Keyboard input notifications */
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
- INF("keydown message");
+ if ((data->message == WM_KEYDOWN) &&
+ (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_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_KEYUP:
case WM_SYSKEYUP:
INF("keyup 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 press 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);
return 0;
case WM_SETFOCUS:
HINSTANCE _ecore_win32_instance = NULL;
double _ecore_win32_double_click_time = 0.25;
-long _ecore_win32_event_last_time = 0;
+unsigned long _ecore_win32_event_last_time = 0;
Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
int _ecore_win32_log_dom_global = -1;
*
* This function returns the last event time.
*/
-EAPI long
+EAPI unsigned long
ecore_win32_current_time_get(void)
{
return _ecore_win32_event_last_time;
static void _ecore_win32_event_free_key_up(void *data,
void *ev);
-static int _ecore_win32_event_keystroke_get(int key,
- int is_extended,
+static int _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
Eina_Bool is_down,
char **keyname,
char **keysymbol,
if (is_keystroke)
{
- if (!_ecore_win32_event_keystroke_get(msg->window_param,
- msg->data_param & 0x01000000,
+ if (!_ecore_win32_event_keystroke_get(msg,
EINA_TRUE,
(char **)&e->keyname,
(char **)&e->key,
return;
}
e->event_window = e->window;
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
_ecore_win32_event_last_time = e->timestamp;
e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key));
if (!e) return;
- if (!_ecore_win32_event_keystroke_get(LOWORD(msg->window_param),
- msg->data_param & 0x01000000,
+ if (!_ecore_win32_event_keystroke_get(msg,
EINA_FALSE,
(char **)&e->keyname,
(char **)&e->key,
(char **)&e->string,
&e->modifiers))
{
- if (!_ecore_win32_event_char_get(LOWORD(msg->window_param),
+ if (msg->discard_ctrl ||
+ !_ecore_win32_event_char_get(LOWORD(msg->window_param),
(char **)&e->keyname,
(char **)&e->key,
(char **)&e->string))
return;
}
e->event_window = e->window;
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
_ecore_win32_event_last_time = e->timestamp;
e->z = GET_WHEEL_DELTA_WPARAM(msg->window_param) > 0 ? -1 : 1;
e->x = GET_X_LPARAM(msg->data_param);
e->y = GET_Y_LPARAM(msg->data_param);
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
_ecore_win32_event_last_time = e->timestamp;
_ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
e->event_window = e->window;
e->x = GET_X_LPARAM(msg->data_param);
e->y = GET_Y_LPARAM(msg->data_param);
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
_ecore_win32_event_last_time = e->timestamp;
_ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
e->buttons = button;
e->x = GET_X_LPARAM(msg->data_param);
e->y = GET_Y_LPARAM(msg->data_param);
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
if (((e->timestamp - _ecore_win32_mouse_down_last_time) <= (unsigned long)(1000 * _ecore_win32_double_click_time)) &&
(e->window == (Ecore_Window)_ecore_win32_mouse_down_last_window))
e->event_window = e->window;
e->x = GET_X_LPARAM(msg->data_param);
e->y = GET_Y_LPARAM(msg->data_param);
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
_ecore_win32_event_last_time = e->timestamp;
_ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
e->buttons = button;
e->x = GET_X_LPARAM(msg->data_param);
e->y = GET_Y_LPARAM(msg->data_param);
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
_ecore_win32_mouse_up_count++;
e->event_window = e->window;
e->x = GET_X_LPARAM(msg->data_param);
e->y = GET_Y_LPARAM(msg->data_param);
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
}
e->event_window = e->window;
e->x = msg->x;
e->y = msg->y;
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
_ecore_win32_event_last_time = e->timestamp;
_ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
e->x = msg->x;
e->y = msg->y;
- e->time = msg->time ;
+ e->timestamp = msg->timestamp ;
- _ecore_win32_event_last_time = e->time;
+ _ecore_win32_event_last_time = e->timestamp;
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_IN, e, NULL, NULL);
}
e->event_window = e->window;
e->x = msg->x;
e->y = msg->y;
- e->timestamp = msg->time;
+ e->timestamp = msg->timestamp;
_ecore_win32_event_last_time = e->timestamp;
_ecore_win32_event_last_window = (Ecore_Win32_Window *)e->window;
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
e->x = msg->x;
e->y = msg->y;
- e->time = msg->time;
+ e->timestamp = msg->timestamp;
- _ecore_win32_event_last_time = e->time;
+ _ecore_win32_event_last_time = e->timestamp;
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_OUT, e, NULL, NULL);
}
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
- e->time = _ecore_win32_event_last_time;
- _ecore_win32_event_last_time = e->time;
+ e->timestamp = _ecore_win32_event_last_time;
+ _ecore_win32_event_last_time = e->timestamp;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_IN, e, NULL, NULL);
}
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
- e->time = _ecore_win32_event_last_time;
- _ecore_win32_event_last_time = e->time;
+ e->timestamp = _ecore_win32_event_last_time;
+ _ecore_win32_event_last_time = e->timestamp;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT, e, NULL, NULL);
}
e->width = msg->update.right - msg->update.left;
e->height = msg->update.bottom - msg->update.top;
- e->time = _ecore_win32_event_last_time;
+ e->timestamp = _ecore_win32_event_last_time;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DAMAGE, e, NULL, NULL);
}
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
- e->time = _ecore_win32_event_last_time;
+ e->timestamp = _ecore_win32_event_last_time;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CREATE, e, NULL, NULL);
}
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
- e->time = _ecore_win32_event_last_time;
+ e->timestamp = _ecore_win32_event_last_time;
if (e->window == _ecore_win32_event_last_window) _ecore_win32_event_last_window = NULL;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DESTROY, e, NULL, NULL);
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
- e->time = _ecore_win32_event_last_time;
+ e->timestamp = _ecore_win32_event_last_time;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_SHOW, e, NULL, NULL);
}
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
- e->time = _ecore_win32_event_last_time;
+ e->timestamp = _ecore_win32_event_last_time;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_HIDE, e, NULL, NULL);
}
e->y = wi.rcClient.top;
e->width = wi.rcClient.right - wi.rcClient.left;
e->height = wi.rcClient.bottom - wi.rcClient.top;
- e->time = _ecore_win32_event_last_time;
+ e->timestamp = _ecore_win32_event_last_time;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_CONFIGURE, e, NULL, NULL);
}
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
e->width = rect.right - rect.left;
e->height = rect.bottom - rect.top;
- e->time = _ecore_win32_event_last_time;
+ e->timestamp = _ecore_win32_event_last_time;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_RESIZE, e, NULL, NULL);
}
if (!e) return;
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
- e->time = _ecore_win32_event_last_time;
+ e->timestamp = _ecore_win32_event_last_time;
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST, e, NULL, NULL);
}
}
static int
-_ecore_win32_event_keystroke_get(int key,
- int is_extended,
+_ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
Eina_Bool is_down,
char **keyname,
char **keysymbol,
char *kn = NULL;
char *ks = NULL;
char *kc = NULL;
+ int key;
+ int is_extended;
+
+ key = msg->window_param;
+ is_extended = msg->data_param & 0x01000000;
*keyname = NULL;
*keysymbol = NULL;
*keycompose = NULL;
-
- printf("vk key 0x%x\n", key);
switch (key)
{
/* Keystroke */
}
break;
case VK_RIGHT:
- printf("vk val 0x%x (right)\n", VK_RIGHT);
if (is_extended)
{
kn = "Right";
{
SHORT res;
+ if (msg->discard_ctrl)
+ return 0;
+
if (is_down)
{
res = GetKeyState(VK_LCONTROL);
return 0;
}
- printf("sortie...\n");
*keyname = strdup(kn);
if (!*keyname) return 0;
*keysymbol = strdup(ks);
return 0;
}
}
- printf("sortie 2 ...\n");
return 1;
}
*keysymbol = NULL;
*keycompose = NULL;
- printf("char key 0x%x\n", key);
-
switch (key)
{
case VK_PROCESSKEY:
break;
default:
/* displayable characters */
- printf (" * key : %d\n", key);
buf[0] = key;
buf[1] = '\0';
kn = buf;