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. Thanks for all your past and future contributions.

Split view input in Symbian C++ applications

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleArticle
Created: ltomuta (12 Oct 2010)
Last edited: hamishwillee (30 May 2013)
Featured Article
17 Oct



The Symbian^3 UI Style Guide document available on this site introduces a new input method, the "split view" (section 6.2.7). Unlike the traditional full screen virtual keyboard used in Symbian^1 (S60 5.0) , which hides completely the application when opened, the new input mode allows developers to retain control over the upper side of the screen, where they can show their own UI,optimized so that the view is focused on the editor which is currently receiving the keyboard input. If the real estate available for the application can accommodate

How can this input mode be enabled for your application?

  • Step one: identify the editor component which will receive input in split mode and set the EAknEditorFlagEnablePartialScreen flag for it. If the flag is not set to the editor (iEditor1's case), the default mode for opening the virtual keyboard is in full screen.
void CSplitScreenKeyboardContainer::ConstructL( 
const TRect& aRect,
const CCoeControl* aParent,
MEikCommandObserver* aCommandObserver )
if ( aParent == NULL )
SetContainerWindowL( *aParent );
iFocusedControl = NULL;
iCommandObserver = aCommandObserver;
// enable split view input for this editor
SetRect( aRect );
// [[[ begin generated region: do not modify [Post-ActivateL initializations]
// ]]] end generated region [Post-ActivateL initializations]
  • Step two: be ready to handle the resource change notifications with types KAknSplitInputEnabled and KAknSplitInputDisabled. These change notifications are received when the split view keyboard is shown/hidden on the screen, and it is your responsibility to ensure that the application is aware if the client area resize.
void CSplitScreenKeyboardAppUi::HandleResourceChangeL( TInt aType )
CAknViewAppUi::HandleResourceChangeL( aType );
// [[[ begin generated region: do not modify [Generated Code]
// ]]] end generated region [Generated Code]
if ( aType == KAknSplitInputEnabled )
// notify the view that client rectangle has changed, set the app in split kb mode
iSplitScreenKeyboardContainerView->SetHalfKB(ETrue, ClientRect());
// hiding the status pane gives more space for the application above the VKB
StatusPane()->MakeVisible( EFalse );
else if ( KAknSplitInputDisabled == aType )
// restore normal view, with status pane and full size client rectangle
StatusPane()->MakeVisible( ETrue );
iSplitScreenKeyboardContainerView->SetHalfKB(EFalse, ClientRect());

Warning.pngWarning: It is important to note that you are not allowed to change the focus state of your components when handling the change notifications of these two resource types. A focus change at this point will generate an infinite loop in the FEP.

  • Step three: update the layout of your current view, to take best advantage of the new real estate. Remember to place the editor which is currently receiving the focus in first plan, so that the user understands that the keyboard is linked to the highlighted editor, and that input will be directed there. You can otherwise use the rest of the client area as you see fit in your application.
void CSplitScreenKeyboardContainer::SizeChanged()
// [[[ begin generated region: do not modify [Generated Contents]
// ]]] end generated region [Generated Contents]
// create normal layout
TRect rect = Rect();
iEdit1->SetExtent( rect.iTl, TSize( rect.Width(), rect.Height()/2-5) );
iEdit2->SetExtent( TPoint( rect.iTl.iX, rect.iTl.iY + rect.Height()/2+5 ), TSize( rect.Width(), rect.Height()/2-5) );
// create a layout focused on the editor receiving the input
TRect rect = Rect();
// not visible in this mode
iEdit2->SetRect( rect );

APIs used

There are no new APIs needed for supporting this experimental feature. The flag EAknEditorFlagEnablePartialScreen is defined in eikon.hrh, but the two resource types are defined in non-SDK file so if you decide this feature you will have to define them in your app.

// Message used to inform split input status
#define KAknSplitInputEnabled 0x2001E2C0
#define KAknSplitInputDisabled 0x2001E2C1

Example project



a) The application in normal view,with both editors visible. iEdit2 is the text editor component at the bottom of the screen.

SplitView.PNGSplitView landscape.PNG

b) The virtual keyboard opened (in full screen mode) for editing the text in iEdit1

FullVKB.PNGFullVKB landscape.PNG

c) The virtual keyboard opened (in split mode) for editing the content of iEdit2. The application is now responsible for displaying content in the top area of the screen.

SplitVKB.PNGSplitVKB landscape.PNG

This page was last modified on 30 May 2013, at 04:40.
89 page views in the last 30 days.