diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-17 09:40:13 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2024-08-23 11:17:11 +0200 |
commit | c564ddb41a9bd2a77a0fa54a8916c051ada85239 (patch) | |
tree | 015a9fcd3d4fc8d1be94a7627ac81b3c0c4c39b7 /android | |
parent | 0259ae2fa21e2ddf7a23ad4408c51f0ef9e73769 (diff) |
android: Handle cursor keys
In Android Viewer, forward the left/right/up/down keys
as such by adding the corresponding mapping to
`LOKitTileProvider#getKeyCode`.
This allows navigating through the document using those
keys e.g. on a hardware keyboard.
This addresses this comment from a Google Play Review:
> Editing, the cursor doesn't respond to the cursor keys
Change-Id: I688e5d0cc1db4f9315f9c9cb2139c22117a210e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170605
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 053d9feec432ca4dff4d85593d9cad0d975388b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170562
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'android')
-rw-r--r-- | android/source/src/java/org/libreoffice/LOKitTileProvider.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java b/android/source/src/java/org/libreoffice/LOKitTileProvider.java index 5d1cf12209dc..627bd906d0e6 100644 --- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java +++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java @@ -11,7 +11,6 @@ package org.libreoffice; import android.content.Context; import android.graphics.Bitmap; import android.graphics.PointF; -import android.os.Build; import android.print.PrintAttributes; import android.print.PrintDocumentAdapter; import android.print.PrintManager; @@ -629,6 +628,14 @@ class LOKitTileProvider implements TileProvider { switch (keyEvent.getKeyCode()) { case KeyEvent.KEYCODE_DEL: return com.sun.star.awt.Key.BACKSPACE; + case KeyEvent.KEYCODE_DPAD_DOWN: + return com.sun.star.awt.Key.DOWN; + case KeyEvent.KEYCODE_DPAD_LEFT: + return com.sun.star.awt.Key.LEFT; + case KeyEvent.KEYCODE_DPAD_RIGHT: + return com.sun.star.awt.Key.RIGHT; + case KeyEvent.KEYCODE_DPAD_UP: + return com.sun.star.awt.Key.UP; case KeyEvent.KEYCODE_ENTER: return com.sun.star.awt.Key.RETURN; } |