03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

programmers call 'hotkeys'. We decided that 'hotkeys' was too ambiguous or<br />

frightening for end users, so we chose a friendlier term to be used in the user<br />

interface, help text, and so on.<br />

Normally, a UIQ application would omit the hotkeys keyword and so not define any<br />

shortcut keys, since UIQ devices do not have a keyboard. The shortcut codes are not<br />

displayed in UIQ application menus, and are only usable while running the application in the<br />

emulator (which is the only reason for including one in this example).<br />

A UIQ application can specify a button bar by means of a toolbar keyword in the<br />

EIK_APP_INFO resource. I haven't included one here, since hellogui is a minimal<br />

application, but you will see examples of how this is done in later chapters.<br />

4.5.2 Defining the Shortcut Keys and the Menu<br />

The application's shortcut keys are defined in a HOTKEYS resource, identified by the<br />

symbolic ID r_hellogui_hotkeys, which ties in with the symbolic ID given above in the<br />

EIK_APP_INFO resource:<br />

RESOURCE HOTKEYS r_hellogui_hotkeys<br />

}<br />

{<br />

control =<br />

{<br />

HOTKEY<br />

};<br />

Note<br />

{<br />

command = EEikCmdExit;<br />

key = "e";<br />

}<br />

Those upper and lower case letters can make you seasick. The reason for<br />

them is lost in the mists of time: the resource compiler predates Symbian OS<br />

by several years.<br />

The syntax is a bit bizarre (control = identifies all shortcut keys identified by a Ctrl+ key<br />

combination, so that EEikCmdExit is on Ctrl+E ).<br />

As I pointed out earlier, you would not normally be defining shortcut keys for a UIQ or Series<br />

60 application, given that these devices do not have keyboards.<br />

Symbian OS menus don't support the kind of shortcut keys found in Windows and other<br />

desktop systems that allow you to select File | Close using Alt+F, C. In Symbian OS<br />

applications for UIs that support their use, you either have to use the shortcut key (e.g.<br />

Ctrl+E – and displayed as such alongside the corresponding menu item) or navigate<br />

manually to the item.<br />

Note<br />

We considered the Windows way seriously but rejected it on the grounds<br />

that it makes the menus look ugly, and most average Windows users don't<br />

understand what the underscores mean anyway. [Displaying shortcuts in the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!