Acknowledged

keyEvent.getKey() == 4 short vrs long pressed

Hi! I have the following problem, you might know the reason/solution.

I have the following code line:  if (keyEvent.getKey() == 4) {onSelect_lauch();}

I found that, in the simulator, for several devices, when I press the "Start-Stop buttom" (Key 4), if I press it long (not just one click but a "long" click), it launches properly the function but if I press it short, I gives me the typical error "Symbol Not found Error". It is an App (not a widget).

Error: Symbol Not Found Error

Details: Failed invoking <symbol>

Stack:

Do you know why and how to solve it?

Thanks!

Parents
  • Seems that the following code works well:

    public function onKeyReleased(evt as KeyEvent) as Boolean {
            var key = (evt.getKey());
            if (key == WatchUi.KEY_ENTER) {
                onSelect_Battle();
            }
            return true;
        }
Comment
  • Seems that the following code works well:

    public function onKeyReleased(evt as KeyEvent) as Boolean {
            var key = (evt.getKey());
            if (key == WatchUi.KEY_ENTER) {
                onSelect_Battle();
            }
            return true;
        }
Children