forked from joejulian/gio
app,widget: implement Editor IME support, add Android implementation
Fixes: https://todo.sr.ht/~eliasnaur/gio/116 References: https://todo.sr.ht/~eliasnaur/gio/246 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+8
-1
@@ -1202,7 +1202,12 @@ func gio_onKeyboardKey(data unsafe.Pointer, keyboard *C.struct_wl_keyboard, seri
|
||||
kc := mapXKBKeycode(uint32(keyCode))
|
||||
ks := mapXKBKeyState(uint32(state))
|
||||
for _, e := range w.disp.xkb.DispatchKey(kc, ks) {
|
||||
w.w.Event(e)
|
||||
if ee, ok := e.(key.EditEvent); ok {
|
||||
// There's no support for IME yet.
|
||||
w.w.EditorInsert(ee.Text)
|
||||
} else {
|
||||
w.w.Event(e)
|
||||
}
|
||||
}
|
||||
if state != C.WL_KEYBOARD_KEY_STATE_PRESSED {
|
||||
return
|
||||
@@ -1642,6 +1647,8 @@ func (w *window) ShowTextInput(show bool) {}
|
||||
|
||||
func (w *window) SetInputHint(_ key.InputHint) {}
|
||||
|
||||
func (w *window) EditorStateChanged(old, new editorState) {}
|
||||
|
||||
// Close the window.
|
||||
func (w *window) Close() {
|
||||
w.dead = true
|
||||
|
||||
Reference in New Issue
Block a user