traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/core InputEngine.cpp InputEngine.h...


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/core InputEngine.cpp InputEngine.h...
Date: Thu, 12 Apr 2007 17:06:57 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/04/12 17:06:57

Modified files:
        src/core       : InputEngine.cpp InputEngine.h ViewPort.cpp 
                         ViewPort.h 

Log message:
        always clear the InputEngine's modifier keys on a canvas leave event
        since a leave event potentially avoids the modifier key release event 
to be send to the engine!

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/InputEngine.cpp?cvsroot=traverso&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/InputEngine.h?cvsroot=traverso&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ViewPort.cpp?cvsroot=traverso&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ViewPort.h?cvsroot=traverso&r1=1.13&r2=1.14

Patches:
Index: InputEngine.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/InputEngine.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- InputEngine.cpp     12 Apr 2007 12:32:07 -0000      1.44
+++ InputEngine.cpp     12 Apr 2007 17:06:57 -0000      1.45
@@ -515,6 +515,7 @@
        fact2_k1 = 0;
        fact2_k2 = 0;
        wholeMapIndex = -1;
+       
        for (int i=0; i < STACK_SIZE; i++) {
                eventType[i] = 0;
                eventStack[i] = 0;
@@ -522,6 +523,10 @@
        }
 }
 
+void InputEngine::clear_modifier_keys()
+{
+       m_activeModifierKeys.clear();
+}
 
 
 // Everthing starts here. Catch event takes anything happen in the keyboard

Index: InputEngine.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/InputEngine.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- InputEngine.h       12 Apr 2007 12:32:07 -0000      1.19
+++ InputEngine.h       12 Apr 2007 17:06:57 -0000      1.20
@@ -145,6 +145,7 @@
 
         void activate();
         void suspend();
+       void clear_modifier_keys();
 
 
         int init_map(const QString& mapFilename);

Index: ViewPort.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/ViewPort.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- ViewPort.cpp        12 Apr 2007 15:30:59 -0000      1.15
+++ ViewPort.cpp        12 Apr 2007 17:06:57 -0000      1.16
@@ -17,7 +17,6 @@
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
-$Id: ViewPort.cpp,v 1.15 2007/04/12 15:30:59 r_sijrier Exp $
 */
 
 #include <QMouseEvent>
@@ -167,6 +166,14 @@
        cpointer().set_current_viewport(this);
 }
 
+void ViewPort::leaveEvent ( QEvent * event )
+{
+       QGraphicsView::leaveEvent(event);
+       // There can be many reasons for a leave event, sometimes
+       // this leaves the engine in a non-cleared state, e.g. modifier
+       // keys still can be active!! So we reset those manually here.
+       ie().clear_modifier_keys();
+}
 
 void ViewPort::keyPressEvent( QKeyEvent * e)
 {
@@ -210,7 +217,6 @@
        QGraphicsView::paintEvent(e);
 }
 
-
 void ViewPort::reset_cursor( )
 {
        viewport()->unsetCursor();
@@ -303,3 +309,4 @@
 }
 
 //eof
+

Index: ViewPort.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/ViewPort.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- ViewPort.h  12 Apr 2007 12:32:07 -0000      1.13
+++ ViewPort.h  12 Apr 2007 17:06:57 -0000      1.14
@@ -17,7 +17,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
  
-    $Id: ViewPort.h,v 1.13 2007/04/12 12:32:07 r_sijrier Exp $
 */
 
 #ifndef VIEWPORT_H
@@ -58,6 +57,7 @@
 
 
 protected:
+       virtual void leaveEvent ( QEvent * event );
         virtual void enterEvent ( QEvent * );
         virtual void paintEvent( QPaintEvent* e);
         virtual void mouseMoveEvent(QMouseEvent* e);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]