qt: Keyboard input now works properly when mouse is uncaptured
This commit is contained in:
@@ -1313,7 +1313,14 @@ void MainWindow::getTitle(wchar_t *title)
|
|||||||
|
|
||||||
bool MainWindow::eventFilter(QObject* receiver, QEvent* event)
|
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) {
|
if (event->type() == QEvent::KeyPress) {
|
||||||
event->accept();
|
event->accept();
|
||||||
this->keyPressEvent((QKeyEvent *) event);
|
this->keyPressEvent((QKeyEvent *) event);
|
||||||
|
Reference in New Issue
Block a user