From 159dbe543a6cf4d7a6d655ef85ac2dabe98077d0 Mon Sep 17 00:00:00 2001 From: sln Date: Thu, 29 Nov 2007 17:23:08 +0000 Subject: [PATCH] Alt key kode is inserted in SelectionEvent --- src/SVTK/SVTK_InteractorStyle.cxx | 1 + src/SVTK/SVTK_RenderWindowInteractor.cxx | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index 7ba576467..2c713e5d8 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -216,6 +216,7 @@ SVTK_InteractorStyle mySelectionEvent->myIsCtrl = Interactor->GetControlKey(); mySelectionEvent->myIsShift = Interactor->GetShiftKey(); + mySelectionEvent->myKeyCode = Interactor->GetKeyCode(); mySelectionEvent->myLastX = mySelectionEvent->myX; mySelectionEvent->myLastY = mySelectionEvent->myY; diff --git a/src/SVTK/SVTK_RenderWindowInteractor.cxx b/src/SVTK/SVTK_RenderWindowInteractor.cxx index 647fbc554..19586728c 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_RenderWindowInteractor.cxx @@ -238,10 +238,15 @@ void QVTK_RenderWindowInteractor ::mouseMoveEvent( QMouseEvent* event ) { + int keyCode = 0; + if ( event->state() & AltButton ) + keyCode = Qt::Key_Alt; + GetDevice()->SetEventInformationFlipY(event->x(), event->y(), event->state() & ControlButton, - event->state() & ShiftButton); + event->state() & ShiftButton, + keyCode ); GetDevice()->MouseMoveEvent(); } @@ -253,16 +258,23 @@ void QVTK_RenderWindowInteractor ::mousePressEvent( QMouseEvent* event ) { + int keyCode = 0; + if ( event->state() & AltButton ) + keyCode = Qt::Key_Alt; + GetDevice()->SetEventInformationFlipY(event->x(), event->y(), event->state() & ControlButton, - event->state() & ShiftButton); + event->state() & ShiftButton, + keyCode ); if( event->button() & LeftButton ) GetDevice()->LeftButtonPressEvent(); else if( event->button() & MidButton ) GetDevice()->MiddleButtonPressEvent(); else if( event->button() & RightButton ) GetDevice()->RightButtonPressEvent(); + + // QKeyEvent } @@ -273,10 +285,15 @@ void QVTK_RenderWindowInteractor ::mouseReleaseEvent( QMouseEvent *event ) { + int keyCode = 0; + if ( event->state() & AltButton ) + keyCode = Qt::Key_Alt; + GetDevice()->SetEventInformationFlipY(event->x(), event->y(), event->state() & ControlButton, - event->state() & ShiftButton); + event->state() & ShiftButton, + keyCode); if( event->button() & LeftButton ) GetDevice()->LeftButtonReleaseEvent(); -- 2.39.2