summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-07-17 09:40:13 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2024-07-20 06:00:46 +0200
commit6190fbff58d847bb2759c928966677df304ba371 (patch)
tree25c8ef82b56b96d65be55cac88404c374d2d53ef /android
parent54294119b9a3c80d2cb5d37030117f38d3f7f538 (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/+/170561 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/libreoffice/LOKitTileProvider.java9
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 c8a055206dd0..bbdc9456cf4c 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;
@@ -630,6 +629,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;
}