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. 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
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 =
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 TBUF { buf=""; }
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.
52 page views in the last 30 days.