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.
How to send keypresses to another application
This short code sample demonstrates sending the Shift+Ctrl+T keypress to System( ER5 Platform). On English machines this will have the effect of alternating the "Title position" setting between "Top of columns" and "Left of columns". Note that the caption of 'System' may be different on non-English devices, and it would therefore be better to use the target application's UID in a real-world product.
event.iModifiers=EModifierCtrl | EModifierShift;
event.iCode=CTRL('t'); // defined in COEDEF.H
User::Leave(KErrNotFound);task.BringToForeground(); // So we can see the results
Other keypress examples could include:
The letter "P":