
The default VKB that appears when e.g. QML TextInput gets focus.
Update 23.08.2011: There’s a more fully featured split screen keyboard implementation available here: http://talvbansal.com/2011/08/22/split-entry-on-symbian-3-devices/, check it out!
Symbian^3 has had support for split screen virtual keyboard since the beginning. However, in the first firmware versions the editors take up the whole screen when active. I don’t particularly like this behavior since it loses the context of the text input field (i.e. “what did I need to type in here?”), and if there are several text input fields in a view it may be difficult to see which field is currently active. Additionally in QML applications that tend to be graphically quite flashy the fullscreen VKB often looks a bit clumsy.
The other option on Symbian^3 is to use split screen virtual keyboard that does not cover the whole application UI, which pretty much the same as the VKB implementations on most other mobile platforms. There is an open bug report for making Qt support this, but it will only get implemented in Qt 4.7.4.
Luckily it is possible to hack the split screen VKB to appear already now on all Symbian^3 devices. You can download an example application that has two split view-enabled TextInput elements here, it should compile easily with Qt SDK 1.1. If you just want to try it out the sis file is available here. Making the split screen VKB appear instead of the fullscreen one boils down to being able to set the partial screen input flag for the text editors. Here’s a code snippet from the example application, which does exactly that:
#if defined(Q_OS_SYMBIAN)
#include <aknedsts.h>
#include <coeaui.h>
#include <coemain.h>
#include <w32std.h>
#define EAknEditorFlagEnablePartialScreen 0x200000
#endif
...
#if defined(Q_OS_SYMBIAN)
MCoeFepAwareTextEditor *fte = CCoeEnv::Static()->AppUi()->InputCapabilities().FepAwareTextEditor();
// FepAwareTextEditor() returns 0 if no text editor is present
if (fte)
{
CAknEdwinState *state = STATIC_CAST(CAknEdwinState*, fte->Extension1()->State(KNullUid));
state->SetFlags(state->Flags() | EAknEditorFlagEnablePartialScreen);
}
#endif
To make the linker happy, also a couple of libs must be added in the .pro file:
symbian:LIBS += -lcone -lws32 -lavkon -leikctl -leikcoctl -luiklaf -lform -lfepbase
After adding the stuff above the VKB now looks like this on a PR1.2 Nokia N8:
Split screen virtual keyboard in portrait and lanscape modes
Very simple, right? Well, there is a catch, or two. First of all, when the application starts and no text editors have been initialized, CCoeEnv::Static()->AppUi()->InputCapabilities().FepAwareTextEditor() returns 0, so we cannot just simply call that in the main() of our application. How I have done it is that I expose an enableSplitView() function that implements the functionality above to QML and call it in the onFocusChanged handler of the text editors. Since it’s only setting a flag this should be quite fast, albeit a bit of a hack.
Another bigger problem is that with this sort of a simple approach the QML UI has no knowledge of the whereabouts of the VKB. For example, if the text input field is at the bottom of the screen, it will get hidden behind the VKB once the VKB opens. One possibility would be to manually move the control to the top half of the screen when the VKB opens, but since there is no notification when the VKB is hidden, there’s no way to know when the view should be moved back to its original state. So in this very simple form the example is mostly usable only for the use cases where text input fields are already located in the top half of the screen.
The problems described above can most likely be fixed by making the implementation a bit more clever. Forum Nokia split view for Symbian applications wiki article shows how to handle KAknSplitInputEnabled and KAknSplitInputDisabled events in a Symbian C++ application, and I think that the same approach would work here as well. I.e. catch the events, forward them to QML and handle moving the view up or down based on the events. However, doing this might be risky and break in some weird way once Qt adds support for split screen VKB in 4.7.4. I think the very simple approach above should be relatively safe since it is only setting a state flag, but hacking deeper into Symbian land will easily cause problems in the future.