Skip to content

Commit

Permalink
fix capturing cursor with ~ press
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and nyalldawson committed Jan 13, 2021
1 parent f48cd28 commit 28d6be5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/3d/qgscameracontroller.cpp
Expand Up @@ -454,6 +454,8 @@ void QgsCameraController::onKeyPressed( Qt3DInput::QKeyEvent *event )
if ( event->isAutoRepeat() )
return;

event->setAccepted( true );

mDepressedKeys.insert( event->key() );
onKeyPressedFlyNavigation();
return;
Expand Down Expand Up @@ -597,14 +599,7 @@ void QgsCameraController::onPositionChangedFlyNavigation( Qt3DInput::QMouseEvent
moveCameraPositionBy( 5.0 * mCameraMovementSpeed * cameraPosDiff );
}

if ( mCaptureFpsMouseMovements )
{
QCursor::setPos( QCursor::pos().x() - dx, QCursor::pos().y() - dy );
}
else
{
mMousePos = QPoint( mouse->x(), mouse->y() );
}
mMousePos = QPoint( mouse->x(), mouse->y() );
}

void QgsCameraController::onKeyReleased( Qt3DInput::QKeyEvent *event )
Expand Down

0 comments on commit 28d6be5

Please sign in to comment.