Package: dvbcut
Version: 0.5.4+svn178-9
Severity: normal
Tags: patch

I noticed that (atleast for me) pressing modifier-keys (Shift/Alt/Ctrl) while
navigating the video (either by using the mousewheel or cursor-keys) does not
change the step-size.

After changing the use QWheelEvent::state() (and QKeyEvent::state()) to
QInputEvent::modifier() in dvbcut::eventFilter() these work again.

(Since they are not documented, these are (by default):
without modifier: move 1500 frames =~ 1 minute (at 25fps)
Shift: 25 frames =~ 1 second
Ctrl: 1 frame
Alt: 22500 frames =~ 15 minutes)
(These are changable in the configfile. However the config is not written, I'll
post another patch in a seperate bugreport)



-- System Information:
Debian Release: jessie/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dvbcut depends on:
ii  liba52-0.7.4       0.7.4-17
ii  libao4             1.1.0-3
ii  libavcodec56       6:11-2
ii  libavformat56      6:11-2
ii  libavutil54        6:11-2
ii  libc6              2.19-13
ii  libgcc1            1:4.9.1-19
ii  libmad0            0.15.1b-8
ii  libqt4-network     4:4.8.6+git64-g5dc8b2b+dfsg-2+b1
ii  libqt4-qt3support  4:4.8.6+git64-g5dc8b2b+dfsg-2+b1
ii  libqt4-sql         4:4.8.6+git64-g5dc8b2b+dfsg-2+b1
ii  libqt4-xml         4:4.8.6+git64-g5dc8b2b+dfsg-2+b1
ii  libqtcore4         4:4.8.6+git64-g5dc8b2b+dfsg-2+b1
ii  libqtgui4          4:4.8.6+git64-g5dc8b2b+dfsg-2+b1
ii  libstdc++6         4.9.1-19
ii  libswscale3        6:11-2

Versions of packages dvbcut recommends:
ii  mplayer2 [mplayer]  2.0-728-g2c378c7-4+b1

dvbcut suggests no packages.
Author: Tim Riemenschneider <deb...@tim-riemenschneider.de>
Description: use the Qt4 QtInputEvent::modifiers() method instead of the Qt3 Q<Wheel|Key>Event::state()
(the later is not working anymore?)

--- a/src/dvbcut.cpp
+++ b/src/dvbcut.cpp
@@ -2144,17 +2144,24 @@
   bool myEvent = true;
   int delta = 0;
   int incr = WHEEL_INCR_NORMAL;
+  Qt::KeyboardModifiers mods;
 
   if (e->type() == QEvent::Wheel && watched != ui->jogslider) {
     QWheelEvent *we = (QWheelEvent*)e;
     // Note: delta is a multiple of 120 (see Qt documentation)
     delta = we->delta();
-      if (we->state() & Qt::Key_Alt)
+    mods = we->modifiers();
+    if(mods & Qt::AltModifier) {
       incr = WHEEL_INCR_ALT;
-      else if (we->state() & Qt::Key_Control)
+    } else if(mods & Qt::ControlModifier) {
       incr = WHEEL_INCR_CTRL;
-      else if (we->state() & Qt::Key_Shift)
+    } else if(mods & Qt::ShiftModifier) {
       incr = WHEEL_INCR_SHIFT;
+    } else if(mods & Qt::MetaModifier) {
+      // TODO: do we want/need another step-size?
+      // incr = WHEEL_INCR_META;
+    }
+
   }
   else if (e->type() == QEvent::KeyPress) {
     QKeyEvent *ke = (QKeyEvent*)e;
@@ -2163,12 +2170,17 @@
       delta = -delta;
     else if (ke->key() != Qt::Key_Left)
       myEvent = false;
-    if (ke->state() & Qt::Key_Alt)
+    mods = ke->modifiers();
+    if(mods & Qt::AltModifier) {
       incr = WHEEL_INCR_ALT;
-    else if (ke->state() & Qt::Key_Control)
+    } else if(mods & Qt::ControlModifier) {
       incr = WHEEL_INCR_CTRL;
-    else if (ke->state() & Qt::Key_Shift)
+    } else if(mods & Qt::ShiftModifier) {
       incr = WHEEL_INCR_SHIFT;
+    } else if(mods & Qt::MetaModifier) {
+      // TODO: do we want/need another step-size?
+      //  incr = WHEEL_INCR_META;
+    }
   }
   else
     myEvent = false;

Reply via email to