From: sln Date: Thu, 29 Nov 2007 17:23:08 +0000 (+0000) Subject: Alt key kode is inserted in SelectionEvent X-Git-Tag: CTH_V1_3~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=159dbe543a6cf4d7a6d655ef85ac2dabe98077d0;p=modules%2Fgui.git Alt key kode is inserted in SelectionEvent --- 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();