void GSPanel::OnKeyDown( wxKeyEvent& evt ) { // HACK: Legacy PAD plugins expect PCSX2 to ignore keyboard messages on the GS Window while // the PAD plugin is open, so ignore here (PCSX2 will direct messages routed from PAD directly // to the APP level message handler, which in turn routes them right back here -- yes it's // silly, but oh well). #ifdef __linux__ // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event; event.key = evt.GetRawKeyCode(); if (evt.GetEventType() == wxEVT_KEY_UP) event.evt = 3; // X equivalent of KEYRELEASE; else if (evt.GetEventType() == wxEVT_KEY_DOWN) event.evt = 2; // X equivalent of KEYPRESS; else event.evt = 0; PADWriteEvent(event); } #endif if( (PADopen != NULL) && CoreThread.IsOpen() ) return; DirectKeyCommand( evt ); }
void GSPanel::OnLeftDclick(wxMouseEvent& evt) { if( !g_Conf->GSWindow.IsToggleFullscreenOnDoubleClick ) return; //Console.WriteLn("GSPanel::OnDoubleClick: Invoking Fullscreen-Toggle accelerator."); DirectKeyCommand(FULLSCREEN_TOGGLE_ACCELERATOR_GSPANEL); }
void GSPanel::OnKeyDownOrUp( wxKeyEvent& evt ) { // HACK: Legacy PAD plugins expect PCSX2 to ignore keyboard messages on the GS Window while // the PAD plugin is open, so ignore here (PCSX2 will direct messages routed from PAD directly // to the APP level message handler, which in turn routes them right back here -- yes it's // silly, but oh well). #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event; event.key = evt.GetRawKeyCode(); if (evt.GetEventType() == wxEVT_KEY_UP) event.evt = 3; // X equivalent of KEYRELEASE; else if (evt.GetEventType() == wxEVT_KEY_DOWN) event.evt = 2; // X equivalent of KEYPRESS; else event.evt = 0; PADWriteEvent(event); } #endif #ifdef __WXMSW__ // Not sure what happens on Linux, but on windows this method is called only when emulation // is paused and the GS window is not hidden (and therefore the event doesn't arrive from // the pad plugin and doesn't go through Pcsx2App::PadKeyDispatch). On such case (paused). // It needs to handle two issues: // 1. It's called both for key down and key up (linux apparently needs it this way) - but we // don't want to execute the command twice (normally commands execute on key down only). // 2. It has wx keycode which is upper case for ascii chars, but our command handlers expect // lower case for non-special keys. // ignore key up events if (evt.GetEventType() == wxEVT_KEY_UP) return; // Make ascii keys lower case - this apparently works correctly also with modifiers (shift included) if (evt.m_keyCode >= 'A' && evt.m_keyCode <= 'Z') evt.m_keyCode += (int)'a' - 'A'; #endif if( (PADopen != NULL) && CoreThread.IsOpen() ) return; DirectKeyCommand( evt ); }
void GSPanel::DirectKeyCommand( wxKeyEvent& evt ) { DirectKeyCommand(KeyAcceleratorCode( evt )); }