Accessing the Maliit D-Bus API with SDL1.2 on a N9

Tue, 16 Sep 2025 12:00:00 +0000

Example code for how to access the Maliit virtual keyboard D-Bus API in an SDL1.2 application on a N9. This can be used to add text input capabilities to SDL1.2-based applications that don't use Qt.

Virtual keyboard input is mostly magically integrated when using Qt, QML or libmeegotouch on a Nokia N9. However, when using SDL1.2 or Xlib directly, the virtual keyboard isn't activated, and one has to implement support for this manually. Useful reference code can be found in the MeeGo Harmattan sources, in particular meego-im-framework-0.81.7.harmattan1+0m8 has the implementation of the keyboard process as well as gtk-input-context, a handy reference for which messages are supported.

Note that you have to use the PR 1.3 Source DVD to get the latest sources for packages, the harmattan-dev mirror usually includes slightly older versions of everything that is good enough to link/build against, but not for looking at the implementation as a reference.

An example how to interact with the virtual keyboard on an N9 with an application that uses SDL1.2 is included here. Extending this to include support for generic Xlib-based windows is left as an exercise for the reader, but it's really not that difficult, since it's using X11 window IDs in the protocol, anyway (bringing up a window quickly to focus on D-Bus communcation here was just easier with SDL 1.2, neither D-Bus nor Maliit depend on SDL, obviously).

Example source code and binary: n9-sdl-vkb.tgz

See also (some additional links for reference):

MeeGo 1.2 Harmattan PR 1.3 Source DVD (ISO, mirror)

MeeGo Harmattan Source DVDs, PR 1.1 and PR1.2 (ISO)

Maliit Open Source project (contemporary)