Pārlūkot izejas kodu

fix alt key again

cxgeorge 23 gadi atpakaļ
vecāks
revīzija
7d24174f65

+ 9 - 0
panda/src/wdxdisplay/wdxGraphicsWindow.cxx

@@ -506,6 +506,15 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
     }
     }
     break;
     break;
 
 
+    case WM_SYSCOMMAND:
+        if(wparam==SC_KEYMENU) {
+            // if Alt is released (alone w/o other keys), defwindproc will send 
+            // this command, which will 'activate' the title bar menu (we have none)
+            // and give focus to it.  we dont want this to happen, so kill this msg
+            return 0;
+        }
+    break;
+
     case WM_KEYDOWN: {
     case WM_KEYDOWN: {
       POINT point;
       POINT point;
       GetCursorPos(&point);
       GetCursorPos(&point);

+ 9 - 0
panda/src/wdxdisplay8/wdxGraphicsWindow8.cxx

@@ -505,6 +505,15 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
           }
           }
         }
         }
         break;
         break;
+
+        case WM_SYSCOMMAND:
+          if(wparam==SC_KEYMENU) {
+              // if Alt is released (alone w/o other keys), defwindproc will send 
+              // this command, which will 'activate' the title bar menu (we have none)
+              // and give focus to it.  we dont want this to happen, so kill this msg
+              return 0;
+          }
+        break;
     
     
         case WM_KEYDOWN: {
         case WM_KEYDOWN: {
           POINT point;
           POINT point;

+ 9 - 0
panda/src/wgldisplay/wglGraphicsWindow.cxx

@@ -1817,6 +1817,15 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
     }
     }
     break;
     break;
 
 
+    case WM_SYSCOMMAND:
+      if(wparam==SC_KEYMENU) {
+          // if Alt is released (alone w/o other keys), defwindproc will send 
+          // this command, which will 'activate' the title bar menu (we have none)
+          // and give focus to it.  we dont want this to happen, so kill this msg
+          return 0;
+      }
+      break;
+
     case WM_KEYDOWN: {
     case WM_KEYDOWN: {
       POINT point;
       POINT point;