Kaydet (Commit) dabadf7c authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Handle arrow keys (from a hardware keyboard) on iOS

Change-Id: Ia5946a77215eba565c3ff8c4dfbc08b95af493c0
üst 9aa75976
......@@ -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]();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment