app, io: [wasm, android] add support for numeric/email keyboard mode

Previously, the on-screen keyboard always displays the text keyboard,
(QWERTY or equivalent).

For optimal user experience, it's possible to specify the keyboard type
using `InputHint`. The on-screen keyboard will provide shortcuts or
restrict what the user can input.

Due to some limitations (gio#116), only numeric and text keyboards are
supported on Android.

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
Inkeliz
2021-04-30 13:03:17 +01:00
committed by Elias Naur
parent e68ee35c86
commit 9b4b91fec0
14 changed files with 128 additions and 5 deletions
+3
View File
@@ -184,6 +184,9 @@ func (w *Window) processFrame(frameStart time.Time, size image.Point, frame *op.
case router.TextInputClose:
go w.driverRun(func(d wm.Driver) { d.ShowTextInput(false) })
}
if hint, ok := w.queue.q.TextInputHint(); ok {
go w.driverRun(func(d wm.Driver) { d.SetInputHint(hint) })
}
if txt, ok := w.queue.q.WriteClipboard(); ok {
go w.WriteClipboard(txt)
}