[Vm-dev] Got soft keyboard working to some degree on Android

Dimitry Golubovsky golubovsky at gmail.com
Fri Feb 25 04:46:55 UTC 2011


I got the soft keyboard working with Squeak on a Pandigital Novel 9"
tablet (Android 2.0).

I had to add call to view.setFocusableInTouchMode(true) in the end of
the onCreate method of SqueakActivity. Without that, the activity view
could not get keyboard focus, even when touched. I haven't tested
whether the focus is restored properly when activity changes its
state, but such change may require more support anyway.

See here *:


I also changed the SqueakView class so that the physical "Menu" button
toggles the soft keyboard. I wish it did not take so much screen space


One thing I cannot figure out: how to send an event for BackSpace key.

The following works for alphanumerics (event is the second argument of
View.onKeyDown method):

                                int uchar = event.getUnicodeChar();
                                vm.sendEvent(   2 /* EventTypeKeyboard */,
                                                0 /* timeStamp */,
                                                uchar /* charCode */,
                                                0 /* EventKeyChar */,
                                                0 /* modifiers */,
                                                uchar /* utf32Code */,
                                                0 /* reserved1 */,
                                                0 /* windowIndex */);

Characters typed on the soft keyboard appear e. g. in a workspace
where a cursor is blinking, window frame becomes red, etc. which means
input works. But pressing DEL does not have any effect.  Enter works
(cursor moves to newline) What values should I put into the
sqInputEvent structure for DEL?

Thanks for any ideas.

* I forked the squeak-android-vm project into
http://code.google.com/p/squeakvm-tablet This project space has not
been set up properly yet in terms of documentation; I just wanted to
share my findings with other possibly interested developers.

Dimitry Golubovsky

Anywhere on the Web

More information about the Vm-dev mailing list