Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 22
Registered: ‎12-01-2009
My Device: Not Specified

Trackball function is broken after usage in my midlet with

Hi,

 

I have a Midlet MIDP2.0 where I use the trackball to move an image:

 

I access the trackball movement with getKeyStates() from GameCanvas

and move the Sprite.

 

However, thereafter the trackball is not working anymore, even after

stopping the midlet and restarting it.

Also after shutdown of the BlackBerry and restart the trackball is not working

any more inside the Midlet.

 

After taking out the battery, reboot, and starting the midlet the trackball works

fine again.

 

I have upgraded the 8800 to v4.5 but this didn't help.

 

On Nokia and SonyEricsson the same code works fine.

 

Is this a known issue?

 

Thanks

Marcel

BlackBerry Development Advisor
Posts: 15,808
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Trackball function is broken after usage in my midlet with

I haven't heard of this issue before.  Are you saying after you capture a single movement you don't receive any further trackball movements?  If not, what triggers the failure or what action happens before it stops working?

 

Does it stop working altogether or just within your MIDlet?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Posts: 22
Registered: ‎12-01-2009
My Device: Not Specified

Re: Trackball function is broken after usage in my midlet with

One step further:

 

-> It works now with the BlackBerry Emulator

-> It still does *not* work in the real BlackBerry 8800

 

The change I have made to get it running on the emulator:

 

==========================

public class MapCanvas extends GameCanvas implements Runnable {
  public MapCanvas() {

    // Works fine to move sprite in BlackBerry emulator, WTK emulator, k320i but NOT on real BlackBerry:
    super(false);

 

    // Works fine in WTK emulator and Nokia devices, Sony Ericcson devices, kills TrackBall with BlackBerry:
    //super(true);
...

==========================

 

So changing the GameCanvas ctor from true to false resolved it on emulator but not on real BB device:

 protected GameCanvas(boolean suppressKeyEvents);

 

This is strange,

 

thanks

Marcel