qt: Capture fullscreen shortcuts on Windows raw input, fixes #3434
This commit is contained in:
@@ -1249,11 +1249,7 @@ MainWindow::keyPressEvent(QKeyEvent *event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit())
|
checkFullscreenHotkey(true);
|
||||||
fs_off_signal = true;
|
|
||||||
|
|
||||||
if (!fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter())
|
|
||||||
fs_on_signal = true;
|
|
||||||
|
|
||||||
if (keyboard_ismsexit())
|
if (keyboard_ismsexit())
|
||||||
plat_mouse_capture(0);
|
plat_mouse_capture(0);
|
||||||
@@ -1289,15 +1285,7 @@ MainWindow::keyReleaseEvent(QKeyEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fs_off_signal && (video_fullscreen > 0) && keyboard_isfsexit()) {
|
checkFullscreenHotkey(false);
|
||||||
ui->actionFullscreen->trigger();
|
|
||||||
fs_off_signal = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fs_on_signal && (video_fullscreen == 0) && keyboard_isfsenter()) {
|
|
||||||
ui->actionFullscreen->trigger();
|
|
||||||
fs_on_signal = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!send_keyboard_input || event->isAutoRepeat())
|
if (!send_keyboard_input || event->isAutoRepeat())
|
||||||
return;
|
return;
|
||||||
@@ -1309,6 +1297,28 @@ MainWindow::keyReleaseEvent(QKeyEvent *event)
|
|||||||
#endif
|
#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
|
QSize
|
||||||
MainWindow::getRenderWidgetSize()
|
MainWindow::getRenderWidgetSize()
|
||||||
{
|
{
|
||||||
|
@@ -32,6 +32,7 @@ public:
|
|||||||
void blitToWidget(int x, int y, int w, int h, int monitor_index);
|
void blitToWidget(int x, int y, int w, int h, int monitor_index);
|
||||||
QSize getRenderWidgetSize();
|
QSize getRenderWidgetSize();
|
||||||
void setSendKeyboardInput(bool enabled);
|
void setSendKeyboardInput(bool enabled);
|
||||||
|
void checkFullscreenHotkey(bool down);
|
||||||
|
|
||||||
std::array<std::unique_ptr<RendererStack>, 8> renderers;
|
std::array<std::unique_ptr<RendererStack>, 8> renderers;
|
||||||
signals:
|
signals:
|
||||||
|
@@ -237,6 +237,8 @@ WindowsRawInputFilter::keyboard_handle(PRAWINPUT raw)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window->checkFullscreenHotkey(!(rawKB.Flags & RI_KEY_BREAK));
|
||||||
|
|
||||||
/* Translate right CTRL to left ALT if the user has so
|
/* Translate right CTRL to left ALT if the user has so
|
||||||
chosen. */
|
chosen. */
|
||||||
if ((scancode == 0x11d) && rctrl_is_lalt)
|
if ((scancode == 0x11d) && rctrl_is_lalt)
|
||||||
|
Reference in New Issue
Block a user