Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ercp-dev] Virtual keyboard handling API proposal

Please vote on whether to incorporate the following change into the Mobile Extensions specification:

Some mechanism is required to give applications control over the display of
virtual keyboards when a widget gains focus. (See bug 106486). The mechanism
granting the most control is that of a  listener which can respond yes or no
regarding the display of the virtual keyboard whenever a widget  capable of
text input gains focus. It seems to me that this, being a mobile device
specific feature, is best located in the MobileDevice class.


 MobileDevice {
  void addVirtualKeyboardListener(VirtualKeyBoardListener vkbdl);
  void removeVirtualKeyboardListener(VirtualKeyBoardListener vkbdl);
 }

 VirtualKeyBoardListener {
  /* the following method returns one of:
   VIRTUAL_KEYBOARD_SHOW
   VIRTUAL_KEYBOARD_HIDE
   VIRTUAL_KEYBOARD_DEFAULT
  */
  int queryShowKeyboard(Widget widgetGainingFocus);
 }

 Expected operation:
  If a VirtualKeyboard listener is added, then MobileDevice will monitor focus events. When a widget is gaining focus, the listener's query method is called to determine whether to display the virtual keyboard. Otherwise, a default policy is implemented.
  The default policy will examine whether a real keyboard is present or attached and cause the virtual keyboard to display accordingly.




Back to the top