BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-20-2009, 10:57 AM   #1
nankerphelgue
New Member
 
Join Date: Dec 2008
Model: 8310
PIN: N/A
Carrier: Unknow
Posts: 7
Default Programming keyboard shortcuts (hotkeys)

Please Login to Remove!

Hello everybody!

I need to program keyboard shortcuts (hotkeys) in my application. I have seen this feature on Google Maps, miuTunes and ÜberTwitter.

A code snippet sample would be highly appreciated.
Offline  
Old 05-21-2009, 10:31 AM   #2
hippocamp software
Thumbs Must Hurt
 
Join Date: Feb 2009
Model: 9000
PIN: N/A
Carrier: T-Mobile
Posts: 67
Default

override keyChar in your screen class:

protected boolean keyChar(char key, int status, int time) {
boolean retval = false;
switch (key) {
case Characters.ESCAPE:
//do something
return true;
default:
retval = super.keyChar(key, status, time);
}
return retval;
}

Last edited by hippocamp software; 05-21-2009 at 10:32 AM..
Offline  
Old 05-21-2009, 11:33 AM   #3
nankerphelgue
New Member
 
Join Date: Dec 2008
Model: 8310
PIN: N/A
Carrier: Unknow
Posts: 7
Default Programming keyboard shortcuts (hotkeys) [Solved]

Quote:
Originally Posted by hippocamp software View Post
override keyChar in your screen class:

protected boolean keyChar(char key, int status, int time) {
boolean retval = false;
switch (key) {
case Characters.ESCAPE:
//do something
return true;
default:
retval = super.keyChar(key, status, time);
}
return retval;
}
Thanks it worked! (Y)
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


NETWORK INSTRUMENT GIGASTOR- 2U (2X) XEON E5-2630- 64 GB PC3 RAM picture

NETWORK INSTRUMENT GIGASTOR- 2U (2X) XEON E5-2630- 64 GB PC3 RAM

$356.99



POSEIDON XEON D-1500 PRODRIVE TECH BOX picture

POSEIDON XEON D-1500 PRODRIVE TECH BOX

$500.00



Dell Precision T3500 Desktop 12GB Ram Intel Xeon 3.07GHz (NO OPERATING SYSTEM) picture

Dell Precision T3500 Desktop 12GB Ram Intel Xeon 3.07GHz (NO OPERATING SYSTEM)

$209.97



1 pc  used   X5DPL-IGM-DC server motherboard Xeon picture

1 pc used X5DPL-IGM-DC server motherboard Xeon

$734.27



Super-Micro P4DC6+ Motherboard with 2 Xeon i processors with SCSI RAID picture

Super-Micro P4DC6+ Motherboard with 2 Xeon i processors with SCSI RAID

$200.00



 Processor Socket LGA1366 ServerCPU Matching pair Intel Xeon X5680 3.33GHz SLBV5 picture

Processor Socket LGA1366 ServerCPU Matching pair Intel Xeon X5680 3.33GHz SLBV5

$55.09







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