Skip to content

Commit 824322c

Browse files
wip
1 parent 98f1680 commit 824322c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-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: 6 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,12 @@ func (p *keyeventPlugin) sendKeyEvent(window *glfw.Window, key glfw.Key, scancod
7475
}
7576

7677
utf8 := glfw.GetKeyName(key, scancode)
78+
log.Println("go-flutter: debug key:", key, "scancode:", scancode, "/", utf8, "/", "rune:", rune(scancode), "string:", string(rune(scancode)))
79+
if len(utf8) == 0 {
80+
log.Println("go-flutter: unable to lookup utf8 for key:", key, "scancode:", scancode, "/", utf8, "/", "rune:", rune(scancode))
81+
return
82+
}
7783
unicodeInt := codepointFromGLFWKey([]rune(utf8)...)
78-
7984
event := keyEventMessage{
8085
KeyCode: int(key),
8186
Keymap: "linux", // TODO: darwin? windows?

0 commit comments

Comments
 (0)