void GLWindow::ProcessEvents() { FUNCLOG #ifdef USE_GSOPEN2 GetWindowSize(); #else ResizeCheck(); #endif if (THR_KeyEvent) // This value was passed from GSKeyEvents which could be in another thread { int my_KeyEvent = THR_KeyEvent; bool my_bShift = THR_bShift; bool my_bCtrl = THR_bCtrl; THR_KeyEvent = 0; switch (my_KeyEvent) { case XK_F5: case XK_F6: case XK_F7: case XK_F9: // Note: to avoid some clash with PCSX2 shortcut in GSOpen2. // GS shortcut will only be activated when ctrl is press if (my_bCtrl) OnFKey(my_KeyEvent - XK_F1 + 1, my_bShift); break; } } }
void ProcessEvents() { FUNCLOG // check resizing GLWin.ResizeCheck(); if (THR_KeyEvent) // This value was passed from GSKeyEvents which could be in another thread { int my_KeyEvent = THR_KeyEvent; bool my_bShift = THR_bShift; THR_KeyEvent = 0; switch (my_KeyEvent) { case XK_F5: case XK_F6: case XK_F7: case XK_F9: OnFKey(my_KeyEvent - XK_F1 + 1, my_bShift); break; } } }
void GLWindow::ProcessEvents() { MSG msg; ZeroMemory(&msg, sizeof(msg)); while (1) { if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE)) { switch (msg.message) { case WM_KEYDOWN : int my_KeyEvent = msg.wParam; bool my_bShift = !!(GetKeyState(VK_SHIFT) & 0x8000); switch (msg.wParam) { case VK_F5: case VK_F6: case VK_F7: case VK_F9: OnFKey(msg.wParam - VK_F1 + 1, my_bShift); break; case VK_ESCAPE: if (conf.fullscreen()) { // destroy that msg conf.setFullscreen(false); ChangeDeviceSize(conf.width, conf.height); UpdateWindow(GShwnd); continue; // so that msg doesn't get sent } else { SendMessage(GShwnd, WM_DESTROY, 0, 0); return; } break; } break; } TranslateMessage(&msg); DispatchMessage(&msg); } else { break; } } if ((GetKeyState(VK_MENU) & 0x8000) && (GetKeyState(VK_RETURN) & 0x8000)) { conf.zz_options.fullscreen = !conf.zz_options.fullscreen; SetDeviceSize( (conf.fullscreen()) ? 1280 : conf.width, (conf.fullscreen()) ? 960 : conf.height); } }