~eliasnaur/gio-example

ref: be08aa68a96a19dd7cb1998da5ba750df03da3f1 gio-example/gio-extras/haptic/example_android.go -rw-r--r-- 400 bytes
be08aa68Elias Naur README.md: link to GitHub mirror 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package main

import (
	"gioui.org/app"
	"gioui.org/io/event"
)

// ProcessPlatformEvent handles platform-specific event processing. If it
// consumed the provided event, it returns true. In this case, no further
// event processing should occur.
func ProcessPlatformEvent(event event.Event) bool {
	if ve, ok := event.(app.ViewEvent); ok {
		buzzer.SetView(ve.View)
		return true
	}
	return false
}