Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Defining shortcut keys for a Symbian app

From Wiki
Jump to: navigation, search

This code snippet shows how to create hotkeys/shortcutkeys in your Symbian C++ application; Shortcut keys allow you to invoke a commands using arbitrary key-press combinations, and are useful for applications that run on devices with keyboards.

Article Metadata
Article
Created: vasant21 (10 May 2007)
Last edited: hamishwillee (25 Jan 2012)

Source code

Application shortcut keys are defined in a HOTKEYS resource your application's .rss file.

RESOURCE HOTKEYS r_yourapplicationname_hotkeys
{
control =
{
HOTKEY
{
command = EEikCmdExit;
key = "e";
}
};
}

The application's shortcut keys are defined in a HOTKEYS resource, identified by the symbolic ID r_yourapplicationname_hotkeys, which ties in with the symbolic ID given below in the EIK_APP_INFO resource:

RESOURCE RSS_SIGNATURE { }
RESOURCE TBUF { buf=""; }
 
RESOURCE EIK_APP_INFO
{
menubar = r_yourapplicationame_menubar;
hotkeys = r_yourapplicationame_hotkeys;
}

The RSS_SIGNATURE allows to specify version information, but its not used here. The TBUF allows to specify a friendly name for default file, it is also not used here , since this isn't a file-based application.Of more interest is the EIK_APP_INFO resource, which, in this case, identifies the symbolic resource IDs of the menu and shortcut keys.

This page was last modified on 25 January 2012, at 03:01.
46 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×