qt: Keyboard input now works properly when mouse is uncaptured

This commit is contained in:
Cacodemon345
2022-03-21 15:28:43 +06:00
parent 81dfba16f3
commit f2df8a4cce

View File

@@ -1313,7 +1313,14 @@ void MainWindow::getTitle(wchar_t *title)
bool MainWindow::eventFilter(QObject* receiver, QEvent* event)
{
if (this->keyboardGrabber() == this) {
if (!dopause && (mouse_capture || !kbd_req_capture)) {
if (event->type() == QEvent::Shortcut) {
auto shortcutEvent = (QShortcutEvent*)event;
if (shortcutEvent->key() == ui->actionExit->shortcut()) {
event->accept();
return true;
}
}
if (event->type() == QEvent::KeyPress) {
event->accept();
this->keyPressEvent((QKeyEvent *) event);