Venu 4 behaviourDelegate is starting onKey() if swipe to right on real device (in simulator it works correct). Below see code sample. On real device if swiped short distance from the edge, onKey() is started (key = KEY_ESC). If swiped long distance from left to right, both onkey() (key = KEY_ESC) and onSwipe() (swipe = SWIPE_RIGHT) is started. onBack() is allways returned false (back is set to "true" always).
var back = false;
var swipe = false;
var key = false;
var first = ":";
class StartDelegate extends Ui.BehaviorDelegate {
function initialize() {
BehaviorDelegate.initialize();
}
function onBack() {
back = true;
Ui.requestUpdate();
return false; // exclude esc key here, done in onKey section
}
function onActionMenu() {
back = false;
swipe = false;
key = false;
first = ":";
Ui.requestUpdate();
return true;
}
function onSwipe(evt) {
swipe = evt.getDirection();
first += "onSwipe ";
Ui.requestUpdate();
return true;
}
function onKey(evt) {
key = evt.getKey();
first += "onKey ";
Ui.requestUpdate();
return true;
}
}
screenshot is showing
back
swipe
key
first
after a single swipe from left to right.
