Skip to content

xpbluesmile/QtFreeVirtualKeyboard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QtFreeVirtualKeyboard

A QML based on screen virtual keyboard for embedded QML applications.

Screenshot

As soon as you implement your first QML application for an embedded touchscreen device, you will notice, that the open source version of Qt lacks a virtual on screen keyboard. I'm an experienced Qt developer, but I'm a complete newbie when it comes to QML programming. I'm a great fan of the Beaglebone Black embedded Linux device and I just ordered a capacitive touchscreen device for my bone. I started learning QML to create an example application for my Beaglebone. I quickly realized that an important essential piece was missing for entering text and values: a virtual on screen keyboard for embedded QML applications - that means for applications without a window manager like X11 or Wayland.

There is a nice solution for Qt Enterprise version: Qt Virtual Keyboard. The documentation also comes with a nice technical guide that shows how they implemented the virtual keyboard. They implemented QPlatformInputContextPlugin and QPlatformInputContext interfaces. I googled a little bit to find a similar open source solution and found the fantastic blog post from Tomasz Olszak. He did a virtual keyboard mockup for Qt applications on systems with a window manager (Windows or Linux Desktop). Interesting for me was the fact, that he also implemented QPlatformInputContextPlugin and QPlatformInputContext to provide its on screen keyboard. So it seems to be the right way for implementing a virtual keyboard. The UI of Tomasz implementation was completely QML based - so it was perfectly suited for integration into QML applications.

Long story short, I simply copied his code and modified it, to enable integration into embedded QML applications without window manager. I added a little bit of functionality (i.e. character preview popup, or automatic scrolling of flickable elements if keyboard overlaps focused input element). So I have to say a big thank you to Tomasz Olszak for providing a nice virtual keyboard mockup. The example application in examples/qmlapp has been copied from the Qt Virtual Keyboard example. I only did some minor modifications to run the example with my Virtual Keyboard implementation instead of the Qt Enterprise Virtual Keyboard.

This implementation is far from feature complete. But I think it is a starting point for people that need to implement virtual keyboard support for QML applications. Keep in mind that I'm a QML newbie and that my QML is far from beeing perfect. So if you find something in my QML code that could be done better, then please tell me or send me a pull request.

About

A QML based on screen virtual keyboard for embedded QML applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 49.1%
  • QML 37.9%
  • Shell 10.4%
  • QMake 2.0%
  • C 0.6%