Search code examples
blackberryjava-mesoft-keyboard

BlackBerry software keyboard listener on OS 4.5 (or later) compatible code


I am developing an app which supposed to work on devices that have OS 4.5 or later. In my application I need to know when the virtual keyboard is visible or invisible. Because if virtual keyboard is visible, the text area which the user is supposed to type in is behind the keyboard. If I could determine the moment of virtual keyboards state changed, I could refresh the screen and move the text area upper location.

Is there a way to do that?

Edit: the next button is at the status panel. The edit field is at the custom horizontal field manager.

enter image description here

When I touch the edit field, the virtual keyboard opens and the contents of the edit field is lost.

enter image description here


Solution

  • There is no way to do that with the same code. You need to divide your code in two. One of them handles 4.5 - 4.7. The other handles 4.7 and later.

    You can add a keyboard listener to 4.7 (and later) code that should check whether the screen changes in a continuous thread. It is not good, but it can work.