[3d] Fix broken key handling in walk mode

By treating KeyPress and ShortcutOverride as the same, we ended
up calling the same logic twice for all key presses. This resulted
in toggle style keystrokes (like the ctrl+backtick press to toggle
walk mode or backtick to lock cursor movements) being
activated and then immediately deactivated.

They Ctrl+number keystrokes to switch to top/left/... views
were also being double-triggered.

Only listen for the ShortcutOverride event instead, as that
is the "highest priority" event
This commit is contained in:
Nyall Dawson 2025-06-19 09:04:04 +10:00
parent 2094746417
commit 0e916c40a1

View File

@ -1277,7 +1277,7 @@ bool QgsCameraController::keyboardEventFilter( QKeyEvent *event )
return true;
}
}
else if ( event->type() == QKeyEvent::Type::KeyPress || event->type() == QEvent::ShortcutOverride )
else if ( event->type() == QEvent::ShortcutOverride )
{
if ( event->modifiers() & Qt::ControlModifier )
{