ecere/gui/X11: Fixed wrong 'key' value for Ctrl-Space
authorJerome St-Louis <jerome@ecere.com>
Mon, 26 Aug 2013 03:03:49 +0000 (23:03 -0400)
committerJerome St-Louis <jerome@ecere.com>
Mon, 26 Aug 2013 03:11:22 +0000 (23:11 -0400)
ecere/src/gui/drivers/XInterface.ec

index 8e61354..ac3a426 100644 (file)
@@ -740,11 +740,11 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
                int numBytes;
                ch = UTF8GetChar(buf + c, &numBytes);
                if(ch == 127) ch = 0;
-               if(!numBytes) c = buflength;
                result = window.KeyMessage((c == 0) ? 
                   __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown : __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit,
                   (c == 0) ? code : 0, ch);
                c += numBytes;
+               if(!numBytes) c = buflength;
             }
          }
          else
@@ -758,9 +758,9 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
                int numBytes;
                ch = UTF8GetChar(buf + c, &numBytes);
                if(ch == 127) ch = 0;
-               if(!numBytes) c = buflength;
                result = window.KeyMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit, code, ch);
                c += numBytes;
+               if(!numBytes) c = buflength;
             }
          else
             result = window.KeyMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit, code, ch);