Avoid wxGetKeyState since it asserts on Linux with wayland GTK

Only modifier keys are allowed, but we used it to test for Escape
This commit is contained in:
Exzap 2023-10-17 13:06:36 +02:00
parent c440ecdf36
commit 66711529be
3 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,4 @@
#include "gui/guiWrapper.h"
#include "gui/input/panels/InputPanel.h"
#include <wx/textctrl.h>
@ -26,7 +27,7 @@ void InputPanel::on_timer(const EmulatedControllerPtr& emulated_controller, cons
const auto mapping = reinterpret_cast<uint64>(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;