ui/app: (iOS) treat the \n character as a return key chord

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-07 17:54:50 +02:00
parent 47c6ea2dd2
commit a0c04cb3b2
+9 -4
View File
@@ -148,11 +148,16 @@ func onDeleteBackward(view C.CFTypeRef) {
}
//export onText
func onText(view C.CFTypeRef, str *C.char) {
func onText(view C.CFTypeRef, cstr *C.char) {
w := views[view]
w.w.event(key.EditEvent{
Text: C.GoString(str),
})
str := C.GoString(cstr)
if str != "\n" {
w.w.event(key.EditEvent{
Text: str,
})
} else {
w.onKeyCommand(key.NameReturn)
}
}
//export onTouch