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

Exfo FTB-9100 1X12 OPTICAL Switch Module for FTB-300 & FTB-400 Mainframe
$1250.0
Exfo FTB-9100 1X12 OPTICAL Switch Module for FTB-300 & FTB-400 Mainframe  pictureHP 16702A-003 Logic Analyzer Mainframe w/ 2 x 16716A Analyzer modules
$1000.0
HP 16702A-003 Logic Analyzer Mainframe w/ 2 x 16716A Analyzer modules pictureALCATEL-LUCENT 9500 MPR 8-SLOT MICROWAVE MAINFRAME +2*CSM 2*P8ETH MPT-ACC MODULE
$599.99
ALCATEL-LUCENT 9500 MPR 8-SLOT MICROWAVE MAINFRAME +2*CSM 2*P8ETH MPT-ACC MODULE pictureALCATEL-LUCENT 9500 MPR 8-SLOT MAINFRAME w/ 2*CSM 2*EASv2 2*SDH-ACC 2*P32E1DS1
$699.99
ALCATEL-LUCENT 9500 MPR 8-SLOT MAINFRAME w/ 2*CSM 2*EASv2 2*SDH-ACC 2*P32E1DS1 pictureAbacus Zarak 82-00132 - 7-Slot Portable Mainframe PI Card w/ (6) Ver. 23 PCG
$5000.0
Abacus Zarak 82-00132 - 7-Slot Portable Mainframe PI Card w/ (6) Ver. 23 PCG  picture






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