Git Product home page Git Product logo

qtfreevirtualkeyboard's Introduction

QtFreeVirtualKeyboard

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

The following video shows the QtFreeVirtualKeyboard running on my Beaglebone Black:

Video Beaglebone Keyboard

This video is a screen capture of the QtFreeVirtualKeyboard running on a Windows PC:

Video Qt Freee Virtual Keyboard

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.

qtfreevirtualkeyboard's People

Contributors

githubuser0xffff avatar kostya-ripak avatar krussjos avatar vinifr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qtfreevirtualkeyboard's Issues

Running example on Raspbian/Raspberry

Hi, I cross compiled QT 5.5.1 and QtFreeVirtualKeyboard for Raspberry PI 2.

I copied manually the .qml files for /usr/local/qt5pi/qml/QtQuick/VirtualKeyboard and libVirtualKeyboard.so for /usr/local/qt5pi/plugins/platforminputcontexts/
But when I try to execute, return:

./virtualkeyboardqmldemo
VirtualKeyboardInputContextPlugin::create: "qtvirtualkeyboard"
�[9;0]Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
file:///home/pi/projs/QtFreeVirtualKeyboard/examples/qmlapp/MainContainer.qml:20:1: module "QtQuick.VirtualKeyboard" is not installed
import QtQuick.VirtualKeyboard 1.0
^
VirtualKeyboardInputContext::setFocusObject

QML module not found (QtQuicl.FreeVirtualKeyboard)

运行的时候结果显示:
VirtualKeyboardInputContextPlugin::create: "freevirtualkeyboard"
file:///home/root/qmlapp/MainContainer.qml:20:1: module "QtQuick.FreeVirtualKeyboard" is not installed
import QtQuick.FreeVirtualKeyboard 1.0
^
VirtualKeyboardInputContext::setFocusObject

我的尝试将lib库多处添加结果都是一样的
root@NECRO:/usr/lib# ls libFreeVirtualKeyboard.so* -la
-rwxr-xr-x 1 root root 1457416 Jun 28 08:53 libFreeVirtualKeyboard.so
lrwxrwxrwx 1 root root 25 Jun 28 09:20 libFreeVirtualKeyboard.so.1 -> libFreeVirtualKeyboard.so
lrwxrwxrwx 1 root root 25 Jun 28 09:20 libFreeVirtualKeyboard.so.1.0 -> libFreeVirtualKeyboard.so
lrwxrwxrwx 1 root root 25 Jun 28 09:20 libFreeVirtualKeyboard.so.1.0.0 -> libFreeVirtualKeyboard.so

root@NECRO:/usr/lib/plugins/platforminputcontexts# ls -la
total 2490
-rwxr-xr-x 1 root root 1422156 Jun 28 08:45 libfreevirtualkeyboardplugin.so
lrwxrwxrwx 1 root root 31 Jun 28 09:19 libfreevirtualkeyboardplugin.so.1 -> libfreevirtualkeyboardplugin.so
lrwxrwxrwx 1 root root 31 Jun 28 09:19 libfreevirtualkeyboardplugin.so.1.0 -> libfreevirtualkeyboardplugin.so
lrwxrwxrwx 1 root root 31 Jun 28 09:19 libfreevirtualkeyboardplugin.so.1.0.0 -> libfreevirtualkeyboardplugin.so

Android deployement

Hi,

Is it possible to deploy the plugin to Android?
I am able to deploy the QML files properly but I can't move the library to any ./plugins/platforminputs/. directory.

Thanks for any hint!

Conflict with qtvirtualkeyboard

Hello,

Qt has decided to change license from commercial to GPL for the QtVirtualKeyboard* plugin which is now included from the 5.7 version. Installing QtFreeVirtualKeyboard in the Qt install directory destroys everything:

  • demo installs in the original keyboard library path and removes it
  • name of the IM module qtvirtualkeyboard is now in conflict with the original and it's modules are thus not found

I've forked the project and made needed changes in order to make the installation of the QtFreeVirtualKeyboard less destructive :)

*The way I see it, QtFreeVirtualKeyboard is still interesting because of its license

module "QtQuick.FreeVirtualKeyboard" is not installed

I clone this package, and in the examples/qmlapp directory, I run make command and it compiles correctly, I got virtualkeyboardqmldemo application, I run this application, my system reports module "QtQuick.FreeVirtualKeyboard" is not installed , are there any steps missed to fire the application?

Running example on Windows

Hi,

I'm really interested to use your keyboard on Linux and Windows. First thank you so much to share your work.

But I'm not able to get it work under Windows first.

1 - First I build the src project. This produced an VirtualKeyboard.dll.
2 - I copy those file to this folders C:\Qt\5.4\msvc2013\plugins\platforminputcontexts\VirtualKeyboard
- FontAwesome.otf
- InputPanel.qml
- KeyButton.qml
- KeyPopup.qml
- qmldir
- VirtualKeyboard.dll
- VirtualKeyboard.pdb
3 - Now I open the example project and run it.

I'm always getting error about the keyboard module not found.

I have also tried putting all those file inside this directory \examples\qmlapp\VirtualKeyboard. But same problem :(

What is exactly the correct structure to use this plugin ?

Best regards,

Porting on Qt6

I took @krussjos 's branch to port source code on qt6. But I realized that even default compiling on qt5 does not render keyboard right. Please see attached image (tested on Kubuntu 22.04 ).
QtFreeVirtualKeyboard-onQt5_kubuntu_22 04

Any help, comment or pointing to the right direction would be highly appreciated.

File format not recognized

Hey, I am trying to install it on debian machine. I follow the following steps
#1 run qmake command.
#2 run make
#3 run sudo make install

Above 2 steps are working fine for me. But When I run make install it gives following error
make: Warning: File 'Makefile' has modification time 2.3 s in the future
install -m 755 -p libVirtualKeyboard.so /opt/qt5/plugins/platforminputcontexts/libVirtualKeyboard.so
strip --strip-unneeded /opt/qt5/plugins/platforminputcontexts/libVirtualKeyboard.so
install -m 755 -p VKeyboard/QtFreeVirtualKeyboard/src/InputPanel.qml /opt/qt5/qml/QtQuick/VirtualKeyboard/
strip /opt/qt5/qml/QtQuick/VirtualKeyboard/InputPanel.qml
strip:/opt/qt5/qml/QtQuick/VirtualKeyboard/InputPanel.qml: File format not recognized
Makefile:1252: recipe for target 'install_deployment' failed
make: [install_deployment] Error 1 (ignored)
install -m 755 -p VKeyboard/QtFreeVirtualKeyboard/src/KeyButton.qml /opt/qt5/qml/QtQuick/VirtualKeyboard/
strip /opt/qt5/qml/QtQuick/VirtualKeyboard/KeyButton.qml
strip:/opt/qt5/qml/QtQuick/VirtualKeyboard/KeyButton.qml: File format not recognized
Makefile:1252: recipe for target 'install_deployment' failed
make: [install_deployment] Error 1 (ignored)
install -m 755 -p VKeyboard/QtFreeVirtualKeyboard/src/KeyModel.qml /opt/qt5/qml/QtQuick/VirtualKeyboard/
strip /opt/qt5/qml/QtQuick/VirtualKeyboard/KeyModel.qml
strip:/opt/qt5/qml/QtQuick/VirtualKeyboard/KeyModel.qml: File format not recognized
Makefile:1252: recipe for target 'install_deployment' failed
make: [install_deployment] Error 1 (ignored)
install -m 755 -p VKeyboard/QtFreeVirtualKeyboard/src/KeyPopup.qml /opt/qt5/qml/QtQuick/VirtualKeyboard/
strip /opt/qt5/qml/QtQuick/VirtualKeyboard/KeyPopup.qml
strip:/opt/qt5/qml/QtQuick/VirtualKeyboard/KeyPopup.qml: File format not recognized
Makefile:1252: recipe for target 'install_deployment' failed
make: [install_deployment] Error 1 (ignored)
install -m 755 -p VKeyboard/QtFreeVirtualKeyboard/src/FontAwesome.otf /opt/qt5/qml/QtQuick/VirtualKeyboard/
strip /opt/qt5/qml/QtQuick/VirtualKeyboard/FontAwesome.otf
strip:/opt/qt5/qml/QtQuick/VirtualKeyboard/FontAwesome.otf: File format not recognized
Makefile:1252: recipe for target 'install_deployment' failed
make: [install_deployment] Error 1 (ignored)
install -m 755 -p QtFreeVirtualKeyboard/src/qmldir /opt/qt5/qml/QtQuick/VirtualKeyboard/
strip /opt/qt5/qml/QtQuick/VirtualKeyboard/qmldir
strip:/opt/qt5/qml/QtQuick/VirtualKeyboard/qmldir: File format not recognized
Makefile:1252: recipe for target 'install_deployment' failed
make: [install_deployment] Error 1 (ignored)
make: warning: Clock skew detected. Your build may be incomplete.

Always open as numerical

Excellent design, I'm testing with Qt5.6 on an ARM Cortex-A9 (NXP / Freescale i.MX6) and this is working fine, congratulations!

I noticed something strange, I use TextField or TextInput and I set the field as inputMethodHints: Qt.ImhPreferNumbers | Qt.ImhDigitsOnly | Qt.ImhFormattedNumbersOnly, the first time it opens as numerical, in the others not.

I would know how to force forever to open in the Numeric option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.