summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2019-02-22 18:27:01 +0200
committerTor Lillqvist <tml@collabora.com>2019-02-22 21:47:41 +0200
commit06405cae7ccd596f2e0f4dd49a3e7612a883e654 (patch)
tree5f4299b11269f089b712e908f33cf69d8b863b6b
parentcURL: follow redirects (diff)
downloadcore-06405cae7ccd596f2e0f4dd49a3e7612a883e654.tar.gz
core-06405cae7ccd596f2e0f4dd49a3e7612a883e654.zip
Handle arrow keys (from a hardware keyboard) on iOS
Change-Id: Ia5946a77215eba565c3ff8c4dfbc08b95af493c0
-rw-r--r--filter/source/svg/presentation_engine.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js
index cfbbc86f9b69..7e0fdfb87877 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]();