Skip to content

x/exp/shiny: hebrew keyboard not supported #28034

@yahelmanor

Description

@yahelmanor

What did you do?

I have created a program that logs the key.Event from the window, then I tried to type Hebrew rune in my keyboard and the program loged

key = key.Event{(CodeUnknown), key.Modifiers(), Press}
key = key.Event{(CodeUnknown), key.Modifiers(), Release}

the program

package main

import (
	"fmt"
	"log"

	"golang.org/x/exp/shiny/driver"
	"golang.org/x/exp/shiny/screen"
	"golang.org/x/mobile/event/key"
	"golang.org/x/mobile/event/lifecycle"
)

func main() {
	driver.Main(func(s screen.Screen) {
		w, err := s.NewWindow(&screen.NewWindowOptions{
			Title: "~",
		})
		if err != nil {
			log.Fatal(err)
		}
		defer w.Release()
		for {
			e := w.NextEvent()
			switch e := e.(type) {
			case key.Event:
				fmt.Println("key =", e)
			case lifecycle.Event:
				if e.To == lifecycle.StageDead {
					return
				}
			}
		}
	})
}

What did you expect to see?

I have expected the key.Event to contain the Unicode of the character I pressed.
And the log should be like

key = key.Event{'א' (CodeUnknown), key.Modifiers(), Press}
key = key.Event{'א' (CodeUnknown), key.Modifiers(), Release}

What did you see instead?

the Unicode was -1.

Does this issue reproduce with the latest release (go1.11.1)?

yes

System details

go version go1.10.1 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/Desktop/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build633916952=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version go1.10.1 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.10.1
uname -sr: Linux 4.18.0-8-generic
Distributor ID:	Ubuntu
Description:	Ubuntu Cosmic Cuttlefish (development branch)
Release:	18.10
Codename:	cosmic
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Ubuntu GLIBC 2.28-0ubuntu1) stable release version 2.28.
gdb --version: GNU gdb (Ubuntu 8.2-0ubuntu1) 8.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions