mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
Release all keyboard keys on focus loss (fixes #1987)
This commit is contained in:
@ -128,6 +128,11 @@ void KeyRelease(QKeyEvent* event)
|
|||||||
KeyHotkeyMask &= ~(1<<i);
|
KeyHotkeyMask &= ~(1<<i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KeyReleaseAll()
|
||||||
|
{
|
||||||
|
KeyInputMask = 0xFFF;
|
||||||
|
KeyHotkeyMask = 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool JoystickButtonDown(int val)
|
bool JoystickButtonDown(int val)
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,7 @@ void CloseJoystick();
|
|||||||
|
|
||||||
void KeyPress(QKeyEvent* event);
|
void KeyPress(QKeyEvent* event);
|
||||||
void KeyRelease(QKeyEvent* event);
|
void KeyRelease(QKeyEvent* event);
|
||||||
|
void KeyReleaseAll();
|
||||||
|
|
||||||
void Process();
|
void Process();
|
||||||
|
|
||||||
|
@ -916,6 +916,7 @@ void MainWindow::onAppStateChanged(Qt::ApplicationState state)
|
|||||||
{
|
{
|
||||||
if (state == Qt::ApplicationInactive)
|
if (state == Qt::ApplicationInactive)
|
||||||
{
|
{
|
||||||
|
Input::KeyReleaseAll();
|
||||||
if (Config::PauseLostFocus && emuThread->emuIsRunning())
|
if (Config::PauseLostFocus && emuThread->emuIsRunning())
|
||||||
emuThread->emuPause();
|
emuThread->emuPause();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user