Skip to main content

LWUIT 1.5 disabling virtual keyboard makes text input unusable on Nokia touch devices

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
4 replies [Last post]
mzorz
Offline
Joined: 2008-04-28

Hi all,

I was trying out the newly released LWUIT 1.5 distribution on Nokia touch devices (particularly S60 5th edition such as 5800, X6, 5230, etc.). I need the phone's native virtual keyboard to show up as it was in LWUIT 1.4, but for some reason it doesn't happen.

I have this in my init code:

Display.getInstance().setDefaultVirtualKeyboard(null);

(followed instructions from here): http://stackoverflow.com/questions/6692299/how-to-disable-lwuit-vkb

But it doesn't work. Now when you touch a TextField or TextArea, no keyboard is shown up.

What am I doing wrong? How can I just have the old behavior back?

Thanks in advance

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

A native VKB can't be shown for a MIDP application which is why we built our own. It can only work for devices such as RIM 5.0 or newer and Android devices.

mzorz
Offline
Joined: 2008-04-28

Hi vprise, thanks for your answer.

>A native VKB can't be shown for a MIDP application which is why we built our own. It can only work for devices such as RIM 5.0 or newer and Android devices.

But it was working on LWUIT 1.4, (a click on a Lwuit's TextArea component would bring the native MIDP TextField implementation with the native keyboard and so on) shouldn't it work likewise in version 1.5 of LWUIT? How can I achieve the same in 1.5 on Nokia S60 5th edition (touch) devices?

Thanks

vprise
Offline
Joined: 2003-11-07

I'm sorry, it seems I misunderstood the issue because it was phrased as a VKB issue which never really worked. What should work is native editing which has nothing to do with the VKB and it was broken just a couple of weeks before the release. This is a regression due to a fix for RIM touch devices which we missed because the LWUIT demo was changed to remove the text area components (which is why our QA missed it).

This seems to be a big enough issue to warrant a 1.5.1 bugfix release, we are investigating the logistics of releasing that. In the meantime a patch should be as simple as deriving TextArea and using a subclass as illustrated here. Thanks.

<br />
class TextAreaPatch extends TextArea {<br />
    // insert constructors here</p>
<p>    public void pointerReleased(int x, int y) {<br />
        // prevent a drag operation from going into edit mode<br />
        if (isDragActivated()) {<br />
            super.pointerReleased(x, y);<br />
        } else {<br />
            if (isEditable() && isEnabled() && !isCellRenderer()) {<br />
                Display.getInstance().editString(this, getMaxSize(), getConstraint(), getText());<br />
            }<br />
        }<br />
    }<br />
}<br />

BTW this is already fixed (differently) in SVN as of today.

mzorz
Offline
Joined: 2008-04-28

vprise wrote:

I'm sorry, it seems I misunderstood the issue because it was phrased as a VKB issue which never really worked. What should work is native editing which has nothing to do with the VKB and it was broken just a couple of weeks before the release. This is a regression due to a fix for RIM touch devices which we missed because the LWUIT demo was changed to remove the text area components (which is why our QA missed it).

This seems to be a big enough issue to warrant a 1.5.1 bugfix release, we are investigating the logistics of releasing that. In the meantime a patch should be as simple as deriving TextArea and using a subclass as illustrated here. Thanks.

<br />
class TextAreaPatch extends TextArea {<br />
    // insert constructors here</p>
<p>    public void pointerReleased(int x, int y) {<br />
        // prevent a drag operation from going into edit mode<br />
        if (isDragActivated()) {<br />
            super.pointerReleased(x, y);<br />
        } else {<br />
            if (isEditable() && isEnabled() && !isCellRenderer()) {<br />
                Display.getInstance().editString(this, getMaxSize(), getConstraint(), getText());<br />
            }<br />
        }<br />
    }<br />
}<br />

BTW this is already fixed (differently) in SVN as of today.

Great, thanks a lot vprise, I'll try that then! :) Hope you can release 1.5.1 soon.

Keep it up, LWUIT is awesome, cheers for that

Best regards