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
New Developer
Azaratur
Posts: 11
Registered: ‎01-22-2009
My Device: Not Specified

Key mapping?

Hi,
I need to convert some application (midlet) on BB, i have 2 problems:

 

1) how can i map the track ball? I can't use navigations as many of this application use command like repaint() , servicerepaint() etc.

 

2) And this is most important i see the key have really different keycode form other devices is there a sort of key table?

I need to convert it but i dunno why, i am not an "expert" on BB api.

 

Thanks

 

Aza

Developer
Posts: 432
Registered: ‎02-23-2009
My Device: Not Specified

Re: Key mapping?

You want to implement your midlet in BB native or you jsut want to use Midlet on Bb devices. If you want to use midlet on BB devices tehn you need not to implement trackwheel navigation. device will take care of it as BB support midlets and for keyevents if your midlet is high level app then it will get keyevents automatically but if low level was there then you need to implement QWERTY keyboard

 


Press the kudos button to thank the user who helped you.

If your problem was get solved then please mark the thread as "Accepted solution".

 

 

 

Deepesh Gupta
Developer
jhaehnle
Posts: 238
Registered: ‎08-26-2008
My Device: Not Specified

Re: Key mapping?

Hi,

 

1. you might can use TrackwheelListener which is deprecated but hopefully still works.

UiApplication.getUiApplication().addTrackWheelListener.....

 

2. Just map these using the Characters Class of BB Api!

net.rim.device.api.system.Characters

 

Regards,

Jochen

 

New Developer
Azaratur
Posts: 11
Registered: ‎01-22-2009
My Device: Not Specified

Re: Key mapping?

[ Edited ]

Thanks for the answer.

 

I simply need to find a solution!! :smileyhappy:

 

I already did something like this, but trackwheel (or trackball i need to support 8800 and 9000 too) doesn't feel good (it's seem "lagging" ) and i have a game that use a sort of "combo" moves that's feel really hard to do it in this way.

 

My question is, there is a way to support trackball/wheel using a midlet application?

 

EDIT:

I saw now the other message!!

I used trackwheellistener but i received only up and down.. I need all the four directions.

 

Thanks

 

Aza

Message Edited by Azaratur on 03-24-2009 07:47 AM
New Developer
chaimkut
Posts: 16
Registered: ‎07-30-2008
My Device: Not Specified

Re: Key mapping?

Azaratur - have you found a solution to the 'lagging'? I'm trying to do make use of the trackball in my MIDlet and it's very unresponsive. Thanks.

 

Chaim

New Developer
Azaratur
Posts: 11
Registered: ‎01-22-2009
My Device: Not Specified

Re: Key mapping?

No i didn't.

I mean maybe i found a better solution but trackball still not usable..

Unfortunately i am not working alone, probably my bosses will choose to skip bb devices.

 

Azaratur

Developer
jhaehnle
Posts: 238
Registered: ‎08-26-2008
My Device: Not Specified

Re: Key mapping?

Hi,

 

have a look into Canvas class of bb dev api documentation and Game Actions. Maybe usage of getGameActions might help?

 

Regards,

Jochen

New Developer
Azaratur
Posts: 11
Registered: ‎01-22-2009
My Device: Not Specified

Re: Key mapping?

Already did..
I need to let games avaiable on bb too, the main problem is the trackball not answer with precision.

 

Aza

Developer
patilajayr
Posts: 415
Registered: ‎07-28-2010
My Device: 8000

Re: Key mapping?

in j2me we use joystick but in blackberry we use trackball. so how i maping that keypade??

 

 

public interface KEY
{
	final static int NUM0					= (1 << 0);
	final static int NUM1					= (1 << 1);
	final static int NUM2					= (1 << 2);
	final static int NUM3					= (1 << 3);
	final static int NUM4					= (1 << 4);
	final static int NUM5					= (1 << 5);
	final static int NUM6					= (1 << 6);
	final static int NUM7					= (1 << 7);
	final static int NUM8					= (1 << 8);
	final static int NUM9					= (1 << 9);

	final static int UP						= (1 << 10);
	final static int DOWN					= (1 << 11);
	final static int LEFT					= (1 << 12);
	final static int RIGHT					= (1 << 13);
	final static int SELECT					= (1 << 14);

	final static int SOFT_L					= (1 << 15);
	final static int SOFT_R					= (1 << 16);
//	final static int SOFT_M					= (1 << 17);	

	final static int STAR					= (1 << 18);
	final static int POUND					= (1 << 19);

	final static int CANCEL					= (1 << 17);
	final static int FIRE					= SELECT | NUM5;

	final static int MENU_UP				= NUM2 | UP;
	final static int MENU_DOWN				= NUM8 | DOWN;
	final static int MENU_LEFT				= NUM4 | LEFT;
	final static int MENU_RIGHT				= NUM6 | RIGHT;

	//final static int MyUP					=(1<<10) | NUM2;

}

 

 

this is one key class of my j2me application. what should i do for blackberry key mapping??

help me friends.

thanks and regards,

 ajay patil.