From 3b8c640504b3a7d80e52bdc4276e2df769d0a91c Mon Sep 17 00:00:00 2001 From: timholzhey Date: Sun, 13 Oct 2024 12:56:20 +0200 Subject: [PATCH] =?UTF-8?q?ui:=20fix=20crash=20on=20pressing=20special=20a?= =?UTF-8?q?uto-repeating=20accent=20keys=20(^,=20`,=20=C2=B4)=20in=20virtu?= =?UTF-8?q?al=20console=20slider=20on=20Windows=20Qt5=20by=20ignoring=20un?= =?UTF-8?q?known=20keyPress=20events=20with=20key=3D0=20(e.g.=20tested=20w?= =?UTF-8?q?ith=20german=20QWERTZ=20keyboard=20layout)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/virtualconsole/virtualconsole.cpp | 4 ++-- ui/src/virtualconsole/virtualconsole.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/virtualconsole/virtualconsole.cpp b/ui/src/virtualconsole/virtualconsole.cpp index 44aeda860a..8c7357acd7 100644 --- a/ui/src/virtualconsole/virtualconsole.cpp +++ b/ui/src/virtualconsole/virtualconsole.cpp @@ -1597,7 +1597,7 @@ void VirtualConsole::initContents() void VirtualConsole::keyPressEvent(QKeyEvent* event) { - if (event->isAutoRepeat() == true) + if (event->isAutoRepeat() == true || event->key() == 0) { event->ignore(); return; @@ -1611,7 +1611,7 @@ void VirtualConsole::keyPressEvent(QKeyEvent* event) void VirtualConsole::keyReleaseEvent(QKeyEvent* event) { - if (event->isAutoRepeat() == true) + if (event->isAutoRepeat() == true || event->key() == 0) { event->ignore(); return; diff --git a/ui/src/virtualconsole/virtualconsole.h b/ui/src/virtualconsole/virtualconsole.h index 9b3d642626..f53ca9c97c 100644 --- a/ui/src/virtualconsole/virtualconsole.h +++ b/ui/src/virtualconsole/virtualconsole.h @@ -345,7 +345,7 @@ public slots: *********************************************************************/ protected: - /** Handler for keyboard key presse events */ + /** Handler for keyboard key press events */ void keyPressEvent(QKeyEvent* event); /** Handler for keyboard key release events */