android/source/src/java/org/libreoffice/LOKitTileProvider.java |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 58a533ee6bab11a157184aec47a39588ec63add2
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jul 17 09:40:13 2024 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Sat Jul 20 06:00:55 2024 +0200

    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.wegh...@posteo.de>
    (cherry picked from commit 053d9feec432ca4dff4d85593d9cad0d975388b3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170562
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

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;
         }

Reply via email to