traverso-commit
[Top][All Lists]
Advanced

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

[Traverso-commit] traverso resources/keymap.xml src/core/ViewPort...


From: Remon Sijrier
Subject: [Traverso-commit] traverso resources/keymap.xml src/core/ViewPort...
Date: Sat, 09 Feb 2008 21:32:52 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       08/02/09 21:32:52

Modified files:
        resources      : keymap.xml 
        src/core       : ViewPort.cpp ViewPort.h 

Log message:
        * Treat Tab key as 'normal' key events, and bind the 'Shuttle' tool 
again to it, instead of using the S key, which can be used for more usefull key 
bindings now!

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/resources/keymap.xml?cvsroot=traverso&r1=1.99&r2=1.100
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ViewPort.cpp?cvsroot=traverso&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ViewPort.h?cvsroot=traverso&r1=1.16&r2=1.17

Patches:
Index: resources/keymap.xml
===================================================================
RCS file: /sources/traverso/traverso/resources/keymap.xml,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -b -r1.99 -r1.100
--- resources/keymap.xml        7 Feb 2008 15:35:06 -0000       1.99
+++ resources/keymap.xml        9 Feb 2008 21:32:52 -0000       1.100
@@ -405,6 +405,10 @@
                <keyfact type="HKEY" key1="S" >
                        <Objects>
                                <Object objectname="FadeView" mousehint="LR" 
slotsignature="strength" modes="All" sortorder="4" />
+                       </Objects>
+               </keyfact>
+               <keyfact type="HKEY" key1="TAB" >
+                       <Objects>
                                <Object objectname="SheetView" mousehint="LRUD" 
slotsignature="shuttle" modes="All" sortorder="6" />
                        </Objects>
                </keyfact>

Index: src/core/ViewPort.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/ViewPort.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- src/core/ViewPort.cpp       21 Jan 2008 16:22:15 -0000      1.28
+++ src/core/ViewPort.cpp       9 Feb 2008 21:32:52 -0000       1.29
@@ -119,6 +119,26 @@
        cpointer().set_current_viewport((ViewPort*) 0);
 }
 
+bool ViewPort::event(QEvent * event)
+{
+       // We want Tab events also send to the InputEngine
+       // so treat them as 'normal' key events.
+       if (event->type() == QEvent::KeyPress) {
+               QKeyEvent *ke = static_cast<QKeyEvent *>(event);
+               if (ke->key() == Qt::Key_Tab) {
+                       keyPressEvent(ke);
+                       return true;
+               }
+       }
+       if (event->type() == QEvent::KeyRelease) {
+               QKeyEvent *ke = static_cast<QKeyEvent *>(event);
+               if (ke->key() == Qt::Key_Tab) {
+                       keyReleaseEvent(ke);
+                       return true;
+               }
+       }
+       return QGraphicsView::event(event);
+}
 
 void ViewPort::mouseMoveEvent(QMouseEvent* event)
 {
@@ -250,9 +270,11 @@
 {
        viewport()->setCursor(Qt::BlankCursor);
        
+       if (!m_holdCursorActive) {
        m_holdcursor->setPos(cpointer().scene_pos());
-       m_holdcursor->set_type(cursorName);
        m_holdcursor->show();
+       }
+       m_holdcursor->set_type(cursorName);
        m_holdCursorActive = true;
 }
 
@@ -333,4 +355,3 @@
 }
 
 
-

Index: src/core/ViewPort.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/ViewPort.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- src/core/ViewPort.h 7 Dec 2007 15:43:02 -0000       1.16
+++ src/core/ViewPort.h 9 Feb 2008 21:32:52 -0000       1.17
@@ -57,6 +57,7 @@
 
 
 protected:
+       virtual bool event(QEvent *event);
        virtual void leaveEvent ( QEvent * event );
        virtual void enterEvent ( QEvent * );
         virtual void paintEvent( QPaintEvent* e);




reply via email to

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