Release all keyboard keys on focus loss (fixes #1987)
This commit is contained in:
parent
21e2a876ec
commit
67ca4997e2
|
@ -128,6 +128,11 @@ void KeyRelease(QKeyEvent* event)
|
|||
KeyHotkeyMask &= ~(1<<i);
|
||||
}
|
||||
|
||||
void KeyReleaseAll()
|
||||
{
|
||||
KeyInputMask = 0xFFF;
|
||||
KeyHotkeyMask = 0;
|
||||
}
|
||||
|
||||
bool JoystickButtonDown(int val)
|
||||
{
|
||||
|
|
|
@ -40,6 +40,7 @@ void CloseJoystick();
|
|||
|
||||
void KeyPress(QKeyEvent* event);
|
||||
void KeyRelease(QKeyEvent* event);
|
||||
void KeyReleaseAll();
|
||||
|
||||
void Process();
|
||||
|
||||
|
|
|
@ -916,6 +916,7 @@ void MainWindow::onAppStateChanged(Qt::ApplicationState state)
|
|||
{
|
||||
if (state == Qt::ApplicationInactive)
|
||||
{
|
||||
Input::KeyReleaseAll();
|
||||
if (Config::PauseLostFocus && emuThread->emuIsRunning())
|
||||
emuThread->emuPause();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue