BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-15-2007, 02:44 PM   #1 (permalink)
New Member
 
Join Date: Dec 2006
Model: 7100T
Carrier: Standard
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Keyevent handler in Blackberry

Please Login to Remove!

Hello Everybody,

Until now I developed Symbian OS in C++. So, I'm new in Blackberry. Which class I have to inherit to monitor the device keyevents?
I want to create an application, but I do not want to use the standard menu. I want to create custom menu using my keycodes.

Thank you in advance.
Best regrads,
Lorand
Offline  
Old 10-16-2007, 02:51 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

implement net.rim.device.api.system.KeyListener

here is an example that works like a numeric input filter extended with some extra:

Code:
    public boolean keyChar(char key, int status, int time) {
        boolean retval = false;
        Field field = getLeafFieldWithFocus();
if (field == numberField) {
switch(key) {
                case Characters.LATIN_SMALL_LETTER_W:
                    retval = true;
                    super.keyChar(Characters.DIGIT_ONE, 32768, 0);
                    break;
                case Characters.LATIN_SMALL_LETTER_E:
                    retval = true;
                    super.keyChar(Characters.DIGIT_TWO, 32768, 0);
                    break;
//more switches
default:
                if (!retval) super.keyChar(key, status, time);       
        }
       
        return retval;        
    }
__________________
java developer, Devinto, hamburg/germany
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Lot 13 Cellphones / Smartphones USED Android/Blackberry/LG/Samsung ALL Turn on
$30.0
Lot 13 Cellphones / Smartphones USED Android/Blackberry/LG/Samsung ALL Turn on picture5Pack Dental Orthodontic Wax Prevent Oral ulcers Wax Sheets Pink Blackberry Eus
$5.55
5Pack Dental Orthodontic Wax Prevent Oral ulcers Wax Sheets Pink Blackberry Eus pictureZebra ZQ520 Bluetooth IOS, Android, WM, BlackBerry Compatible - ZQ52-AUE0000-00
$595.0
Zebra ZQ520 Bluetooth IOS, Android, WM, BlackBerry Compatible - ZQ52-AUE0000-00 pictureGarnier Ultra Blends Henna Blackberry Conditione 175ml
$15.0
Garnier Ultra Blends Henna Blackberry Conditione 175ml     pictureGarnier Ultra Blends Henna Blackberry Shampoo 340 ml Worldwide
$19.0
Garnier Ultra Blends Henna Blackberry Shampoo 340 ml  Worldwide picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.