BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/index.php)
-   Developer Forum (http://www.blackberryforums.com/forumdisplay.php?f=15)
-   -   Programming keyboard shortcuts (hotkeys) (http://www.blackberryforums.com/showthread.php?t=190747)

nankerphelgue 05-20-2009 10:57 AM

Programming keyboard shortcuts (hotkeys)
 
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.

hippocamp software 05-21-2009 10:31 AM

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;
}

nankerphelgue 05-21-2009 11:33 AM

Programming keyboard shortcuts (hotkeys) [Solved]
 
Quote:

Originally Posted by hippocamp software (Post 1388483)
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)


All times are GMT -5. The time now is 02:10 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.