Skip to content

Commit 10e8496

Browse files
wip
1 parent 98f1680 commit 10e8496

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
.pub/
1919

2020
build/
21-
21+
foo/
2222
.flutter-plugins
2323

2424
# Examples generated files

key-events.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package flutter
33
import (
44
"encoding/json"
55
"fmt"
6+
"log"
67

78
"github.com/go-flutter-desktop/go-flutter/plugin"
89
"github.com/go-gl/glfw/v3.3/glfw"
@@ -74,8 +75,20 @@ func (p *keyeventPlugin) sendKeyEvent(window *glfw.Window, key glfw.Key, scancod
7475
}
7576

7677
utf8 := glfw.GetKeyName(key, scancode)
78+
log.Println(
79+
"go-flutter: debug key:", key,
80+
"key utfseq:", fmt.Sprintf("\\u%x", key),
81+
"scancode:", scancode,
82+
"scancode utfseq:", fmt.Sprintf("\\u%x", scancode),
83+
"/", utf8, "/",
84+
"rune:", rune(key),
85+
"string:", string(rune(key)),
86+
)
87+
if len(utf8) == 0 {
88+
log.Println("go-flutter: unable to lookup utf8 for key:", key, "scancode:", scancode, "/", utf8, "/", "rune:", rune(scancode))
89+
return
90+
}
7791
unicodeInt := codepointFromGLFWKey([]rune(utf8)...)
78-
7992
event := keyEventMessage{
8093
KeyCode: int(key),
8194
Keymap: "linux", // TODO: darwin? windows?

0 commit comments

Comments
 (0)