To enable a view to receive key events, add a view to the control stack using the following method. This method adds a control into the application UI's control stack.
Note: Ensure that the view is constructed before adding it to the control stack.
IMPORT_C void AddToStackL( const MCoeView& aView, CCoeControl *aControl, TInt aPriority=ECoeStackPriorityDefault, TInt aStackingFlags=ECoeStackFlagStandard );
The following code snippet shows adding a view to the control stack:
/** Add aControl to Cone's control stack with priority aPriority and behaviour aStackingFlags.\n */ void CNewView::AddToStackL( CCoeControl* aControl, TInt aPriority, TInt aStackingFlags ) { iCCoeAppUi.AddToStackL( *this, aControl, aPriority, aStackingFlags); }
For more information on writing control stack, see How to write controls.