<< to CrossControl homepage

Support & Service Center

On-Screen Keyboard

Printer-friendly versionPrinter-friendly versionPDF versionPDF version

Using QtFreeVirtualKeyboard for CCpilot VS, V700 and X900. A QML based on screen virtual keyboard for embedded QML applications.

Source code available on GitHub


How to compile QtFreeVirtualKeyboard

Build is done using CrossControl’s LinX Software Suite DevEnv v4.0.3

Clone the source repository from GitHub


1 On the command line, enter:

git clone git://github.com/githubuser0xFFFF/QtFreeVirtualKeyboard.git

2 Change to source directory

cd QtFreeVirtualKeyboard/src

3 Execute qmake on the project file (choose one of following)

a) CCpilot VS

/opt/VS/sysroots/x86_64-linux/Qt-5.12.0/bin/qmake virtualkeyboard.pro

b) CCpilot V700

/opt/V700/sysroots/x86_64-linux/Qt-5.12.7/bin/qmake virtualkeyboard.pro

c) CCpilot X900

/opt/X900/sysroots/x86_64-linux/Qt-5.12.7/bin/qmake virtualkeyboard.pro

4 Then for all builds

make
sudo make install

Following files will be installed in respective SDK folders, example for X900 below

  • /opt/X900/sysroots/corei7-64-poky-linux/opt/Qt-5.12.7/plugins/platforminputcontexts/libfreevirtualkeyboardplugin.so
  • /opt/X900/sysroots/corei7-64-poky-linux/opt/Qt-5.12.7/qml/QtQuick/FreeVirtualKeyboard/InputPanel.qml
  • /opt/X900/sysroots/corei7-64-poky-linux/opt/Qt-5.12.7/qml/QtQuick/FreeVirtualKeyboard/KeyButton.qml
  • /opt/X900/sysroots/corei7-64-poky-linux/opt/Qt-5.12.7/qml/QtQuick/FreeVirtualKeyboard/KeyModel.qml
  • /opt/X900/sysroots/corei7-64-poky-linux/opt/Qt-5.12.7/qml/QtQuick/FreeVirtualKeyboard/KeyPopup.qml
  • /opt/X900/sysroots/corei7-64-poky-linux/opt/Qt-5.12.7/qml/QtQuick/FreeVirtualKeyboard/FontAwesome.otf
  • /opt/X900/sysroots/corei7-64-poky-linux/opt/Qt-5.12.7/qml/QtQuick/FreeVirtualKeyboard/qmldir

Installation on device

Same procedure for all devices (change SDK folder depending on target /opt/X900 used in following example below).


1 Enter your preferred SDK Qt runtime directory

cd /opt/X900/sysroots/corei7-64-poky-linux/opt

2 Create archive of installed files

tar -pczf freevirtualkeyboard.tar.gz Qt-5.12.7/plugins/platforminputcontexts/libfreevirtualkeyboardplugin.so Qt-5.12.7/qml/QtQuick/FreeVirtualKeyboard/*

3 Copy the archive to your device /opt folder

scp freevirtualkeyboard.tar.gz ccs@<device-IP>:/opt   

4 Install on your device (change device-IP, password “default”)

ssh ccs@<device-IP> 
cd /opt
tar -xof freevirtualkeyboard.tar.gz

Compile an application that uses the keyboard plugin

In Qt Creator, start new project using “CrossControl Qt Quick 2 Application” template.


Add the following to the beginning of the main() function in main.cpp

qputenv("QT_IM_MODULE", QByteArray("freevirtualkeyboard"));

Add following to main.qml

import QtQuick.FreeVirtualKeyboard 1.0

To enable the Virtual Keyboard for any added TextInput field in qml, add the following to Item (id:base) in main.qml:

    InputPanel {
        id: inputPanel
        z: 99
        y: base.height
        anchors.left: parent.left
        anchors.right: parent.right
        states: State {
            name: "visible"
            when: Qt.inputMethod.visible
            PropertyChanges {
                target: inputPanel
                y: base.height - inputPanel.height
            }
        }
        transitions: Transition {
            from: ""
            to: "visible"
            reversible: true
            ParallelAnimation {
                NumberAnimation {
                    properties: "y"
                    duration: 150
                    easing.type: Easing.InOutQuad
                }
            }
        }
    } 


Added qml “OnScreenKeyboard_corei7.tar_.gz example application. Also attached is the Free Virtual Keyboard Qt plugin installation package “freevirtualkeyboard_4cce20a_corei7.tar_.gz for Core i7 device CCpilot X900 (OS v1.4.3.0).


Environment and Versions: 

CCpilot VS - OS Image v1.4.2.0

CCpilot V700 - OS Image v1.5.6.0

CCpilot X900 - OS Image v1.4.3.0

whatever