Navigating controls on up and down keys
This article discusses how to add the navigation to a GUI application which is created using Container, where there is no form navigation support. In such cases we have to add navigation ourselves.
This example assumes using Carbide.c++ UI designer for the project.
Create the Symbian C++ GUI project with Designer support
Name this project "navigation".
Select the GUI design as Empty container
Accept all the defaults and then you will land up in the GUI designer
Now drag two Labels change their text to Edit1 and Edit2.
Now drag two texteditors from Editors palette, the screen looks like this:
Now select the container and right click
Now select "Show event view option" from menu. After this events window will show up. In this window double click on offerKeyEvent event and this should take the editor to the body of the event handler.
In this even handler write the following code:
if (aType == EEventKey && aKeyEvent.iScanCode == EStdKeyDownArrow)
this->iFocusControl = iEdit2;
if(aType == EEventKey && aKeyEvent.iScanCode == EStdKeyUpArrow)
this->iFocusControl = iEdit1;
Now you should be able to navigate from the one edit box to second and from second to first on pressing up and down arrow keys
The basic idea is to handle these key events and then change the focus from one control to the second control.