qt: Capture fullscreen shortcuts on Windows raw input, fixes #3434

This commit is contained in:
RichardG867
2023-07-22 17:17:39 -03:00
parent eac6055103
commit 68382ff1b3
3 changed files with 27 additions and 14 deletions

View File

@@ -1249,11 +1249,7 @@ MainWindow::keyPressEvent(QKeyEvent *event)
#endif
}
if (!fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit())
fs_off_signal = true;
if (!fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter())
fs_on_signal = true;
checkFullscreenHotkey(true);
if (keyboard_ismsexit())
plat_mouse_capture(0);
@@ -1289,15 +1285,7 @@ MainWindow::keyReleaseEvent(QKeyEvent *event)
}
}
if (fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit()) {
ui->actionFullscreen->trigger();
fs_off_signal = false;
}
if (fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter()) {
ui->actionFullscreen->trigger();
fs_on_signal = false;
}
checkFullscreenHotkey(false);
if (!send_keyboard_input || event->isAutoRepeat())
return;
@@ -1309,6 +1297,28 @@ MainWindow::keyReleaseEvent(QKeyEvent *event)
#endif
}
void
MainWindow::checkFullscreenHotkey(bool down)
{
if (down) {
if (!fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit())
fs_off_signal = true;
if (!fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter())
fs_on_signal = true;
} else {
if (fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit()) {
ui->actionFullscreen->trigger();
fs_off_signal = false;
}
if (fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter()) {
ui->actionFullscreen->trigger();
fs_on_signal = false;
}
}
}
QSize
MainWindow::getRenderWidgetSize()
{