浏览代码

Made panda window get focus for keyboard event in nested multi window mode

Gyedo Jeon 16 年之前
父节点
当前提交
cb63f15d15
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      panda/src/windisplay/winGraphicsWindow.cxx

+ 3 - 0
panda/src/windisplay/winGraphicsWindow.cxx

@@ -1174,6 +1174,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
         SetCapture(hwnd);
         _input_devices[0].set_pointer_in_window(translate_mouse(LOWORD(lparam)), translate_mouse(HIWORD(lparam)));
         _input_devices[0].button_down(MouseButton::button(0), get_message_time());
+        SetFocus(hwnd); // [gjeon] to get the keyboard event
         break;
         
       case WM_MBUTTONDOWN:
@@ -1183,6 +1184,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
         SetCapture(hwnd);
         _input_devices[0].set_pointer_in_window(translate_mouse(LOWORD(lparam)), translate_mouse(HIWORD(lparam)));
         _input_devices[0].button_down(MouseButton::button(1), get_message_time());
+        SetFocus(hwnd); // [gjeon] to get the keyboard event
         break;
 
       case WM_RBUTTONDOWN:
@@ -1192,6 +1194,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
         SetCapture(hwnd);
         _input_devices[0].set_pointer_in_window(translate_mouse(LOWORD(lparam)), translate_mouse(HIWORD(lparam)));
         _input_devices[0].button_down(MouseButton::button(2), get_message_time());
+        SetFocus(hwnd); // [gjeon] to get the keyboard event
         break;
 
       case WM_XBUTTONDOWN: