I want to do an action if a user press at the same time UP and DOWN. Is there a way to do it? I've tried to do use a list like that :
function onKeyPressed(evt)
{
btnSequence[1] = btnSequence[0];
btnSequence[0] = evt.getKey();
if (btnSequence[0] == 8 && btnSequence[1] == 13) {
// DO ACTION
}
return true;
}
function onKeyReleased(evt)
{
btnSequence = [-1, -1] as Array<Number>;
return true;
}
However the DO ACTION part doesn't seam to run and it's hard to test since you can't in the simulator press two button at once.