mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 23:55:39 +00:00
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:
+9
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user