keyListener "escape" and "enter".

I have a few buttons on a global popupscreen. The first time I found [ENTER] works but [ESC] cannot close the anti-pop. So I add

public boolean keyChar(char key, int status, int time) {
       //intercept the ESC key - exit the app on its receipt
       if (key == Characters.ESCAPE)
           close();
       return false;
   }

to close the anti-pop and it works well. But after that [ENTER] may not work. I don't know how to do so that he can still come back to listen to the rating. The full code is as follows:

final class pScreen extends PopupScreen implements KeyListener {
   public pScreen()
   {
     ...
       class addlistener implements FieldChangeListener {
     ...
       }
       class addlistener2 implements FieldChangeListener {
     ...
       }
       myButton.setChangeListener(new addlistener());
       myButton2.setChangeListener(new addlistener2());
   }
   public void close() {
       UiApplication.getUiApplication().popScreen(this);
   }
   public boolean keyChar(char key, int status, int time) {
      if (key == Characters.ESCAPE)
           close();
       if (key == Characters.ENTER)
           // How to do here so that I can still listen my buttons?
       return false;
   }

All aid should be assessed.

Fix your code as follows:

   public boolean keyChar(char key, int status, int time) {
       //intercept the ESC key - exit the app on its receipt
       if (key == Characters.ESCAPE)
           close();
       return super.keyChar(key, status, time);
   }

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • How can I get rid of FastSaler who has become embedded in Firefox?

    Somehow Fastsaler himself has integrated into Firefox. McAfee may not get rid of it and cannot Antispyware. I'm going crazy trying to get rid of him. Do I just uninstall Firefox and reinstall?

  • icloud apple ID

    So, I have forgotten my security questions answers/format and no longer have access to my e-mail address of relief. What can I do?

  • Need drivers of Windows XP Home for Satellite C650D - 11K

    Hello where can I find all the drivers for Windows Xp for my Satellite C650D - 11K? I saw something on the Support page & Toshiba drivers, but the question is: if originally, it installed Windows 7 64 bit, how I can install all drivers for Win Xp (32

  • Satellite Pro 6100 memory upgrade

    I don't have a model of toshiba satellite pro 6100: PS610L-04NVN of Singapore and it currently has 256 MB of pc2100 memory installed and I am wanting to install another 256 so I have 512, but now I would like to know: 1. If I get the memory of a vend

  • Windows update error 0xC8000643

    Windows update error 0xC8000643 Computer want updated