Enlightenment CVS committal

Author  : doursse
Project : e17
Module  : apps/expedite

Dir     : e17/apps/expedite/src/bin


Modified Files:
        engine_software_16_wince.c 


Log Message:
fix key up management

===================================================================
RCS file: /cvs/e/e17/apps/expedite/src/bin/engine_software_16_wince.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- engine_software_16_wince.c  10 May 2008 08:57:02 -0000      1.2
+++ engine_software_16_wince.c  12 May 2008 05:31:14 -0000      1.3
@@ -26,7 +26,8 @@
 } _GAPI_Key_List;
 
 
-static HWND window;
+static HINSTANCE instance = NULL;
+static HWND window = NULL;
 static int  backend = 0;
 static _GAPI_Key_List *key_list = NULL;
 
@@ -36,7 +37,7 @@
 static suspend _suspend = NULL;
 static resume _resume = NULL;
 
-void
+static void
 _wince_fb_key_down(WPARAM wParam)
 {
    int key;
@@ -67,7 +68,7 @@
      evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
 }
 
-void
+static void
 _wince_fb_key_up(WPARAM wParam)
 {
    int key;
@@ -90,8 +91,8 @@
      evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
 }
 
-void
-_wince_gapi_key(WPARAM wParam)
+static void
+_wince_gapi_key_down(WPARAM wParam)
 {
   if (wParam == (unsigned int)key_list->vkLeft)
     evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL);
@@ -105,6 +106,21 @@
      evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
 }
 
+static void
+_wince_gapi_key_up(WPARAM wParam)
+{
+  if (wParam == (unsigned int)key_list->vkLeft)
+    evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL);
+  if (wParam == (unsigned int)key_list->vkRight)
+     evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL);
+  if (wParam == (unsigned int)key_list->vkA)
+     evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL);
+  if (wParam == (unsigned int)key_list->vkB)
+     evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
+  if (wParam == (unsigned int)key_list->vkC)
+     evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
+}
+
 static LRESULT CALLBACK
 MainWndProc(HWND   hwnd,
             UINT   uMsg,
@@ -123,23 +139,19 @@
        ValidateRect(hwnd, NULL);
        return 0;
      case WM_KEYDOWN:
-     case WM_SYSKEYDOWN: {
-        if (backend == 1)
-          _wince_fb_key_down(wParam);
-        if (backend == 2)
-          _wince_gapi_key(wParam);
+       if (backend == 1)
+         _wince_fb_key_down(wParam);
+       if (backend == 2)
+         _wince_gapi_key_down(wParam);
 
-        return 0;
-     }
+       return 0;
      case WM_KEYUP:
-     case WM_SYSKEYUP: {
-        if (backend == 1)
-          _wince_fb_key_up(wParam);
-        if (backend == 2)
-          _wince_gapi_key(wParam);
+       if (backend == 1)
+         _wince_fb_key_up(wParam);
+       if (backend == 2)
+         _wince_gapi_key_up(wParam);
 
-        return 0;
-     }
+       return 0;
      case WM_KILLFOCUS:
        if (_suspend)
          _suspend (backend);
@@ -158,7 +170,6 @@
 {
    WNDCLASS                            wc;
    RECT                                rect;
-   HINSTANCE                           hinstance;
    Evas_Engine_Info_Software_16_WinCE *einfo;
    int                                 width;
    int                                 height;
@@ -182,14 +193,14 @@
      }
    if (!ok) return 0;
 
-   hinstance = GetModuleHandle(NULL);
+   instance = GetModuleHandle(NULL);
 
    memset (&wc, 0, sizeof (wc));
    wc.style = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc = MainWndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
-   wc.hInstance = hinstance;
+   wc.hInstance = instance;
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor (NULL, IDC_ARROW);
    wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
@@ -209,7 +220,7 @@
                            rect.left, rect.top,
                            rect.right - rect.left,
                            rect.bottom - rect.top,
-                           NULL, NULL, hinstance, NULL);
+                           NULL, NULL, instance, NULL);
    if (!window) return EXIT_FAILURE;
 
    SHFullScreen(window,



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to