internal/uidriver/mobile: add build tags

This commit is contained in:
Hajime Hoshi 2022-02-06 15:59:01 +09:00
parent 12a70952a9
commit 67bb58849e
3 changed files with 9 additions and 3 deletions

View File

@ -651,7 +651,7 @@ var androidKeyToDriverKey = map[int]driver.Key{
}
`
const mobileGBuildKeysTmpl = `{{.License}}
const uidriverMobileKeysTmpl = `{{.License}}
{{.DoNotEdit}}
@ -791,7 +791,7 @@ func main() {
filepath.Join("internal", "driver", "keys.go"): driverKeysTmpl,
filepath.Join("internal", "glfw", "keys.go"): glfwKeysTmpl,
filepath.Join("internal", "uidriver", "glfw", "keys.go"): uidriverGlfwKeysTmpl,
filepath.Join("internal", "uidriver", "mobile", "keys.go"): mobileGBuildKeysTmpl,
filepath.Join("internal", "uidriver", "mobile", "keys.go"): uidriverMobileKeysTmpl,
filepath.Join("internal", "uidriver", "js", "keys_js.go"): uidriverJsKeysTmpl,
filepath.Join("keys.go"): ebitenKeysTmpl,
filepath.Join("mobile", "ebitenmobileview", "keys_android.go"): mobileAndroidKeysTmpl,
@ -817,6 +817,9 @@ func main() {
case filepath.Join("internal", "glfw", "keys.go"):
buildTag = "//go:build !js" +
"\n// +build !js"
case filepath.Join("internal", "uidriver", "mobile", "keys.go"):
buildTag = "//go:build android || ios" +
"\n// +build android ios"
case filepath.Join("internal", "uidriver", "glfw", "keys.go"):
buildTag = "//go:build !android && !js && !ios" +
"\n// +build !android,!js,!ios"

View File

@ -14,6 +14,9 @@
// Code generated by genkeys.go using 'go generate'. DO NOT EDIT.
//go:build android || ios
// +build android ios
package mobile
import (

View File

@ -23,7 +23,7 @@ import (
)
// A Key represents a keyboard key.
// These keys represent pysical keys of US keyboard layout.
// These keys represent pysical keys of US keyboard.
// For example, KeyQ represents Q key on US keyboards and ' (quote) key on Dvorak keyboards.
type Key int