You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go1.8.3 windows/amd64
What operating system and processor architecture are you using (go env)?
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\user\Dropbox\goProjects;C:\Users\user\Dropbox\golibs
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\user\AppData\Local\Temp\go-build310428203=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
What did you do?
Attempted to write graphics program using mobile/app. Noticed no mouse events were delivered to application, due to code in mobile/app/shiny.go (convertEvent) that creates touch events based on mouse events, and then DISCARDS the mouse events.
No mouse events will ever reach the user code, meaning that events like WheelUp and WheelDown are completely unavailable to the application (all the application gets is a generic "touchstart" and "touchend", all the buttons are grouped together)
What did you expect to see?
Mouse events
What did you see instead?
No mouse events, at all
Fixed code
In order to cause minimum disruption to existing code, this following patch passes mouse events to the user, while also keeping the current behaviour of creating touch events. Note that only one line is changed, the rest of the function is just context.
mobile/app/shiny.go
func convertEvent(e interface{}) interface{} {
switch e := e.(type) {
case lifecycle.Event:
if theApp.glctx == nil {
theApp.glctx = e.DrawContext.(gl.Context)
}
case mouse.Event:
te := touch.Event{
X: e.X,
Y: e.Y,
}
switch e.Direction {
case mouse.DirNone:
te.Type = touch.TypeMove
case mouse.DirPress:
te.Type = touch.TypeBegin
case mouse.DirRelease:
te.Type = touch.TypeEnd
}
theApp.Send(te)
}
return e
}
The text was updated successfully, but these errors were encountered:
donomii
changed the title
Fix for broken mouse support in shiny.go
mobile/app/shiny.go: Fix for broken mouse events
Jun 6, 2017
donomii
changed the title
mobile/app/shiny.go: Fix for broken mouse events
mobile/app/shiny.go: Fix broken mouse events
Jun 6, 2017
donomii
changed the title
mobile/app/shiny.go: Fix broken mouse events
mobile/app/shiny.go: Fix mouse events
Jun 6, 2017
donomii
changed the title
mobile/app/shiny.go: Fix mouse events
mobile/app/shiny.go: Mouse events not being delivered to application
Jun 7, 2017
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.8.3 windows/amd64
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\user\Dropbox\goProjects;C:\Users\user\Dropbox\golibs
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\user\AppData\Local\Temp\go-build310428203=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
What did you do?
Attempted to write graphics program using mobile/app. Noticed no mouse events were delivered to application, due to code in mobile/app/shiny.go (convertEvent) that creates touch events based on mouse events, and then DISCARDS the mouse events.
No mouse events will ever reach the user code, meaning that events like WheelUp and WheelDown are completely unavailable to the application (all the application gets is a generic "touchstart" and "touchend", all the buttons are grouped together)
What did you expect to see?
Mouse events
What did you see instead?
No mouse events, at all
Fixed code
In order to cause minimum disruption to existing code, this following patch passes mouse events to the user, while also keeping the current behaviour of creating touch events. Note that only one line is changed, the rest of the function is just context.
mobile/app/shiny.go
The text was updated successfully, but these errors were encountered: