diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-D7E279EE-05F5-4E82-AF25-1E10FF50FABA.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-D7E279EE-05F5-4E82-AF25-1E10FF50FABA.dita Tue Mar 30 11:56:28 2010 +0100 @@ -0,0 +1,75 @@ + + + + + +Handling +the Middle Soft Key and Enter Key in AVKON listsThis document describes how to handle the Middle Soft Key (MSK) +and Enter keys in AVKON lists. +

If an application +handles the list targeted MSK or Enter Key events (EKeyOK and EKeyEnter), +for example, in the ProcessKeyEventL() function, the handling +of these key events must be moved to the listbox observer function HandleListBoxEventL(). +The MSK or Enter Key event related action must be performed when an EEventEnterKeyPressed event +is received. This way the list item-specific action is performed on a key +event only when there is an option highlighted in the list.

+
    +
  • Remove key event handling code from ProcessKeyEventL.

    TBool CLogsDetailView::ProcessKeyEventL( +const TKeyEvent& aKeyEvent, +TEventCode aType ) +{ + if( aType == EEventKey ) + { + switch( aKeyEvent.iCode ) + { + ... +//------ Remove this code------------- +// case EKeyOK: +// case EKeyEnter: +// Select key pressed +// CmdContextMenuL(); +// return ETrue; + +//-------------------------------------- + ... + default: + break; + } + } +
  • +
  • Add key event handling code to HandleListBoxEventL.

    void CLogsBaseView::HandleListBoxEventL( +CEikListBox* aListBox, +TListBoxEvent aEventType) +{ + ... + switch ( aEventType ) + { + ... +//---------Add MSK and enter key handling code---------------- + case EEventEnterKeyPressed: + { + TInt commandId( Cba()->ButtonGroup()->CommandId( + CEikButtonGroupContainer::EMiddleSoftkeyPosition ) ); + ProcessCommandL( commandId ); + break; + } +//-------------------------------------------------------------- + ... + default: +// HW key shortcuts + break; + } +} + + +... +} +
  • +
+
\ No newline at end of file