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
javec
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified
Accepted Solution

Convenience Key Character

Hello,

I was trying to figure out what character the left/right side key has. I would need to intercept that in an application like this:

 

public boolean keyChar(char key, int status, int time){ boolean retval = false; switch (key) { case Characters.<<<< SideKeyCharacter?? >>>>: //Action retval = true; break; } return retval; }

 

Is it possible to do that?  Characters like A and B... work.

 

 

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Please use plain text.
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Convenience Key Character

Keypad.KEY_CONVENIENCE_1

Keypad.KEY_CONVENIENCE_2

 

Available in 4.2.0+

Please use plain text.
Developer
jhfisher
Posts: 16
Registered: ‎07-14-2008
My Device: 8310

Re: Convenience Key Character

thanks for this - in a previous project over a year ago we resorted to creating two helper applications users could assign to the convenience keys that talked to our main app... I was just about to the same thing for a new project so you've saved me from wasting a lot of time

 

cheers,

jon 

Please use plain text.
Developer
javec
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Convenience Key Character

I tried this:

 

case Keypad.KEY_CONVENIENCE_1: Dialog.alert("Convenience 1 clicked"); retval = true; break;

 but it does not work. Did I do something wrong?

 

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Please use plain text.
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Convenience Key Character

[ Edited ]

Those are key constants, not characters. Look at the Keypad method summary for converting between key constants / keycodes / characters.

 

Message Edited by mreed on 07-18-2008 10:56 AM
Please use plain text.
Developer
javec
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Convenience Key Character

thanx mreed!

I tried this

 

Characters c1 = Keypad.map(Keypad.KEY_CONVENIENCE_1);

 

 but it does not work! Is it correct to use the .map( ) function?

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Please use plain text.
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Convenience Key Character

Try Keypad.map(int key, int status). You can use the status modifiers from KeypadListener I believe.
Please use plain text.