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

OEM BULB with Housing for IBM SP-LAMP-009 Projector with 180 Day Warranty
$133.41
OEM BULB with Housing for IBM SP-LAMP-009 Projector with 180 Day Warranty pictureOEM BULB with Housing for IBM ILV300 Projector with 180 Day Warranty
$133.41
OEM BULB with Housing for IBM ILV300 Projector with 180 Day Warranty pictureOEM Original IBM High Yield Correctable BLACK Film Ribbon Reorder No. 1 299 095
$6.0
OEM Original IBM High Yield Correctable BLACK Film Ribbon Reorder No. 1 299 095 pictureIBM OEM Selectric Electric Typewriter 1280105 Replacement Spring Kit NOS
$6.99
IBM OEM Selectric Electric Typewriter 1280105 Replacement Spring Kit NOS pictureOEM CPU FAN & HEATSINK 14R0011 TSQC0039003--IBM SURE POS 4840-563 TOUCH SCREEN
$3.99
OEM CPU FAN & HEATSINK 14R0011 TSQC0039003--IBM SURE POS 4840-563 TOUCH SCREEN picture






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