Skip to content

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

@driusan

Description

@driusan

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions