Ecore_Win32/WinCE: do not autorepeat Ctrl, Shift and Alt keys
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 26 Mar 2012 06:31:39 +0000 (06:31 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 26 Mar 2012 06:31:39 +0000 (06:31 +0000)
Patch by Shinwoo Kim

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@69628 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
NEWS
src/lib/ecore_win32/ecore_win32_event.c
src/lib/ecore_wince/ecore_wince_event.c

index dc855e0..6187370 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        to match ecore_x API.
        * Add ecore_wince_window_focus(), ecore_wince_window_focus_get()
        and ecore_win32_window_focus_get().
+
+2012-03-26  Shinwoo Kim
+
+        * Do not autorepeat Ctrl, Shift and Alt keys on Windows
+
diff --git a/NEWS b/NEWS
index 22fd7a7..5d4ed62 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,8 @@ Fixes:
      - prevent double free that could cause crash when an Ecore_Thread stop.
     * ecore_x:
      - ecore_x_randr_modes_info_get does not cut off the trailing '\0' anymore.
+    * ecore_win32/wince:
+     - do not autorepeat Ctrl, Shift and Alt keys
 
 Improvements:
     * ecore:
index 388776c..348aaff 100644 (file)
@@ -660,9 +660,11 @@ _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
   char *kc = NULL;
   int key;
   int is_extended;
+  int previous_key_state;
 
   key = msg->window_param;
   is_extended = msg->data_param & 0x01000000;
+  previous_key_state = msg->data_param & 0x40000000;
 
   *keyname = NULL;
   *keysymbol = NULL;
@@ -817,6 +819,7 @@ _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
 
           if (is_down)
             {
+               if (previous_key_state) return 0;
                res = GetKeyState(VK_LSHIFT);
                if (res & 0x8000)
                  {
@@ -868,6 +871,7 @@ _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
 
           if (is_down)
             {
+               if (previous_key_state) return 0;
                res = GetKeyState(VK_LCONTROL);
                if (res & 0x8000)
                  {
@@ -920,6 +924,7 @@ _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
 
           if (is_down)
             {
+               if (previous_key_state) return 0;
                res = GetKeyState(VK_LMENU);
                if (res & 0x8000)
                  {
index 41c355b..f4c0a2a 100644 (file)
@@ -77,6 +77,9 @@ _ecore_wince_event_keystroke_get(int       key,
   char *kn;
   char *ks;
   char *kc;
+  int previous_key_state;
+
+  previous_key_state = msg->data_param & 0x40000000;
 
   *keyname = NULL;
   *keysymbol = NULL;
@@ -269,6 +272,7 @@ _ecore_wince_event_keystroke_get(int       key,
 
           if (is_down)
             {
+               if (previous_key_state) return 0;
                res = GetKeyState(VK_LSHIFT);
                if (res & 0x8000)
                  {
@@ -315,6 +319,7 @@ _ecore_wince_event_keystroke_get(int       key,
 
           if (is_down)
             {
+               if (previous_key_state) return 0;
                res = GetKeyState(VK_LCONTROL);
                if (res & 0x8000)
                  {
@@ -365,6 +370,7 @@ _ecore_wince_event_keystroke_get(int       key,
 
           if (is_down)
             {
+               if (previous_key_state) return 0;
                res = GetKeyState(VK_LMENU);
                if (res & 0x8000)
                  {