timeview icon indicating copy to clipboard operation
timeview copied to clipboard

Unexpected mouse scroll behavior

Open rcgale opened this issue 7 years ago • 2 comments

I keep expecting the left/right mouse scroll (I'm using an Apple Magic Mouse) to move left and right, but it zooms instead.

rcgale avatar Jan 29 '18 20:01 rcgale

I wasn't aware of this... that is indeed inconsistent. On a trackpad, using three fingers moves left and right, if that is helpful in any way. Unfortunately I don't think we can easily change this since we are using pyqtgraph as our plotting layer:

http://www.pyqtgraph.org/documentation/mouse_interaction.html

lxkain avatar Jan 29 '18 21:01 lxkain

We could implement this, but this was remarkably more difficult to determine how than I thought it would be.

Background information:

We filter for wheel events in plot_area.py here:

    def wheelEvent(self, event: QtGui.QWheelEvent):
        super().wheelEvent(event)
        event.accept()

That means, we intercept the wheel event, and we can redirect as necessary.

Reading on the QWheelEvent docs, there is no property that indicates if the wheel event is horizontal or vertical, but there is the pixelDelta property, which returns a QPoint, and you can query if the wheel event occurs in x or in y (thus determining if it's a horizontal event or not).

I'm going to reopen the issue; but given how I would dive into this, there would be some major testing/vetting needed in order to make sure we're not getting any undesirable side effects.

j9ac9k avatar Jan 29 '18 22:01 j9ac9k