diff --git a/src/gui/CemuApp.cpp b/src/gui/CemuApp.cpp index f48957df..4acc1cf5 100644 --- a/src/gui/CemuApp.cpp +++ b/src/gui/CemuApp.cpp @@ -191,7 +191,6 @@ int CemuApp::FilterEvent(wxEvent& event) if(event.GetEventType() == wxEVT_KEY_DOWN) { const auto& key_event = (wxKeyEvent&)event; - wxGetKeyState(wxKeyCode::WXK_F17); g_window_info.set_keystate(fix_raw_keycode(key_event.GetRawKeyCode(), key_event.GetRawKeyFlags()), true); } else if(event.GetEventType() == wxEVT_KEY_UP) diff --git a/src/gui/guiWrapper.h b/src/gui/guiWrapper.h index dd77819c..ec94c1a0 100644 --- a/src/gui/guiWrapper.h +++ b/src/gui/guiWrapper.h @@ -41,18 +41,22 @@ enum struct PlatformKeyCodes : uint32 LCONTROL = VK_LCONTROL, RCONTROL = VK_RCONTROL, TAB = VK_TAB, + ESCAPE = VK_ESCAPE, #elif BOOST_OS_LINUX LCONTROL = GDK_KEY_Control_L, RCONTROL = GDK_KEY_Control_R, TAB = GDK_KEY_Tab, + ESCAPE = GDK_KEY_Escape, #elif BOOST_OS_MACOS LCONTROL = kVK_Control, RCONTROL = kVK_RightControl, TAB = kVK_Tab, + ESCAPE = kVK_Escape, #else LCONTROL = 0, RCONTROL = 0, TAB = 0, + ESCAPE = 0, #endif }; diff --git a/src/gui/input/panels/InputPanel.cpp b/src/gui/input/panels/InputPanel.cpp index 6c1b8dda..514461fd 100644 --- a/src/gui/input/panels/InputPanel.cpp +++ b/src/gui/input/panels/InputPanel.cpp @@ -1,3 +1,4 @@ +#include "gui/guiWrapper.h" #include "gui/input/panels/InputPanel.h" #include @@ -26,7 +27,7 @@ void InputPanel::on_timer(const EmulatedControllerPtr& emulated_controller, cons const auto mapping = reinterpret_cast(element->GetClientData()); // reset mapping - if(std::exchange(m_right_down, false) || wxGetKeyState(WXK_ESCAPE)) + if(std::exchange(m_right_down, false) || gui_isKeyDown(PlatformKeyCodes::ESCAPE)) { element->SetBackgroundColour(kKeyColourNormalMode); m_color_backup[element->GetId()] = kKeyColourNormalMode;