File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes Blackberry Trackball Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Blackberry Trackball Help" Watch "Blackberry Trackball Help" New topic

Blackberry Trackball Help

Keith Fox

Joined: Jan 10, 2010
Posts: 2
First, I have already searched the previous posts with no luck.

I am new to J2ME programming.

My program runs without errors on the blackberry "actual phone", as well as several other phone emulators.

My problem lies with receiving input from the trackball.

I've scoured the web trying to find information about this, and am only more confused.

I am trying to stay away from any RIM-specific API's so the game is more portable.

I found information stating I have to capture the input from the GameCanvas or Canvas "LEFT, RIGHT, UP, DOWN". There is also supposed to be a way to capture the trackball being pressed without the RIM-specific API's.

Can anyone give me a code snippet that basically shows how to do this working off of ";"?

Thanks in advance,
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

I don't think a trackball is an expected standard control in J2ME. You may be stuck with using RIM-specific stuff. Of course, since a trackball can be represented as an HID device firing off a limited set of events, there might be a standard set of input events that it maps to. But to know for sure, I'd have to Google for it, and I wouldn't want to deprive you of the challenge of doing that yourself!

An IDE is no substitute for an Intelligent Developer.
Keith Fox

Joined: Jan 10, 2010
Posts: 2
"I've scoured the web trying to find information about this, and am only more confused."

I google'd for this for several hours actually. I found information that it "could" be done, but never any actual code listings.

I will probably go ahead and use the RIM API's. I figure I can design the program in both versions side-by-side in Netbeans for standard J2ME and eclipse for BB specifically, RIM decided support the Eclipse JDE over Netbeans for some reason.

Keith Fox
I agree. Here's the link:
subject: Blackberry Trackball Help
It's not a secret anymore!