Skip to content

Commit

Permalink
ui: fix crash on pressing special auto-repeating accent keys (^, `, ´…
Browse files Browse the repository at this point in the history
…) in virtual console slider on Windows Qt5 by ignoring unknown keyPress events with key=0 (e.g. tested with german QWERTZ keyboard layout)
  • Loading branch information
timholzhey committed Oct 13, 2024
1 parent c7de361 commit 3b8c640
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ui/src/virtualconsole/virtualconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/virtualconsole/virtualconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3b8c640

Please sign in to comment.