forked from joejulian/gio
app,widget: use arrow keys for Android navigation
Android doesn't distinguish between the arrow keys on a keyboard and the directional keys on a remote control, so there's no way to move the caret in an Editor with arrow keys. This change updates the Android port to map Android's DPAD_* key codes to the arrow key names, fixing caret movement. The change also updates Editor to only request arrow keys that actually move the caret, to keep directional focus movement working. Fixes: https://todo.sr.ht/~eliasnaur/gio/410 Signed-off-by: Mearaj <mearajbhagad@gmail.com>
This commit is contained in:
+4
-4
@@ -905,13 +905,13 @@ func convertKeyCode(code C.jint) (string, bool) {
|
||||
case C.AKEYCODE_META_LEFT, C.AKEYCODE_META_RIGHT:
|
||||
n = key.NameSuper
|
||||
case C.AKEYCODE_DPAD_UP:
|
||||
n = key.NameUp
|
||||
n = key.NameUpArrow
|
||||
case C.AKEYCODE_DPAD_DOWN:
|
||||
n = key.NameDown
|
||||
n = key.NameDownArrow
|
||||
case C.AKEYCODE_DPAD_LEFT:
|
||||
n = key.NameLeft
|
||||
n = key.NameLeftArrow
|
||||
case C.AKEYCODE_DPAD_RIGHT:
|
||||
n = key.NameRight
|
||||
n = key.NameRightArrow
|
||||
default:
|
||||
return "", false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user