This document describes how to disable hardware key shortcuts when none of the items in a list are highlighted.
If an application has item-specific hardware key shortcuts, they must be disabled when there are no visible highlights in lists.
Applications must retrieve the list highlighted state using the CEikMenuBar::ItemSpecificCommandsEnabled() function. The function returns ETrue when item-specific commands are enabled in the menu bar (that is, a list has highlighted options) and EFalse when they are disabled (the list does not have highlighted options).
For example, considering that an application supports single-tap, the following code enables the delete action only if the call to ItemSpecificCommandsEnabled indicates that an item is currently focused.
TBool CLogsRecentListView::ProcessKeyEventL(
const TKeyEvent& aKeyEvent,
TEventCode aType )
{
if( aType == EEventKey )
{
if(
MenuBar()->ItemSpecificCommandsEnabled()
&& aKeyEvent.iCode == EKeyBackspace )
{
HandleCommandL( ELogsCmdMenuDelete );
return ETrue;
}
}
}
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.