Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected mouse scroll behavior #25

Open
rcgale opened this issue Jan 29, 2018 · 2 comments
Open

Unexpected mouse scroll behavior #25

rcgale opened this issue Jan 29, 2018 · 2 comments

Comments

@rcgale
Copy link

rcgale commented Jan 29, 2018

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

@lxkain lxkain added the wontfix label Jan 29, 2018
@lxkain
Copy link
Collaborator

lxkain commented Jan 29, 2018

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 lxkain closed this as completed Jan 29, 2018
@j9ac9k
Copy link
Collaborator

j9ac9k commented Jan 29, 2018

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 j9ac9k reopened this Jan 29, 2018
@lxkain lxkain removed the wontfix label Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants