I initialized the VKBImplementationFactory
in startApp()
:
public void startApp() {
VKBImplementationFactory.init();
Display.init(this);
new MenuPrincipalForm(this).show();
}
I created also a VirtualKeyboard in a Form :
...
private VirtualKeyboard vkNombre = new VirtualKeyboard();
...
vkNombre.setInputModeOrder(new String[]{VirtualKeyboard.NUMBERS_SYMBOLS_MODE});
And I bound this VirtualKeyboard to a TextField :
cintxt=new TextField();
VirtualKeyboard.bindVirtualKeyboard(cintxt, vkNombre);
I registered dataChangeListener
to this TextField :
public class ModifierFicheClient extends Form implements ActionListener, DataChangedListener
{
...
cintxt.addDataChangeListener(this);
...
}
In the dataChanged(int type, int index)
method I want to open the vkNombre
VirtualKeyBoard. I know that when clicking the TextField
then the VirtualKeyboard
is shown automatically. But there is a case when navigating to the TextField
through the phone mobile scroll softbuttons then I can navigate to the TextField
without clicking it and I can type any letters ! So how to call the VirtualKeyboard
when typing a letter on the phone mobile ?
NB : I wrote System.out.println("zzzz");
in the dataChanged(int type, int index)
method and the output writes two lines "zzzz" when I type one character
! So why the dataChanged
method is called two times
when I type only one letter ?