[Libreoffice-commits] core.git: filter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Feb 22 16:41:23 UTC 2019


 filter/source/svg/presentation_engine.js |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit dabadf7c54a778546d5a64edf2152cd2f04b72a3
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Feb 22 18:27:01 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Fri Feb 22 18:29:42 2019 +0200

    Handle arrow keys (from a hardware keyboard) on iOS
    
    Change-Id: Ia5946a77215eba565c3ff8c4dfbc08b95af493c0

diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js
index 41c8311f734b..90a1179c0719 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -106,6 +106,28 @@ function onKeyDown( aEvt )
 
     var code = aEvt.keyCode || aEvt.charCode;
 
+    // console.log('===> onKeyDown: ' + code);
+
+    // Handle arrow keys in iOS WebKit (including Mobile Safari)
+    if (code == 0 && aEvt.key != undefined) {
+        switch (aEvt.key) {
+        case 'UIKeyInputLeftArrow':
+            code = LEFT_KEY;
+            break;
+        case 'UIKeyInputUpArrow':
+            code = UP_KEY;
+            break;
+        case 'UIKeyInputRightArrow':
+            code = RIGHT_KEY;
+            break;
+        case 'UIKeyInputDownArrow':
+            code = DOWN_KEY;
+            break;
+        }
+
+        // console.log('     now: ' + code);
+    }
+
     if( !processingEffect && keyCodeDictionary[currentMode] && keyCodeDictionary[currentMode][code] )
     {
         return keyCodeDictionary[currentMode][code]();


More information about the Libreoffice-commits mailing list