Commit 782c5949 authored by Peter's avatar Peter

Mobile Backport: Cursor keys emulate swipe gestures

First we touch the screen and later swipe (fling) in the direction of the key pressed
parent 8a6a317f
......@@ -462,6 +462,26 @@ public class Forge implements ApplicationListener {
if (keyCode == Keys.SHIFT_LEFT || keyCode == Keys.SHIFT_RIGHT) {
shiftKeyDown = true;
}
// Cursor keys emulate swipe gestures
// First we touch the screen and later swipe (fling) in the direction of the key pressed
if (keyCode == Keys.LEFT) {
touchDown(0,0,0,0);
return fling(1000,0);
}
if (keyCode == Keys.RIGHT) {
touchDown(0,0,0,0);
return fling(-1000,0);
}
if (keyCode == Keys.UP) {
touchDown(0,0,0,0);
return fling(0,-1000);
}
if (keyCode == Keys.DOWN) {
touchDown(0,0,0,0);
return fling(0,1000);
}
if (keyInputAdapter == null) {
if (KeyInputAdapter.isModifierKey(keyCode)) {
return false; //don't process modifiers keys for unknown adapter
......
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