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

x/exp/shiny: Mouse wheel event direction inverted on MacOS #16020

Closed
driusan opened this issue Jun 9, 2016 · 6 comments
Closed

x/exp/shiny: Mouse wheel event direction inverted on MacOS #16020

driusan opened this issue Jun 9, 2016 · 6 comments

Comments

@driusan
Copy link

driusan commented Jun 9, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

go version go1.6.2 darwin/amd64

  1. What operating system and processor architecture are you using (go env)?

OS X El Capitain (10.11.5)

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/driusan/Code/Go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on play.golang.org is best.

The easiest way to reproduce is to run x/exp/shiny/example/basic on Mac, and use a physical mouse wheel to see the mouse direction of the event that gets printed to the terminal, then compare it to the direction that the scroll wheel scrolls the window in a non-shiny app (ie. on Chrome, in a terminal window, etc)

  1. What did you expect to see?
  • Scrolling down with a mouse wheel sends a ButtonWheelDown (-2) event when OS X's ridiculous "Scroll direction: natural" option is turned off in mouse system preferences and a ButtonWheelUp (-1) event when it's turned on.
  • Scrolling up with a mouse wheel sends a ButtonWheelUp (-1) event when "Scroll direction: natural" is turned off and ButtonWheelDown (-2) when it's turned on.

This would make the OS X behaviour consistent with how the X11 et al drivers work.

  1. What did you see instead?

Mouse wheel events send the opposite direction of what's expected.

@nigeltao
Copy link
Contributor

@crawshaw.

@quentinmit quentinmit added this to the Unreleased milestone Jun 17, 2016
@driusan
Copy link
Author

driusan commented Jun 17, 2016

I just played with this a little more, and it seems like the trackpad "Scroll direction" setting and the Mouse "Scroll direction" setting are interacting in some way where toggling the mouse setting is affecting the trackpad and vice versa.

@dmitshur
Copy link
Contributor

I just played with this a little more, and it seems like the trackpad "Scroll direction" setting and the Mouse "Scroll direction" setting are interacting in some way where toggling the mouse setting is affecting the trackpad and vice versa.

Yes, there's only one system-wide setting for scrolling direction that applies to both trackpads and mouse devices. You can't configure them independently.

@gopherbot
Copy link

CL https://golang.org/cl/24360 mentions this issue.

@driusan
Copy link
Author

driusan commented Jun 23, 2016

@shurcooL you're right, I didn't notice that changing one also changes the other in system preferences. It's just bad UI design by Apple..

@dmitshur
Copy link
Contributor

It's just bad UI design by Apple.

FWIW, my personal opinion is that it is:

  • an opinionated decision by Apple
  • a good UI design (in the long term, not short term)

If I were in their place, I would make the same decision. Sorry for slightly off-topic comment.

@golang golang locked and limited conversation to collaborators Jun 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants