├── src ├── cutekeyboard.json ├── qml │ ├── qmldir │ ├── BackspaceKey.qml │ ├── HideKey.qml │ ├── SymbolKey.qml │ ├── ShiftKey.qml │ ├── SpaceKey.qml │ ├── EnterKey.qml │ ├── LanguageKey.qml │ ├── AlternativeKeysPopup.qml │ ├── KeyPopup.qml │ ├── DigitsLayout.qml │ ├── Key.qml │ ├── KeyModel.qml │ ├── ElLayout.qml │ ├── RuLayout.qml │ ├── UkLayout.qml │ ├── CySrBsLayout.qml │ ├── QwertyLayout.qml │ ├── ItLayout.qml │ ├── PlLayout.qml │ ├── FrLayout.qml │ ├── EsLayout.qml │ ├── CsLayout.qml │ ├── InputPanel.qml │ ├── PtLayout.qml │ ├── EnLayout.qml │ ├── NlLayout.qml │ ├── SvLayout.qml │ ├── DeLayout.qml │ ├── DaLayout.qml │ ├── FiLayout.qml │ ├── LtSrHrBsLayout.qml │ └── SymbolLayout.qml ├── icons │ ├── backspace.png │ ├── language.png │ ├── caps-lock-on.png │ ├── hide-arrow.png │ └── caps-lock-off.png ├── EnterKeyAction.cpp ├── resources.qrc ├── virtualkeyboard_global.h ├── EnterKeyAction.hpp ├── EnterKeyActionAttachedType.cpp ├── EnterKeyActionAttachedType.hpp ├── VirtualKeyboardInputContextPlugin.cpp ├── VirtualKeyboardInputContextPlugin.h ├── src.pro ├── CMakeLists.txt ├── InputPanelIface.hpp ├── VirtualKeyboardInputContext.h ├── DeclarativeInputEngine.h ├── InputPanelIface.cpp ├── DeclarativeInputEngine.cpp └── VirtualKeyboardInputContext.cpp ├── .clang-format ├── example ├── qml.qrc ├── CMakeLists.txt ├── main.cpp ├── example.pro └── main.qml ├── cutekeyboard.pro ├── CMakeLists.txt ├── LICENSE ├── .github └── workflows │ └── build.yml ├── README.md └── .gitignore /src/cutekeyboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "Keys": ["cutekeyboard"] 3 | } 4 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Google 3 | IndentWidth: '4' 4 | ... 5 | -------------------------------------------------------------------------------- /src/qml/qmldir: -------------------------------------------------------------------------------- 1 | module QtQuick.CuteKeyboard 2 | InputPanel 1.0 InputPanel.qml 3 | -------------------------------------------------------------------------------- /src/icons/backspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarula/cutekeyboard/HEAD/src/icons/backspace.png -------------------------------------------------------------------------------- /src/icons/language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarula/cutekeyboard/HEAD/src/icons/language.png -------------------------------------------------------------------------------- /src/icons/caps-lock-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarula/cutekeyboard/HEAD/src/icons/caps-lock-on.png -------------------------------------------------------------------------------- /src/icons/hide-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarula/cutekeyboard/HEAD/src/icons/hide-arrow.png -------------------------------------------------------------------------------- /src/icons/caps-lock-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amarula/cutekeyboard/HEAD/src/icons/caps-lock-off.png -------------------------------------------------------------------------------- /example/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | 5 | 6 | -------------------------------------------------------------------------------- /cutekeyboard.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = src 4 | 5 | contains(CONFIG, BUILD_EXAMPLES) { 6 | SUBDIRS += example 7 | example.depends += src 8 | } 9 | -------------------------------------------------------------------------------- /src/EnterKeyAction.cpp: -------------------------------------------------------------------------------- 1 | #include "EnterKeyAction.hpp" 2 | 3 | #include "EnterKeyActionAttachedType.hpp" 4 | 5 | EnterKeyActionAttachedType *EnterKeyAction::qmlAttachedProperties( 6 | QObject *object) { 7 | return new EnterKeyActionAttachedType(object); 8 | } 9 | -------------------------------------------------------------------------------- /src/qml/BackspaceKey.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | 4 | Key { 5 | btnKey: Qt.Key_Backspace 6 | repeatable: true 7 | showPreview: false 8 | btnBackground: InputPanel.btnSpecialBackgroundColor 9 | btnIcon: InputPanel.backspaceIcon 10 | } 11 | -------------------------------------------------------------------------------- /src/qml/HideKey.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | 4 | Key { 5 | functionKey: true 6 | showPreview: false 7 | onClicked: Qt.inputMethod.hide() 8 | btnBackground: InputPanel.btnSpecialBackgroundColor 9 | btnIcon: InputPanel.hideKeyboardIcon 10 | } 11 | -------------------------------------------------------------------------------- /src/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/backspace.png 4 | icons/caps-lock-off.png 5 | icons/caps-lock-on.png 6 | icons/hide-arrow.png 7 | icons/language.png 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/qml/SymbolKey.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | 4 | Key { 5 | btnKey: Qt.Key_Context1 6 | btnDisplayedText: !InputEngine.symbolMode ? "&123" : "ABC" 7 | functionKey: true 8 | showPreview: false 9 | btnBackground: InputPanel.btnSpecialBackgroundColor 10 | onClicked: InputEngine.symbolMode = !InputEngine.symbolMode 11 | } 12 | -------------------------------------------------------------------------------- /src/qml/ShiftKey.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | 4 | Key { 5 | btnKey: Qt.Key_Shift 6 | functionKey: true 7 | showPreview: false 8 | btnBackground: InputPanel.btnSpecialBackgroundColor 9 | btnIcon: InputEngine.uppercase ? InputPanel.shiftOnIcon : InputPanel.shiftOffIcon 10 | onClicked: InputEngine.uppercase = !InputEngine.uppercase 11 | } 12 | -------------------------------------------------------------------------------- /src/virtualkeyboard_global.h: -------------------------------------------------------------------------------- 1 | #ifndef MOCKUPVIRTUALKEYBOARD_GLOBAL_H 2 | #define MOCKUPVIRTUALKEYBOARD_GLOBAL_H 3 | 4 | #include 5 | 6 | #if defined(MOCKUPVIRTUALKEYBOARD_LIBRARY) 7 | #define MOCKUPVIRTUALKEYBOARDSHARED_EXPORT Q_DECL_EXPORT 8 | #else 9 | #define MOCKUPVIRTUALKEYBOARDSHARED_EXPORT Q_DECL_IMPORT 10 | #endif 11 | 12 | #endif // MOCKUPVIRTUALKEYBOARD_GLOBAL_H 13 | -------------------------------------------------------------------------------- /src/qml/SpaceKey.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Key { 4 | btnKey: Qt.Key_Space 5 | btnText: " " 6 | showPreview: false 7 | repeatable: true 8 | 9 | property bool showLanguageDescription: true 10 | btnDisplayedText: { 11 | if (emptySpaceBar) { 12 | return ""; 13 | } 14 | return showLanguageDescription ? langDescription : spaceIdentifier; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/EnterKeyAction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | class EnterKeyActionAttachedType; 8 | 9 | class EnterKeyAction : public QObject { 10 | Q_OBJECT 11 | 12 | public: 13 | static EnterKeyActionAttachedType *qmlAttachedProperties(QObject *object); 14 | }; 15 | 16 | // QML_DECLARE_TYPE(EnterKeyAction) 17 | QML_DECLARE_TYPEINFO(EnterKeyAction, QML_HAS_ATTACHED_PROPERTIES) 18 | -------------------------------------------------------------------------------- /src/EnterKeyActionAttachedType.cpp: -------------------------------------------------------------------------------- 1 | #include "EnterKeyActionAttachedType.hpp" 2 | 3 | EnterKeyActionAttachedType::EnterKeyActionAttachedType(QObject *parent) 4 | : QObject(parent), m_enabled(true) {} 5 | 6 | bool EnterKeyActionAttachedType::enabled() const { return m_enabled; } 7 | 8 | void EnterKeyActionAttachedType::setEnabled(bool enabled) { 9 | if (m_enabled != enabled) { 10 | m_enabled = enabled; 11 | emit enabledChanged(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/qml/EnterKey.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | 4 | Key { 5 | btnKey: Qt.Key_Enter 6 | repeatable: true 7 | showPreview: false 8 | btnBackground: InputPanel.btnSpecialBackgroundColor 9 | btnText: "\n" 10 | btnDisplayedText: InputPanel.enterIcon === "" ? "Enter" : "" 11 | btnIcon: InputPanel.enterIcon === "" ? "" : InputPanel.enterIcon 12 | enabled: InputContext.inputItem ? InputContext.inputItem.EnterKeyAction.enabled : true 13 | opacity: enabled ? 1 : 0.5 14 | } 15 | -------------------------------------------------------------------------------- /src/EnterKeyActionAttachedType.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "EnterKeyAction.hpp" 6 | 7 | class EnterKeyActionAttachedType : public QObject { 8 | Q_OBJECT 9 | Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) 10 | 11 | public: 12 | explicit EnterKeyActionAttachedType(QObject *parent = nullptr); 13 | 14 | bool enabled() const; 15 | void setEnabled(bool enabled); 16 | 17 | signals: 18 | void enabledChanged(); 19 | 20 | private: 21 | bool m_enabled; 22 | }; 23 | -------------------------------------------------------------------------------- /src/VirtualKeyboardInputContextPlugin.cpp: -------------------------------------------------------------------------------- 1 | #include "VirtualKeyboardInputContextPlugin.h" 2 | 3 | #include "EnterKeyAction.hpp" 4 | #include "EnterKeyActionAttachedType.hpp" 5 | #include "VirtualKeyboardInputContext.h" 6 | 7 | QPlatformInputContext *VirtualKeyboardInputContextPlugin::create( 8 | const QString &system, const QStringList ¶mList) { 9 | Q_UNUSED(paramList); 10 | 11 | if (system.compare(system, QStringLiteral("cutekeyboard"), 12 | Qt::CaseInsensitive) == 0) { 13 | return VirtualKeyboardInputContext::instance(); 14 | } 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | qt_add_executable(example WIN32 MACOSX_BUNDLE main.cpp) 2 | target_compile_definitions(example PRIVATE QT_DEPRECATED_WARNINGS) 3 | 4 | target_link_libraries(example PRIVATE Qt::Core Qt::Gui Qt::Quick) 5 | 6 | set(qml_resource_files "main.qml") 7 | 8 | qt_add_resources(example "qml" PREFIX "/" FILES ${qml_resource_files}) 9 | 10 | install( 11 | TARGETS example 12 | BUNDLE DESTINATION . 13 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 14 | 15 | qt_generate_deploy_app_script(TARGET example OUTPUT_SCRIPT deploy_script 16 | NO_UNSUPPORTED_PLATFORM_ERROR) 17 | install(SCRIPT ${deploy_script}) 18 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | project( 3 | cutekeyboardplugin 4 | VERSION 1.0 5 | LANGUAGES C CXX) 6 | 7 | set(CMAKE_CXX_STANDARD 17) 8 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 9 | 10 | find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core) 11 | find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Qml Quick) 12 | 13 | if (Qt6Gui_VERSION VERSION_GREATER_EQUAL "6.10.0") 14 | find_package(Qt6 REQUIRED COMPONENTS GuiPrivate QuickPrivate) 15 | endif() 16 | 17 | option(BUILD_EXAMPLES "Build examples" OFF) 18 | 19 | if(QT_KNOWN_POLICY_QTP0001) 20 | qt_policy(SET QTP0001 NEW) 21 | endif() 22 | 23 | qt_standard_project_setup() 24 | 25 | add_subdirectory(src) 26 | 27 | if(BUILD_EXAMPLES) 28 | add_subdirectory(example) 29 | endif() 30 | -------------------------------------------------------------------------------- /example/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) { 5 | qputenv("QT_IM_MODULE", QByteArray("cutekeyboard")); 6 | 7 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 8 | 9 | QGuiApplication app(argc, argv); 10 | 11 | QQmlApplicationEngine engine; 12 | engine.addImportPath(":/"); 13 | const QUrl url(QStringLiteral("qrc:/main.qml")); 14 | QObject::connect( 15 | &engine, &QQmlApplicationEngine::objectCreated, &app, 16 | [url](QObject *obj, const QUrl &objUrl) { 17 | if (!obj && url == objUrl) QCoreApplication::exit(-1); 18 | }, 19 | Qt::QueuedConnection); 20 | engine.load(url); 21 | 22 | return app.exec(); 23 | } 24 | -------------------------------------------------------------------------------- /src/VirtualKeyboardInputContextPlugin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file VirtualKeyboardInputContextPlugin.h 3 | * 4 | * \brief Declaration of VirtualKeyboardInputContextPlugin 5 | * 6 | * \author Uwe Kindler 7 | * \date 08/01/2015 8 | * 9 | * Copyright (c) 2015 Uwe Kindler 10 | */ 11 | 12 | #ifndef VIRTUALKEYBOARDINPUTCONTEXTPLUGIN_H 13 | #define VIRTUALKEYBOARDINPUTCONTEXTPLUGIN_H 14 | 15 | #include 16 | 17 | #include "virtualkeyboard_global.h" 18 | 19 | /** 20 | * Implementation of QPlatformInputContextPlugin 21 | */ 22 | class VirtualKeyboardInputContextPlugin : public QPlatformInputContextPlugin { 23 | Q_OBJECT 24 | 25 | Q_PLUGIN_METADATA(IID QPlatformInputContextFactoryInterface_iid FILE 26 | "cutekeyboard.json") 27 | 28 | public: 29 | QPlatformInputContext *create(const QString &, const QStringList &); 30 | }; 31 | 32 | #endif // VIRTUALKEYBOARDINPUTCONTEXTPLUGIN_H 33 | -------------------------------------------------------------------------------- /src/qml/LanguageKey.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | 4 | Key { 5 | weight: 108.5 6 | btnKey: Qt.Key_Context2 7 | btnIcon: InputPanel.languageIcon 8 | functionKey: true 9 | showPreview: false 10 | btnBackground: InputPanel.btnSpecialBackgroundColor 11 | onClicked: { 12 | var indx = InputPanel.availableLanguageLayouts.indexOf(InputPanel.languageLayout); 13 | if (indx != -1) { 14 | var nextIndx = (indx + 1) % InputPanel.availableLanguageLayouts.length; 15 | var nextLangLayout = InputPanel.availableLanguageLayouts[nextIndx]; 16 | if (InputEngine.inputLayoutValid(nextLangLayout)) 17 | InputPanel.languageLayout = nextLangLayout; 18 | else 19 | InputPanel.languageLayout = "En"; 20 | } else { 21 | InputPanel.languageLayout = InputPanel.availableLanguageLayouts[0]; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/example.pro: -------------------------------------------------------------------------------- 1 | QT += quick 2 | 3 | CONFIG += c++11 4 | 5 | # The following define makes your compiler emit warnings if you use 6 | # any Qt feature that has been marked deprecated (the exact warnings 7 | # depend on your compiler). Refer to the documentation for the 8 | # deprecated API to know how to port your code away from it. 9 | DEFINES += QT_DEPRECATED_WARNINGS 10 | 11 | # You can also make your code fail to compile if it uses deprecated APIs. 12 | # In order to do so, uncomment the following line. 13 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 14 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 15 | 16 | SOURCES += \ 17 | main.cpp 18 | 19 | RESOURCES += qml.qrc 20 | 21 | # Additional import path used to resolve QML modules in Qt Creator's code model 22 | QML_IMPORT_PATH = 23 | 24 | # Additional import path used to resolve QML modules just for Qt Quick Designer 25 | QML_DESIGNER_IMPORT_PATH = 26 | 27 | target.path = $$[QT_INSTALL_PREFIX]/bin 28 | INSTALLS += target 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2015 Uwe Kindler 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | workflow_dispatch: 5 | pull_request: {} 6 | push: { branches: [main] } 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | include: 14 | - name: "QMake Qt5" 15 | qt-version: "5.15.2" 16 | build-system: qmake 17 | - name: "CMake Qt6" 18 | qt-version: "6.8.3" 19 | build-system: cmake 20 | 21 | name: ${{ matrix.name }} 22 | 23 | steps: 24 | - uses: actions/checkout@v4 25 | 26 | - name: Installing Qt 27 | uses: jurplel/install-qt-action@v4 28 | with: 29 | version: ${{ matrix.qt-version }} 30 | 31 | - name: Configure Project with QMake 32 | if: matrix.build-system == 'qmake' 33 | run: qmake 34 | 35 | - name: Build with QMake 36 | if: matrix.build-system == 'qmake' 37 | run: make -j$(nproc) 38 | 39 | - name: Configure Project with CMake 40 | if: matrix.build-system == 'cmake' 41 | run: cmake -S . -B build -GNinja 42 | 43 | - name: Build with CMake 44 | if: matrix.build-system == 'cmake' 45 | run: cmake --build build --target all 46 | -------------------------------------------------------------------------------- /src/src.pro: -------------------------------------------------------------------------------- 1 | QT += qml quick quick-private gui-private 2 | 3 | CONFIG += plugin 4 | 5 | TARGET = cutekeyboardplugin 6 | TEMPLATE = lib 7 | 8 | SOURCES += \ 9 | EnterKeyAction.cpp \ 10 | EnterKeyActionAttachedType.cpp \ 11 | InputPanelIface.cpp \ 12 | VirtualKeyboardInputContextPlugin.cpp \ 13 | VirtualKeyboardInputContext.cpp \ 14 | DeclarativeInputEngine.cpp 15 | 16 | HEADERS += \ 17 | EnterKeyAction.hpp \ 18 | EnterKeyActionAttachedType.hpp \ 19 | InputPanelIface.hpp \ 20 | VirtualKeyboardInputContextPlugin.h \ 21 | VirtualKeyboardInputContext.h \ 22 | DeclarativeInputEngine.h 23 | 24 | RESOURCES += \ 25 | resources.qrc 26 | 27 | QML_FILES += \ 28 | qml/qmldir \ 29 | qml/*.qml 30 | 31 | OTHER_FILES += $$QML_FILES 32 | 33 | INSTALLS += \ 34 | target \ 35 | deployment 36 | 37 | !defined(INSTALL_PREFIX, var):INSTALL_PREFIX = $$[QT_INSTALL_PREFIX] 38 | 39 | INSTALL_QML = $$INSTALL_PREFIX/$$relative_path($$[QT_INSTALL_QML], $$[QT_INSTALL_PREFIX]) 40 | INSTALL_PLUGINS = $$INSTALL_PREFIX/$$relative_path($$[QT_INSTALL_PLUGINS], $$[QT_INSTALL_PREFIX]) 41 | 42 | deployment.files = $$QML_FILES 43 | deployment.path = $$INSTALL_QML/QtQuick/CuteKeyboard 44 | target.path = $$INSTALL_PLUGINS/platforminputcontexts 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build](https://github.com/amarula/cutekeyboard/actions/workflows/build.yml/badge.svg)](https://github.com/amarula/cutekeyboard/actions/workflows/build.yml) 2 | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 3 | 4 | # CuteKeyboard 5 | 6 | CuteKeyboard is a Qt virtual keyboard plugin for embedded applications. 7 | 8 | ## Installation 9 | 10 | Download the repository, build and install the plugin. 11 | 12 | ```bash 13 | mkdir build && cd build 14 | qmake .. 15 | make -j4 16 | make install 17 | ``` 18 | 19 | ### Custom Installation 20 | 21 | ```bash 22 | mkdir build && cd build 23 | qmake .. INSTALL_PREFIX=/home/custom_dir/custom_root 24 | make -j4 25 | make install 26 | ``` 27 | 28 | ## Examples 29 | 30 | ```bash 31 | mkdir build && cd build 32 | qmake .. CONFIG+=BUILD_EXAMPLES 33 | make -j4 34 | make install 35 | ``` 36 | 37 | ## Usage 38 | 39 | In the `main.cpp` add the `cutekeyboard` plugin. 40 | 41 | ```c++ 42 | qputenv("QT_IM_MODULE", QByteArray("cutekeyboard")); 43 | ``` 44 | 45 | In the `main.qml` insert the keyboard component 46 | 47 | ```javascript 48 | import QtQuick.CuteKeyboard 1.0 49 | 50 | ... 51 | 52 | InputPanel { 53 | id: inputPanel 54 | 55 | z: 99 56 | y: window.height 57 | 58 | anchors.left: parent.left 59 | anchors.right: parent.right 60 | 61 | states: State { 62 | name: "visible" 63 | when: Qt.inputMethod.visible 64 | PropertyChanges { 65 | target: inputPanel 66 | y: window.height - inputPanel.height 67 | } 68 | } 69 | transitions: Transition { 70 | from: "" 71 | to: "visible" 72 | reversible: true 73 | ParallelAnimation { 74 | NumberAnimation { 75 | properties: "y" 76 | duration: 150 77 | easing.type: Easing.InOutQuad 78 | } 79 | } 80 | } 81 | } 82 | ``` 83 | ## Authors 84 | * **Uwe Kindler** - *Initial work* - [githubuser0xFFFF](https://github.com/githubuser0xFFFF) 85 | * **Andrea Ricchi** - *Maintainer* - [AndreaRicchi](https://github.com/AndreaRicchi) 86 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *build*/* 2 | 3 | # Created by https://www.gitignore.io/api/qt,qml,c++,qtcreator 4 | # Edit at https://www.gitignore.io/?templates=qt,qml,c++,qtcreator 5 | 6 | ### C++ ### 7 | # Prerequisites 8 | *.d 9 | 10 | # Compiled Object files 11 | *.slo 12 | *.lo 13 | *.o 14 | *.obj 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Compiled Dynamic libraries 21 | *.so 22 | *.dylib 23 | *.dll 24 | 25 | # Fortran module files 26 | *.mod 27 | *.smod 28 | 29 | # Compiled Static libraries 30 | *.lai 31 | *.la 32 | *.a 33 | *.lib 34 | 35 | # Executables 36 | *.exe 37 | *.out 38 | *.app 39 | 40 | ### QML ### 41 | # Cached binary representations of QML and JS files 42 | *.qmlc 43 | *.jsc 44 | 45 | ### Qt ### 46 | # C++ objects and libs 47 | 48 | # Qt-es 49 | object_script.*.Release 50 | object_script.*.Debug 51 | *_plugin_import.cpp 52 | *.qmake.cache 53 | *.qmake.stash 54 | *.pro.user 55 | *.pro.user.* 56 | *.qbs.user 57 | *.qbs.user.* 58 | *.moc 59 | moc_*.cpp 60 | moc_*.h 61 | qrc_*.cpp 62 | ui_*.h 63 | Makefile* 64 | *build-* 65 | 66 | # Qt unit tests 67 | target_wrapper.* 68 | 69 | # QtCreator 70 | *.autosave 71 | 72 | # QtCreator Qml 73 | *.qmlproject.user 74 | *.qmlproject.user.* 75 | 76 | # QtCreator CMake 77 | CMakeLists.txt.user* 78 | 79 | # QtCreator 4.8< compilation database 80 | compile_commands.json 81 | 82 | # QtCreator local machine specific files for imported projects 83 | *creator.user* 84 | 85 | ### QtCreator ### 86 | # gitignore for Qt Creator like IDE for pure C/C++ project without Qt 87 | # 88 | # Reference: http://doc.qt.io/qtcreator/creator-project-generic.html 89 | 90 | 91 | 92 | # Qt Creator autogenerated files 93 | 94 | 95 | # A listing of all the files included in the project 96 | *.files 97 | 98 | # Include directories 99 | *.includes 100 | 101 | # Project configuration settings like predefined Macros 102 | *.config 103 | 104 | # Qt Creator settings 105 | *.creator 106 | 107 | # User project settings 108 | *.creator.user* 109 | 110 | # Qt Creator backups 111 | 112 | # End of https://www.gitignore.io/api/qt,qml,c++,qtcreator 113 | -------------------------------------------------------------------------------- /src/qml/AlternativeKeysPopup.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | import QtQuick.Layouts 1.12 4 | 5 | Item { 6 | id: root 7 | 8 | property var alternativeKeys: [] 9 | 10 | function open(keybutton, inputPanel) { 11 | alternativeKeys = keybutton.alternativeKeys; 12 | width = keybutton.width * 1 * alternativeKeys.length; 13 | height = keybutton.height * 1.2; 14 | var KeyButtonGlobalLeft = keybutton.mapToItem(inputPanel, 0, 0).x; 15 | var KeyButtonGlobalTop = keybutton.mapToItem(inputPanel, 0, 0).y; 16 | var PopupGlobalLeft = KeyButtonGlobalLeft - (width - keybutton.width) / 2; 17 | var PopupGlobalTop = KeyButtonGlobalTop - height - keyboardRect.height / 40 * 1.5; 18 | var PopupLeft = root.parent.mapFromItem(inputPanel, PopupGlobalLeft, PopupGlobalTop).x; 19 | y = root.parent.mapFromItem(inputPanel, PopupGlobalLeft, PopupGlobalTop).y; 20 | if (PopupGlobalLeft < 0) 21 | x = 0; 22 | else if ((PopupGlobalLeft + width) > inputPanel.width) 23 | x = PopupLeft - (PopupGlobalLeft + width - inputPanel.width); 24 | else 25 | x = PopupLeft; 26 | loadAlternativesKey(); 27 | visible = true; 28 | } 29 | 30 | function loadAlternativesKey() { 31 | listModel.clear(); 32 | for (var i = 0; i < alternativeKeys.length; i++) { 33 | listModel.append({ 34 | "btnText": InputEngine.uppercase ? alternativeKeys[i].toUpperCase() : alternativeKeys[i] 35 | }); 36 | } 37 | } 38 | 39 | visible: false 40 | 41 | ListModel { 42 | id: listModel 43 | } 44 | 45 | Rectangle { 46 | id: listViewBackground 47 | 48 | radius: Math.round(height / 20) 49 | color: InputPanel.backgroundColor 50 | anchors.fill: parent 51 | 52 | RowLayout { 53 | spacing: 1 54 | 55 | anchors { 56 | fill: parent 57 | margins: 1 58 | } 59 | 60 | Repeater { 61 | model: listModel 62 | 63 | Key { 64 | btnText: model.btnText 65 | showPreview: false 66 | weight: width 67 | onClicked: root.visible = false 68 | } 69 | 70 | } 71 | 72 | } 73 | 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/qml/KeyPopup.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | 4 | Item { 5 | id: root 6 | 7 | property color popupColor 8 | property alias popupTextColor: txt.color 9 | property alias popupTextFont: txt.font.family 10 | property alias text: txt.text 11 | property alias font: txt.font 12 | 13 | function popup(keybutton, inputPanel) { 14 | width = keybutton.width * 1.4; 15 | height = keybutton.height * 1.4; 16 | var KeyButtonGlobalLeft = keybutton.mapToItem(inputPanel, 0, 0).x; 17 | var KeyButtonGlobalTop = keybutton.mapToItem(inputPanel, 0, 0).y; 18 | var PopupGlobalLeft = KeyButtonGlobalLeft - (width - keybutton.width) / 2; 19 | var PopupGlobalTop = KeyButtonGlobalTop - height - keyboardRect.height / 40 * 1.5; 20 | var PopupLeft = root.parent.mapFromItem(inputPanel, PopupGlobalLeft, PopupGlobalTop).x; 21 | y = root.parent.mapFromItem(inputPanel, PopupGlobalLeft, PopupGlobalTop).y; 22 | if (PopupGlobalLeft < 0) 23 | x = 0; 24 | else if ((PopupGlobalLeft + width) > inputPanel.width) 25 | x = PopupLeft - (PopupGlobalLeft + width - inputPanel.width); 26 | else 27 | x = PopupLeft; 28 | text = InputEngine.uppercase ? keybutton.btnText.toUpperCase() : keybutton.btnText; 29 | font.family = keybutton.font.family; 30 | visible = Qt.binding(function() { 31 | return keybutton.pressed; 32 | }); 33 | } 34 | 35 | width: 40 36 | height: 40 37 | visible: false 38 | 39 | Rectangle { 40 | id: popup 41 | 42 | anchors.fill: parent 43 | radius: Math.round(height / 30) 44 | z: shadow.z + 1 45 | 46 | Text { 47 | id: txt 48 | 49 | anchors.fill: parent 50 | fontSizeMode: Text.Fit 51 | font.pixelSize: height * 0.7 52 | horizontalAlignment: Text.AlignHCenter 53 | verticalAlignment: Text.AlignVCenter 54 | } 55 | 56 | gradient: Gradient { 57 | GradientStop { 58 | position: 0 59 | color: Qt.lighter(popupColor) 60 | } 61 | 62 | GradientStop { 63 | position: 1 64 | color: popupColor 65 | } 66 | 67 | } 68 | 69 | } 70 | 71 | Rectangle { 72 | id: shadow 73 | 74 | width: popup.width 75 | height: popup.height 76 | radius: popup.radius 77 | color: "#3F000000" 78 | x: 4 79 | y: 4 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/qml/DigitsLayout.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | import QtQuick.Layouts 1.12 4 | 5 | ColumnLayout { 6 | property var inputPanel 7 | 8 | GridLayout { 9 | property real keyWeight 10 | 11 | Layout.fillWidth: false 12 | Layout.fillHeight: true 13 | Layout.alignment: Qt.AlignHCenter 14 | Layout.preferredWidth: height 15 | 16 | columns: 4 17 | 18 | Key { 19 | btnKey: Qt.Key_7 20 | btnText: "7" 21 | inputPanelRef: inputPanel 22 | } 23 | 24 | Key { 25 | btnKey: Qt.Key_8 26 | btnText: "8" 27 | inputPanelRef: inputPanel 28 | } 29 | 30 | Key { 31 | btnKey: Qt.Key_9 32 | btnText: "9" 33 | inputPanelRef: inputPanel 34 | } 35 | 36 | BackspaceKey { 37 | inputPanelRef: inputPanel 38 | } 39 | 40 | Key { 41 | btnKey: Qt.Key_4 42 | btnText: "4" 43 | inputPanelRef: inputPanel 44 | } 45 | 46 | Key { 47 | btnKey: Qt.Key_5 48 | btnText: "5" 49 | inputPanelRef: inputPanel 50 | } 51 | 52 | Key { 53 | btnKey: Qt.Key_6 54 | btnText: "6" 55 | inputPanelRef: inputPanel 56 | } 57 | 58 | Key { 59 | btnText: " " 60 | btnDisplayedText: "\u2423" 61 | repeatable: true 62 | showPreview: false 63 | btnKey: Qt.Key_Space 64 | inputPanelRef: inputPanel 65 | } 66 | 67 | Key { 68 | btnKey: Qt.Key_1 69 | btnText: "1" 70 | inputPanelRef: inputPanel 71 | } 72 | 73 | Key { 74 | btnKey: Qt.Key_2 75 | btnText: "2" 76 | inputPanelRef: inputPanel 77 | } 78 | 79 | Key { 80 | btnKey: Qt.Key_3 81 | btnText: "3" 82 | inputPanelRef: inputPanel 83 | } 84 | 85 | HideKey { 86 | inputPanelRef: inputPanel 87 | } 88 | 89 | Key { 90 | btnKey: Qt.locale().decimalPoint === "," ? Qt.Key_Comma : Qt.Key_Period 91 | btnText: Qt.locale().decimalPoint === "," ? "," : "." 92 | inputPanelRef: inputPanel 93 | } 94 | 95 | Key { 96 | btnKey: Qt.Key_0 97 | btnText: "0" 98 | inputPanelRef: inputPanel 99 | } 100 | 101 | EnterKey { 102 | inputPanelRef: inputPanel 103 | Layout.columnSpan: 2 104 | } 105 | 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(HEADERS 2 | "EnterKeyAction.hpp" "EnterKeyActionAttachedType.hpp" "InputPanelIface.hpp" 3 | "VirtualKeyboardInputContextPlugin.h" "VirtualKeyboardInputContext.h" 4 | "DeclarativeInputEngine.h") 5 | 6 | set(SOURCES 7 | "EnterKeyAction.cpp" "EnterKeyActionAttachedType.cpp" "InputPanelIface.cpp" 8 | "VirtualKeyboardInputContextPlugin.cpp" "VirtualKeyboardInputContext.cpp" 9 | "DeclarativeInputEngine.cpp") 10 | 11 | set(QML_FILES 12 | "qml/AlternativeKeysPopup.qml" 13 | "qml/BackspaceKey.qml" 14 | "qml/CsLayout.qml" 15 | "qml/CySrBsLayout.qml" 16 | "qml/DeLayout.qml" 17 | "qml/DigitsLayout.qml" 18 | "qml/ElLayout.qml" 19 | "qml/EnLayout.qml" 20 | "qml/EnterKey.qml" 21 | "qml/EsLayout.qml" 22 | "qml/FrLayout.qml" 23 | "qml/DaLayout.qml" 24 | "qml/FiLayout.qml" 25 | "qml/HideKey.qml" 26 | "qml/InputPanel.qml" 27 | "qml/ItLayout.qml" 28 | "qml/KeyModel.qml" 29 | "qml/KeyPopup.qml" 30 | "qml/Key.qml" 31 | "qml/LanguageKey.qml" 32 | "qml/LtSrHrBsLayout.qml" 33 | "qml/NlLayout.qml" 34 | "qml/PlLayout.qml" 35 | "qml/PtLayout.qml" 36 | "qml/QwertyLayout.qml" 37 | "qml/RuLayout.qml" 38 | "qml/ShiftKey.qml" 39 | "qml/SpaceKey.qml" 40 | "qml/SvLayout.qml" 41 | "qml/SymbolKey.qml" 42 | "qml/SymbolLayout.qml" 43 | "qml/UkLayout.qml") 44 | 45 | foreach(_file IN_LISTS QML_FILES) 46 | cmake_path(GET _file FILENAME _fileName) 47 | set_source_files_properties(${_file} PROPERTIES QT_RESOURCE_ALIAS 48 | ${_fileName}) 49 | endforeach() 50 | 51 | qt_add_qml_module( 52 | ${PROJECT_NAME} 53 | URI 54 | "QtQuick.CuteKeyboard" 55 | VERSION 56 | 1.0 57 | PLUGIN_TARGET 58 | ${PROJECT_NAME} 59 | OUTPUT_DIRECTORY 60 | "QtQuick/CuteKeyboard" 61 | RESOURCE_PREFIX 62 | "/" 63 | CLASS_NAME 64 | "VirtualKeyboardInputContextPlugin" 65 | SOURCES 66 | ${HEADERS} 67 | ${SOURCES} 68 | QML_FILES 69 | ${QML_FILES} 70 | NO_GENERATE_PLUGIN_SOURCE) 71 | 72 | qt_add_resources(${PROJECT_NAME} "icons" PREFIX "/" FILES "resources.qrc") 73 | 74 | target_link_libraries( 75 | ${PROJECT_NAME} PRIVATE Qt::Core Qt::Gui Qt::GuiPrivate Qt::Qml Qt::Quick 76 | Qt::QuickPrivate) 77 | 78 | set(INSTALL_PLUGINSDIR "" CACHE PATH "Installation directory for plugins") 79 | if (NOT INSTALL_PLUGINSDIR) 80 | if(${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME}) 81 | set(INSTALL_PLUGINSDIR ${QT_DIR}/../../../plugins) 82 | else() 83 | set(INSTALL_PLUGINSDIR ${CMAKE_INSTALL_BINDIR}) 84 | set_target_properties( 85 | ${PROJECT_NAME} 86 | PROPERTIES LIBRARY_OUTPUT_DIRECTORY 87 | "$/platforminputcontexts") 88 | endif() 89 | endif() 90 | 91 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${INSTALL_PLUGINSDIR}/platforminputcontexts) -------------------------------------------------------------------------------- /example/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.12 2 | import QtQuick.Controls 2.12 3 | import QtQuick.CuteKeyboard 1.0 4 | import QtQuick.Layouts 1.12 5 | import QtQuick.Window 2.12 6 | 7 | Window { 8 | id: window 9 | 10 | visible: true 11 | width: 640 12 | height: 640 13 | title: qsTr("QtCuteKeyboard Example") 14 | 15 | ColumnLayout { 16 | spacing: 20 17 | anchors.centerIn: parent 18 | 19 | RowLayout { 20 | spacing: 10 21 | 22 | Text { 23 | id: t1 24 | 25 | text: qsTr("Basic TextField") 26 | } 27 | 28 | TextField { 29 | id: tf1 30 | 31 | width: 200 32 | height: 50 33 | } 34 | 35 | } 36 | 37 | RowLayout { 38 | spacing: 10 39 | 40 | Text { 41 | id: t2 42 | 43 | text: qsTr("Disabled enter key - TextField") 44 | } 45 | 46 | TextField { 47 | id: tf2 48 | 49 | width: 200 50 | height: 50 51 | EnterKeyAction.enabled: false 52 | } 53 | 54 | } 55 | 56 | RowLayout { 57 | spacing: 10 58 | 59 | Text { 60 | id: t3 61 | 62 | text: qsTr("Enabled enter key - TextField") 63 | } 64 | 65 | TextField { 66 | id: tf3 67 | 68 | width: 200 69 | height: 50 70 | EnterKeyAction.enabled: true 71 | } 72 | 73 | } 74 | 75 | RowLayout { 76 | spacing: 10 77 | 78 | Text { 79 | id: t4 80 | 81 | text: qsTr("Qt.ImhDigitsOnly TextField") 82 | } 83 | 84 | TextField { 85 | id: tf4 86 | 87 | width: 200 88 | height: 50 89 | inputMethodHints: Qt.ImhDigitsOnly 90 | } 91 | 92 | } 93 | 94 | } 95 | 96 | InputPanel { 97 | id: inputPanel 98 | 99 | z: 99 100 | y: window.height 101 | anchors.left: parent.left 102 | anchors.right: parent.right 103 | languageLayout: "It" 104 | availableLanguageLayouts: ["It", "En"] 105 | 106 | states: State { 107 | name: "visible" 108 | when: Qt.inputMethod.visible 109 | 110 | PropertyChanges { 111 | target: inputPanel 112 | y: window.height - inputPanel.height 113 | } 114 | 115 | } 116 | 117 | transitions: Transition { 118 | from: "" 119 | to: "visible" 120 | reversible: true 121 | 122 | ParallelAnimation { 123 | NumberAnimation { 124 | properties: "y" 125 | duration: 150 126 | easing.type: Easing.InOutQuad 127 | } 128 | 129 | } 130 | 131 | } 132 | 133 | } 134 | 135 | } 136 | -------------------------------------------------------------------------------- /src/qml/Key.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQuick 2.0 3 | import QtQuick.Controls 2.0 4 | import QtQuick.Layouts 1.12 5 | 6 | Button { 7 | id: key 8 | 9 | property real weight: parent.keyWeight 10 | property string btnText: "" 11 | property string btnDisplayedText: text 12 | property int btnKey: Qt.Key_unknown 13 | property color btnBackground: InputPanel.btnBackgroundColor 14 | property int btnRadius: 5 15 | property color txtColor: InputPanel.btnTextColor 16 | property string txtFont: InputPanel.btnTextFontFamily 17 | property string btnIcon: "" 18 | property var alternativeKeys: [] 19 | property var inputPanelRef 20 | property alias repeatable: key.autoRepeat 21 | property bool showPreview: true 22 | property bool functionKey: false 23 | 24 | focusPolicy: Qt.NoFocus 25 | Layout.minimumWidth: key.implicitWidth 26 | Layout.minimumHeight: key.implicitHeight 27 | Layout.preferredWidth: weight 28 | Layout.fillWidth: true 29 | Layout.fillHeight: true 30 | onPressed: { 31 | if (inputPanelRef !== null && showPreview) 32 | inputPanelRef.showKeyPopup(key); 33 | 34 | } 35 | onPressedChanged: { 36 | if (pressed) { 37 | opacity = 0.7; 38 | if (alternativeKeys.length > 0) 39 | longPressTimer.running = true; 40 | 41 | } else { 42 | opacity = 1; 43 | longPressTimer.running = false; 44 | } 45 | } 46 | onReleased: { 47 | if (!functionKey) 48 | InputEngine.virtualKeyClick(btnKey, InputEngine.uppercase ? btnText.toUpperCase() : btnText, InputEngine.uppercase ? Qt.ShiftModifier : 0); 49 | 50 | } 51 | 52 | Timer { 53 | id: longPressTimer 54 | 55 | interval: 800 56 | repeat: false 57 | running: false 58 | onTriggered: { 59 | enabled = false; 60 | inputPanelRef.hideKeyPopup(); 61 | inputPanelRef.showAlternativesKeyPopup(key); 62 | enabled = true; 63 | } 64 | } 65 | 66 | background: Rectangle { 67 | id: btnBackgroundItem 68 | 69 | color: btnBackground 70 | radius: btnRadius 71 | } 72 | 73 | contentItem: Item { 74 | Text { 75 | id: btnTextItem 76 | 77 | text: btnDisplayedText == "" ? btnText : btnDisplayedText 78 | color: txtColor 79 | anchors.fill: parent 80 | horizontalAlignment: Text.AlignHCenter 81 | verticalAlignment: Text.AlignVCenter 82 | 83 | font { 84 | family: txtFont 85 | weight: Font.Normal 86 | pixelSize: key.height * 0.4 87 | capitalization: InputEngine.uppercase ? Font.AllUppercase : Font.MixedCase 88 | } 89 | 90 | } 91 | 92 | Image { 93 | id: btnIconItem 94 | 95 | source: btnIcon 96 | visible: btnDisplayedText === "" 97 | anchors.fill: parent 98 | fillMode: Image.PreserveAspectFit 99 | } 100 | 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /src/qml/KeyModel.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | /** 4 | * This is quick and dirty model for the keys of the InputPanel * 5 | * The code has been derived from 6 | * http://tolszak-dev.blogspot.de/2013/04/qplatforminputcontext-and-virtual.html 7 | * Copyright 2015 Uwe Kindler 8 | * Licensed under MIT see LICENSE.MIT in project root 9 | */ 10 | Item { 11 | property QtObject firstRowModel: first 12 | property QtObject secondRowModel: second 13 | property QtObject thirdRowModel: third 14 | 15 | ListModel { 16 | id: first 17 | 18 | ListElement { 19 | letter: "q" 20 | firstSymbol: "1" 21 | keycode: Qt.Key_Q 22 | } 23 | 24 | ListElement { 25 | letter: "w" 26 | firstSymbol: "2" 27 | keycode: Qt.Key_W 28 | } 29 | 30 | ListElement { 31 | letter: "e" 32 | firstSymbol: "3" 33 | keycode: Qt.Key_E 34 | } 35 | 36 | ListElement { 37 | letter: "r" 38 | firstSymbol: "4" 39 | keycode: Qt.Key_R 40 | } 41 | 42 | ListElement { 43 | letter: "t" 44 | firstSymbol: "5" 45 | keycode: Qt.Key_T 46 | } 47 | 48 | ListElement { 49 | letter: "y" 50 | firstSymbol: "6" 51 | keycode: Qt.Key_Y 52 | } 53 | 54 | ListElement { 55 | letter: "u" 56 | firstSymbol: "7" 57 | keycode: Qt.Key_U 58 | } 59 | 60 | ListElement { 61 | letter: "i" 62 | firstSymbol: "8" 63 | keycode: Qt.Key_I 64 | } 65 | 66 | ListElement { 67 | letter: "o" 68 | firstSymbol: "9" 69 | keycode: Qt.Key_O 70 | } 71 | 72 | ListElement { 73 | letter: "p" 74 | firstSymbol: "0" 75 | keycode: Qt.Key_E 76 | } 77 | 78 | } 79 | 80 | ListModel { 81 | id: second 82 | 83 | ListElement { 84 | letter: "a" 85 | firstSymbol: "!" 86 | } 87 | 88 | ListElement { 89 | letter: "s" 90 | firstSymbol: "@" 91 | } 92 | 93 | ListElement { 94 | letter: "d" 95 | firstSymbol: "#" 96 | } 97 | 98 | ListElement { 99 | letter: "f" 100 | firstSymbol: "$" 101 | } 102 | 103 | ListElement { 104 | letter: "g" 105 | firstSymbol: "%" 106 | } 107 | 108 | ListElement { 109 | letter: "h" 110 | firstSymbol: "&" 111 | } 112 | 113 | ListElement { 114 | letter: "j" 115 | firstSymbol: "*" 116 | } 117 | 118 | ListElement { 119 | letter: "k" 120 | firstSymbol: "?" 121 | } 122 | 123 | ListElement { 124 | letter: "l" 125 | firstSymbol: "/" 126 | } 127 | 128 | } 129 | 130 | ListModel { 131 | id: third 132 | 133 | ListElement { 134 | letter: "z" 135 | firstSymbol: "_" 136 | } 137 | 138 | ListElement { 139 | letter: "x" 140 | firstSymbol: "\"" 141 | } 142 | 143 | ListElement { 144 | letter: "c" 145 | firstSymbol: "'" 146 | } 147 | 148 | ListElement { 149 | letter: "v" 150 | firstSymbol: "(" 151 | } 152 | 153 | ListElement { 154 | letter: "b" 155 | firstSymbol: ")" 156 | } 157 | 158 | ListElement { 159 | letter: "n" 160 | firstSymbol: "-" 161 | } 162 | 163 | ListElement { 164 | letter: "m" 165 | firstSymbol: "+" 166 | } 167 | 168 | } 169 | 170 | } 171 | -------------------------------------------------------------------------------- /src/InputPanelIface.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INPUTPANELIFACE_HPP 2 | #define INPUTPANELIFACE_HPP 3 | 4 | #include 5 | #include 6 | 7 | /*! 8 | * \brief The InputPanelIface class contains properties shared between the 9 | * keyboards component. 10 | */ 11 | class InputPanelIface : public QObject { 12 | Q_OBJECT 13 | 14 | // clang-format off 15 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) 16 | Q_PROPERTY(QColor btnBackgroundColor READ btnBackgroundColor WRITE setBtnBackgroundColor NOTIFY btnBackgroundColorChanged) 17 | Q_PROPERTY(QColor btnSpecialBackgroundColor READ btnSpecialBackgroundColor WRITE setBtnSpecialBackgroundColor NOTIFY btnSpecialBackgroundColorChanged) 18 | Q_PROPERTY(QColor btnTextColor READ btnTextColor WRITE setBtnTextColor NOTIFY btnTextColorChanged) 19 | Q_PROPERTY(QString btnTextFontFamily READ btnTextFontFamily WRITE setBtnTextFontFamily NOTIFY btnTextFontFamilyChanged) 20 | Q_PROPERTY(QString backspaceIcon READ backspaceIcon WRITE setBackspaceIcon NOTIFY backspaceIconChanged) 21 | Q_PROPERTY(QString enterIcon READ enterIcon WRITE setEnterIcon NOTIFY enterIconChanged) 22 | Q_PROPERTY(QString shiftOnIcon READ shiftOnIcon WRITE setShiftOnIcon NOTIFY shiftOnIconChanged) 23 | Q_PROPERTY(QString shiftOffIcon READ shiftOffIcon WRITE setShiftOffIcon NOTIFY shiftOffIconChanged) 24 | Q_PROPERTY(QString hideKeyboardIcon READ hideKeyboardIcon WRITE setHideKeyboardIcon NOTIFY hideKeyboardIconChanged) 25 | Q_PROPERTY(QString languageIcon READ languageIcon WRITE setLanguageIcon NOTIFY languageIconChanged) 26 | Q_PROPERTY(QStringList availableLanguageLayouts READ availableLanguageLayouts WRITE setAvailableLanguageLayouts NOTIFY availableLanguageLayoutsChanged) 27 | Q_PROPERTY(QString languageLayout READ languageLayout WRITE setLanguageLayout NOTIFY languageLayoutChanged FINAL) 28 | // clang-format on 29 | 30 | public: 31 | explicit InputPanelIface(QObject *parent = nullptr); 32 | ~InputPanelIface(); 33 | 34 | QColor backgroundColor() const; 35 | void setBackgroundColor(const QColor &backgroundColor); 36 | 37 | QColor btnBackgroundColor() const; 38 | void setBtnBackgroundColor(const QColor &btnBackgroundColor); 39 | 40 | QColor btnSpecialBackgroundColor() const; 41 | void setBtnSpecialBackgroundColor(const QColor &btnSpecialBackgroundColor); 42 | 43 | QColor btnTextColor() const; 44 | void setBtnTextColor(const QColor &btnTextColor); 45 | 46 | QString btnTextFontFamily() const; 47 | void setBtnTextFontFamily(const QString &btnTextFontFamily); 48 | 49 | QString backspaceIcon() const; 50 | void setBackspaceIcon(const QString &backspaceIcon); 51 | 52 | QString enterIcon() const; 53 | void setEnterIcon(const QString &enterIcon); 54 | 55 | QString shiftOnIcon() const; 56 | void setShiftOnIcon(const QString &shiftOnIcon); 57 | 58 | QString shiftOffIcon() const; 59 | void setShiftOffIcon(const QString &shiftOffIcon); 60 | 61 | QString hideKeyboardIcon() const; 62 | void setHideKeyboardIcon(const QString &hideKeyboardIcon); 63 | 64 | QString languageIcon() const; 65 | void setLanguageIcon(const QString &languageIcon); 66 | 67 | QStringList availableLanguageLayouts() const; 68 | void setAvailableLanguageLayouts( 69 | const QStringList &availableLanguageLayouts); 70 | 71 | QString languageLayout() const; 72 | void setLanguageLayout(const QString &languageIcon); 73 | 74 | signals: 75 | void backgroundColorChanged(); 76 | void btnBackgroundColorChanged(); 77 | void btnSpecialBackgroundColorChanged(); 78 | void btnTextColorChanged(); 79 | void btnTextFontFamilyChanged(); 80 | void backspaceIconChanged(); 81 | void enterIconChanged(); 82 | void shiftOnIconChanged(); 83 | void shiftOffIconChanged(); 84 | void hideKeyboardIconChanged(); 85 | void languageIconChanged(); 86 | void availableLanguageLayoutsChanged(); 87 | void languageLayoutChanged(); 88 | 89 | private: 90 | struct InputPanelIfacePrivate; 91 | InputPanelIfacePrivate *pimpl; 92 | }; 93 | 94 | #endif // INPUTPANELIFACE_HPP 95 | -------------------------------------------------------------------------------- /src/VirtualKeyboardInputContext.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file VirtualKeyboardInputContext.h 3 | * 4 | * \brief Declaration of VirtualKeyboardInputContext 5 | * 6 | * \author Uwe Kindler 7 | * \date 08/01/2015 8 | * 9 | * Copyright (c) 2015 Uwe Kindler 10 | */ 11 | 12 | #ifndef VIRTUALKEYBOARDINPUTCONTEXT_H 13 | #define VIRTUALKEYBOARDINPUTCONTEXT_H 14 | 15 | #include 16 | 17 | #include 18 | #include 19 | 20 | class QQmlEngine; 21 | class QJSEngine; 22 | class VirtualKeyboardInputContextPrivate; 23 | 24 | /** 25 | * Implementation of QPlatformInputContext 26 | */ 27 | class VirtualKeyboardInputContext : public QPlatformInputContext { 28 | Q_OBJECT 29 | 30 | Q_PROPERTY(QObject *inputItem READ inputItem NOTIFY inputItemChanged) 31 | 32 | public: 33 | /** 34 | * Virtual destructor 35 | */ 36 | virtual ~VirtualKeyboardInputContext(); 37 | 38 | /** 39 | * Returns input context validity. Deriving implementations should 40 | * return true - so we simply return true 41 | */ 42 | virtual bool isValid() const; 43 | 44 | /** 45 | * This function can be reimplemented to return virtual keyboard rectangle 46 | * in currently active window coordinates. Default implementation returns 47 | * invalid rectangle. 48 | */ 49 | virtual QRectF keyboardRect() const; 50 | 51 | /** 52 | * Simply calls the emitInputPanelVisibleChanged() function 53 | */ 54 | virtual void showInputPanel(); 55 | 56 | /** 57 | * Simply calls the emitInputPanelVisibleChanged() function 58 | */ 59 | virtual void hideInputPanel(); 60 | 61 | /** 62 | * Returns input panel visibility status. 63 | * This value will be available in 64 | * QGuiApplication::inputMethod()->isVisible() 65 | */ 66 | virtual bool isInputPanelVisible() const; 67 | 68 | /** 69 | * This function returns true whenever input method is animating 70 | * shown or hidden. 71 | */ 72 | virtual bool isAnimating() const; 73 | 74 | /** 75 | * This virtual method gets called to notify updated focus to object. 76 | * \warning Input methods must not call this function directly. 77 | * This function does the main work. It sets the input mode of the 78 | * InputEngine singleton and it ensures that the focused QML object is 79 | * visible if it is a child item of a Flickable 80 | */ 81 | virtual void setFocusObject(QObject *object); 82 | 83 | /** 84 | * Use this static instance function to access the singleton input context 85 | * instance. 86 | */ 87 | static VirtualKeyboardInputContext *instance(); 88 | 89 | /** 90 | * This function returns the current input item focused. 91 | */ 92 | QObject *inputItem() const; 93 | 94 | /** 95 | * This function returns true whenever the current focus item has the 96 | * enter key action attached property. 97 | */ 98 | Q_INVOKABLE bool focusItemHasEnterKeyAction(QObject *item) const; 99 | 100 | /** 101 | * This function register the InputPanel (QQucikItem) to the backend 102 | * to handle the focusItem as parent 103 | */ 104 | Q_INVOKABLE void registerInputPanel(QObject *inputPanel); 105 | 106 | protected: 107 | /** 108 | * Protected constructor - use instance function to get the one and only 109 | * object 110 | */ 111 | VirtualKeyboardInputContext(); 112 | 113 | signals: 114 | void inputItemChanged(); 115 | 116 | private slots: 117 | /** 118 | * This function scrolls the QML item into visible area if the focused 119 | * QML item is child of a flickable 120 | */ 121 | void ensureFocusedObjectVisible(); 122 | 123 | private: 124 | /** 125 | * The input contet creates the InputEngine object and provides it 126 | * as a singleton to the QML context 127 | */ 128 | static QObject *inputEngineProvider(QQmlEngine *engine, 129 | QJSEngine *scriptEngine); 130 | 131 | /** 132 | * The input contet creates the InputPanel object and provides it 133 | * as a singleton to the QML context 134 | */ 135 | static QObject *inputPanelProvider(QQmlEngine *engine, 136 | QJSEngine *scriptEngine); 137 | 138 | /** 139 | * The input contet creates the InputContext object and provides it 140 | * as a singleton to the QML context 141 | */ 142 | static QObject *inputContextProvider(QQmlEngine *engine, 143 | QJSEngine *scriptEngine); 144 | 145 | private: 146 | VirtualKeyboardInputContextPrivate *d; 147 | QPointer inputPanel; 148 | QMetaObject::Connection visibleConnection; 149 | }; 150 | 151 | #endif // VIRTUALKEYBOARDINPUTCONTEXT_H 152 | -------------------------------------------------------------------------------- /src/DeclarativeInputEngine.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file DeclarativeInputEngine.h 3 | * 4 | * \brief Declaration of CDeclarativeInputEngine 5 | * 6 | * \author Uwe Kindler 7 | * \date 08/01/2015 8 | * 9 | * Copyright (c) 2015 Uwe Kindler 10 | */ 11 | 12 | #ifndef DECLARATIVEINPUTENGINE_H 13 | #define DECLARATIVEINPUTENGINE_H 14 | 15 | #include 16 | #include 17 | 18 | struct DeclarativeInputEnginePrivate; 19 | 20 | /** 21 | * The input engine provides input context information and is responsible 22 | * for routing input events to focused QML items. 23 | * The InputEngine can be accessed as singleton instance from QML 24 | */ 25 | class DeclarativeInputEngine : public QObject { 26 | Q_OBJECT 27 | 28 | // clang-format off 29 | Q_PROPERTY(QRect keyboardRectangle READ keyboardRectangle WRITE setKeyboardRectangle NOTIFY keyboardRectangleChanged FINAL) 30 | Q_PROPERTY(bool animating READ isAnimating WRITE setAnimating NOTIFY animatingChanged FINAL) 31 | Q_PROPERTY(int inputMode READ inputMode WRITE setInputMode NOTIFY inputModeChanged FINAL) 32 | Q_PROPERTY(bool uppercase READ isUppercase WRITE setUppercase NOTIFY isUppercaseChanged) 33 | Q_PROPERTY(bool symbolMode READ isSymbolMode WRITE setSymbolMode NOTIFY isSymbolModeChanged) 34 | // clang-format on 35 | 36 | public: 37 | /** 38 | * The InputLayouts enum provides a list of valid input layouts 39 | */ 40 | enum InputLayouts { 41 | En, 42 | Fr, 43 | It, 44 | Es, 45 | De, 46 | Nl, 47 | Pt, 48 | Cs, 49 | El, 50 | Pl, 51 | Da, 52 | Fi, 53 | Sv, 54 | Hr, 55 | CyBs, 56 | LtBs, 57 | CySr, 58 | LtSr, 59 | Ru, 60 | Uk, 61 | EndLayouts 62 | }; 63 | Q_ENUM(InputLayouts) 64 | 65 | /** 66 | * The InputMode enum provides a list of valid input modes 67 | */ 68 | enum InputMode { Letters, DigitsOnly }; 69 | Q_ENUMS(InputMode) 70 | 71 | /** 72 | * Creates a dclarative input engine with the given parent 73 | */ 74 | explicit DeclarativeInputEngine(QObject *parent = 0); 75 | 76 | /** 77 | * Virtual destructor 78 | */ 79 | virtual ~DeclarativeInputEngine(); 80 | 81 | /** 82 | * Returns the kesyboard rectangle 83 | */ 84 | QRect keyboardRectangle() const; 85 | 86 | /** 87 | * Returns the animating status 88 | */ 89 | bool isAnimating() const; 90 | 91 | /** 92 | * Use this property to set the animating status, for example during UI 93 | * transitioning states. 94 | */ 95 | void setAnimating(bool Animating); 96 | 97 | /** 98 | * Returns the current input mode 99 | * \see InputMode for a list of valid input modes 100 | */ 101 | int inputMode() const; 102 | 103 | /** 104 | * Use this function to set the current input mode 105 | * \see InputMode for a list of valid input modes 106 | */ 107 | void setInputMode(int Mode); 108 | 109 | bool isUppercase() const; 110 | void setUppercase(bool uppercase); 111 | 112 | bool isSymbolMode() const; 113 | void setSymbolMode(bool symbolMode); 114 | 115 | Q_INVOKABLE bool inputLayoutValid(const QString &layout) const; 116 | 117 | /** 118 | * Use this function to get the correct layout file for each language 119 | * (some languages share one file) 120 | */ 121 | Q_INVOKABLE QString fileOfLayout(QString layout); 122 | 123 | /** 124 | * Use this function to get the correct description for each language 125 | */ 126 | Q_INVOKABLE QString descriptionOfLayout(QString layout); 127 | 128 | /** 129 | * Use this function to get the correct 'space'-identifier for each language 130 | */ 131 | Q_INVOKABLE QString spaceIdentifierOfLayout(QString layout); 132 | 133 | public slots: 134 | /** 135 | * Emits a key click event for the given key, text and modifiers. 136 | * Returns true if the key event was accepted by the input engine. 137 | * \note Not implemented yet and not used yet 138 | */ 139 | bool virtualKeyClick(Qt::Key key, const QString &text, 140 | Qt::KeyboardModifiers modifiers); 141 | 142 | /** 143 | * Reports the active keyboard rectangle to the engine 144 | */ 145 | void setKeyboardRectangle(const QRect &Rect); 146 | 147 | signals: 148 | /** 149 | * Notify signal of keyboardRectangle property 150 | */ 151 | void keyboardRectangleChanged(); 152 | 153 | /** 154 | * Notify signal of animating property 155 | */ 156 | void animatingChanged(); 157 | 158 | /** 159 | * Notify signal of inputModep property 160 | */ 161 | void inputModeChanged(); 162 | 163 | void isUppercaseChanged(); 164 | void isSymbolModeChanged(); 165 | 166 | private: 167 | DeclarativeInputEnginePrivate *d; 168 | 169 | friend struct DeclarativeInputEnginePrivate; 170 | 171 | private slots: 172 | void animatingFinished(); 173 | }; 174 | 175 | #endif // DECLARATIVEINPUTENGINE_H 176 | -------------------------------------------------------------------------------- /src/qml/ElLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnText: "ς" 12 | inputPanelRef: inputPanel 13 | } 14 | 15 | Key { 16 | btnText: "ε" 17 | alternativeKeys: "έ" 18 | inputPanelRef: inputPanel 19 | } 20 | 21 | Key { 22 | btnText: "ρ" 23 | inputPanelRef: inputPanel 24 | } 25 | 26 | Key { 27 | btnText: "τ" 28 | inputPanelRef: inputPanel 29 | } 30 | 31 | Key { 32 | btnText: "ψ" 33 | inputPanelRef: inputPanel 34 | } 35 | 36 | Key { 37 | btnText: "υ" 38 | alternativeKeys: "ύϋΰ" 39 | inputPanelRef: inputPanel 40 | } 41 | 42 | Key { 43 | btnText: "θ" 44 | inputPanelRef: inputPanel 45 | } 46 | 47 | Key { 48 | btnText: "ι" 49 | alternativeKeys: "ίϊΐ" 50 | inputPanelRef: inputPanel 51 | } 52 | 53 | Key { 54 | btnText: "ο" 55 | alternativeKeys: "ό" 56 | inputPanelRef: inputPanel 57 | } 58 | 59 | Key { 60 | btnText: "π" 61 | inputPanelRef: inputPanel 62 | } 63 | 64 | BackspaceKey { 65 | inputPanelRef: inputPanel 66 | } 67 | 68 | } 69 | 70 | RowLayout { 71 | property real keyWeight: 160 72 | 73 | Key { 74 | weight: 56 75 | functionKey: true 76 | showPreview: false 77 | btnBackground: "transparent" 78 | } 79 | 80 | Key { 81 | btnText: "α" 82 | alternativeKeys: "ά" 83 | inputPanelRef: inputPanel 84 | } 85 | 86 | Key { 87 | btnText: "σ" 88 | inputPanelRef: inputPanel 89 | } 90 | 91 | Key { 92 | btnText: "δ" 93 | inputPanelRef: inputPanel 94 | } 95 | 96 | Key { 97 | btnText: "φ" 98 | inputPanelRef: inputPanel 99 | } 100 | 101 | Key { 102 | btnText: "γ" 103 | inputPanelRef: inputPanel 104 | } 105 | 106 | Key { 107 | btnText: "η" 108 | alternativeKeys: "ή" 109 | inputPanelRef: inputPanel 110 | } 111 | 112 | Key { 113 | btnText: "ξ" 114 | inputPanelRef: inputPanel 115 | } 116 | 117 | Key { 118 | btnText: "κ" 119 | inputPanelRef: inputPanel 120 | } 121 | 122 | Key { 123 | btnText: "λ" 124 | inputPanelRef: inputPanel 125 | } 126 | 127 | EnterKey { 128 | weight: 283 129 | inputPanelRef: inputPanel 130 | } 131 | 132 | } 133 | 134 | RowLayout { 135 | property real keyWeight: 156 136 | 137 | ShiftKey { 138 | } 139 | 140 | Key { 141 | btnText: "ζ" 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | Key { 146 | btnText: "χ" 147 | inputPanelRef: inputPanel 148 | } 149 | 150 | Key { 151 | btnText: "ψ" 152 | inputPanelRef: inputPanel 153 | } 154 | 155 | Key { 156 | btnText: "ω" 157 | alternativeKeys: "ώ" 158 | inputPanelRef: inputPanel 159 | } 160 | 161 | Key { 162 | btnText: "β" 163 | inputPanelRef: inputPanel 164 | } 165 | 166 | Key { 167 | btnText: "ν" 168 | inputPanelRef: inputPanel 169 | } 170 | 171 | Key { 172 | btnText: "μ" 173 | inputPanelRef: inputPanel 174 | } 175 | 176 | Key { 177 | btnKey: Qt.Key_Comma 178 | btnText: "," 179 | inputPanelRef: inputPanel 180 | } 181 | 182 | Key { 183 | btnKey: Qt.Key_Period 184 | btnText: "." 185 | alternativeKeys: "!.;?" 186 | inputPanelRef: inputPanel 187 | } 188 | 189 | ShiftKey { 190 | weight: 204 191 | } 192 | 193 | } 194 | 195 | RowLayout { 196 | property real keyWeight: 154 197 | 198 | SymbolKey { 199 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 200 | } 201 | 202 | LanguageKey { 203 | visible: availableLanguageLayouts.length > 1 204 | weight: 108.5 205 | } 206 | 207 | SpaceKey { 208 | weight: 1168 209 | inputPanelRef: inputPanel 210 | } 211 | 212 | Key { 213 | btnKey: Qt.Key_Apostrophe 214 | btnText: "'" 215 | inputPanelRef: inputPanel 216 | } 217 | 218 | HideKey { 219 | weight: 205 220 | } 221 | 222 | } 223 | 224 | } 225 | -------------------------------------------------------------------------------- /src/qml/RuLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnText: "й" 12 | inputPanelRef: inputPanel 13 | } 14 | 15 | Key { 16 | btnText: "ц" 17 | inputPanelRef: inputPanel 18 | } 19 | 20 | Key { 21 | btnText: "у" 22 | inputPanelRef: inputPanel 23 | } 24 | 25 | Key { 26 | btnText: "к" 27 | inputPanelRef: inputPanel 28 | } 29 | 30 | Key { 31 | btnText: "е" 32 | alternativeKeys: "ё" 33 | inputPanelRef: inputPanel 34 | } 35 | 36 | Key { 37 | btnText: "н" 38 | inputPanelRef: inputPanel 39 | } 40 | 41 | Key { 42 | btnText: "г" 43 | inputPanelRef: inputPanel 44 | } 45 | 46 | Key { 47 | btnText: "ш" 48 | inputPanelRef: inputPanel 49 | } 50 | 51 | Key { 52 | btnText: "щ" 53 | inputPanelRef: inputPanel 54 | } 55 | 56 | Key { 57 | btnText: "з" 58 | inputPanelRef: inputPanel 59 | } 60 | 61 | Key { 62 | btnText: "х" 63 | inputPanelRef: inputPanel 64 | } 65 | 66 | BackspaceKey { 67 | inputPanelRef: inputPanel 68 | } 69 | 70 | } 71 | 72 | RowLayout { 73 | property real keyWeight: 160 74 | 75 | Key { 76 | weight: 56 77 | functionKey: true 78 | showPreview: false 79 | btnBackground: "transparent" 80 | } 81 | 82 | Key { 83 | btnText: "ф" 84 | inputPanelRef: inputPanel 85 | } 86 | 87 | Key { 88 | btnText: "ы" 89 | inputPanelRef: inputPanel 90 | } 91 | 92 | Key { 93 | btnText: "в" 94 | inputPanelRef: inputPanel 95 | } 96 | 97 | Key { 98 | btnText: "а" 99 | inputPanelRef: inputPanel 100 | } 101 | 102 | Key { 103 | btnText: "п" 104 | inputPanelRef: inputPanel 105 | } 106 | 107 | Key { 108 | btnText: "р" 109 | inputPanelRef: inputPanel 110 | } 111 | 112 | Key { 113 | btnText: "о" 114 | inputPanelRef: inputPanel 115 | } 116 | 117 | Key { 118 | btnText: "л" 119 | inputPanelRef: inputPanel 120 | } 121 | 122 | Key { 123 | btnText: "д" 124 | inputPanelRef: inputPanel 125 | } 126 | 127 | Key { 128 | btnText: "ж" 129 | inputPanelRef: inputPanel 130 | } 131 | 132 | Key { 133 | btnText: "э" 134 | inputPanelRef: inputPanel 135 | } 136 | 137 | EnterKey { 138 | weight: 283 139 | inputPanelRef: inputPanel 140 | } 141 | } 142 | 143 | RowLayout { 144 | property real keyWeight: 156 145 | 146 | ShiftKey { 147 | } 148 | 149 | Key { 150 | btnText: "я" 151 | inputPanelRef: inputPanel 152 | } 153 | 154 | Key { 155 | btnText: "ч" 156 | inputPanelRef: inputPanel 157 | } 158 | 159 | Key { 160 | btnText: "с" 161 | inputPanelRef: inputPanel 162 | } 163 | 164 | Key { 165 | btnText: "м" 166 | inputPanelRef: inputPanel 167 | } 168 | 169 | Key { 170 | btnText: "и" 171 | inputPanelRef: inputPanel 172 | } 173 | 174 | Key { 175 | btnText: "т" 176 | inputPanelRef: inputPanel 177 | } 178 | 179 | Key { 180 | btnText: "ь" 181 | alternativeKeys: "ъ" 182 | inputPanelRef: inputPanel 183 | } 184 | 185 | Key { 186 | btnText: "б" 187 | inputPanelRef: inputPanel 188 | } 189 | 190 | Key { 191 | btnText: "ю" 192 | inputPanelRef: inputPanel 193 | } 194 | 195 | ShiftKey { 196 | weight: 204 197 | } 198 | 199 | } 200 | 201 | RowLayout { 202 | property real keyWeight: 154 203 | 204 | SymbolKey { 205 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 206 | } 207 | 208 | LanguageKey { 209 | visible: availableLanguageLayouts.length > 1 210 | weight: 108.5 211 | } 212 | 213 | SpaceKey { 214 | weight: 1168 215 | inputPanelRef: inputPanel 216 | } 217 | 218 | Key { 219 | btnKey: Qt.Key_Period 220 | btnText: "." 221 | alternativeKeys: "," 222 | inputPanelRef: inputPanel 223 | } 224 | 225 | HideKey { 226 | weight: 205 227 | } 228 | 229 | } 230 | 231 | } 232 | -------------------------------------------------------------------------------- /src/qml/UkLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnText: "й" 12 | inputPanelRef: inputPanel 13 | } 14 | 15 | Key { 16 | btnText: "ц" 17 | inputPanelRef: inputPanel 18 | } 19 | 20 | Key { 21 | btnText: "у" 22 | inputPanelRef: inputPanel 23 | } 24 | 25 | Key { 26 | btnText: "к" 27 | inputPanelRef: inputPanel 28 | } 29 | 30 | Key { 31 | btnText: "е" 32 | alternativeKeys: "ё" 33 | inputPanelRef: inputPanel 34 | } 35 | 36 | Key { 37 | btnText: "н" 38 | inputPanelRef: inputPanel 39 | } 40 | 41 | Key { 42 | btnText: "г" 43 | alternativeKeys: "ґ" 44 | inputPanelRef: inputPanel 45 | } 46 | 47 | Key { 48 | btnText: "ш" 49 | inputPanelRef: inputPanel 50 | } 51 | 52 | Key { 53 | btnText: "щ" 54 | inputPanelRef: inputPanel 55 | } 56 | 57 | Key { 58 | btnText: "з" 59 | inputPanelRef: inputPanel 60 | } 61 | 62 | Key { 63 | btnText: "х" 64 | inputPanelRef: inputPanel 65 | } 66 | 67 | BackspaceKey { 68 | inputPanelRef: inputPanel 69 | } 70 | 71 | } 72 | 73 | RowLayout { 74 | property real keyWeight: 160 75 | 76 | Key { 77 | weight: 56 78 | functionKey: true 79 | showPreview: false 80 | btnBackground: "transparent" 81 | } 82 | 83 | Key { 84 | btnText: "ф" 85 | inputPanelRef: inputPanel 86 | } 87 | 88 | Key { 89 | btnText: "і" 90 | alternativeKeys: "ї" 91 | inputPanelRef: inputPanel 92 | } 93 | 94 | Key { 95 | btnText: "в" 96 | inputPanelRef: inputPanel 97 | } 98 | 99 | Key { 100 | btnText: "а" 101 | inputPanelRef: inputPanel 102 | } 103 | 104 | Key { 105 | btnText: "п" 106 | inputPanelRef: inputPanel 107 | } 108 | 109 | Key { 110 | btnText: "р" 111 | inputPanelRef: inputPanel 112 | } 113 | 114 | Key { 115 | btnText: "о" 116 | inputPanelRef: inputPanel 117 | } 118 | 119 | Key { 120 | btnText: "л" 121 | inputPanelRef: inputPanel 122 | } 123 | 124 | Key { 125 | btnText: "д" 126 | inputPanelRef: inputPanel 127 | } 128 | 129 | Key { 130 | btnText: "ж" 131 | inputPanelRef: inputPanel 132 | } 133 | 134 | Key { 135 | btnText: "є" 136 | alternativeKeys: "э" 137 | inputPanelRef: inputPanel 138 | } 139 | 140 | EnterKey { 141 | weight: 283 142 | inputPanelRef: inputPanel 143 | } 144 | } 145 | 146 | RowLayout { 147 | property real keyWeight: 156 148 | 149 | ShiftKey { 150 | } 151 | 152 | Key { 153 | btnText: "я" 154 | inputPanelRef: inputPanel 155 | } 156 | 157 | Key { 158 | btnText: "ч" 159 | inputPanelRef: inputPanel 160 | } 161 | 162 | Key { 163 | btnText: "с" 164 | inputPanelRef: inputPanel 165 | } 166 | 167 | Key { 168 | btnText: "м" 169 | inputPanelRef: inputPanel 170 | } 171 | 172 | Key { 173 | btnText: "и" 174 | inputPanelRef: inputPanel 175 | } 176 | 177 | Key { 178 | btnText: "т" 179 | inputPanelRef: inputPanel 180 | } 181 | 182 | Key { 183 | btnText: "ь" 184 | alternativeKeys: "ъ" 185 | inputPanelRef: inputPanel 186 | } 187 | 188 | Key { 189 | btnText: "б" 190 | inputPanelRef: inputPanel 191 | } 192 | 193 | Key { 194 | btnText: "ю" 195 | inputPanelRef: inputPanel 196 | } 197 | 198 | ShiftKey { 199 | weight: 204 200 | } 201 | 202 | } 203 | 204 | RowLayout { 205 | property real keyWeight: 154 206 | 207 | SymbolKey { 208 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 209 | } 210 | 211 | LanguageKey { 212 | visible: availableLanguageLayouts.length > 1 213 | weight: 108.5 214 | } 215 | 216 | SpaceKey { 217 | weight: 1168 218 | inputPanelRef: inputPanel 219 | } 220 | 221 | Key { 222 | btnKey: Qt.Key_Period 223 | btnText: "." 224 | alternativeKeys: "," 225 | inputPanelRef: inputPanel 226 | } 227 | 228 | HideKey { 229 | weight: 205 230 | } 231 | 232 | } 233 | 234 | } 235 | -------------------------------------------------------------------------------- /src/InputPanelIface.cpp: -------------------------------------------------------------------------------- 1 | #include "InputPanelIface.hpp" 2 | 3 | struct InputPanelIface::InputPanelIfacePrivate { 4 | QColor backgroundColor{}; 5 | QColor btnBackgroundColor{}; 6 | QColor btnSpecialBackgroundColor{}; 7 | QColor btnTextColor{}; 8 | QString btnTextFontFamily{}; 9 | QString backspaceIcon{}; 10 | QString enterIcon{}; 11 | QString shiftOnIcon{}; 12 | QString shiftOffIcon{}; 13 | QString hideKeyboardIcon{}; 14 | QString languageIcon{}; 15 | QStringList availableLanguageLayouts{}; 16 | QString languageLayout{}; 17 | }; 18 | 19 | InputPanelIface::InputPanelIface(QObject *parent) 20 | : QObject(parent), pimpl(new InputPanelIfacePrivate) {} 21 | 22 | InputPanelIface::~InputPanelIface() { 23 | if (pimpl != nullptr) { 24 | delete pimpl; 25 | } 26 | } 27 | 28 | QColor InputPanelIface::backgroundColor() const { 29 | return pimpl->backgroundColor; 30 | } 31 | 32 | void InputPanelIface::setBackgroundColor(const QColor &backgroundColor) { 33 | if (pimpl->backgroundColor != backgroundColor) { 34 | pimpl->backgroundColor = backgroundColor; 35 | emit backgroundColorChanged(); 36 | } 37 | } 38 | 39 | QColor InputPanelIface::btnBackgroundColor() const { 40 | return pimpl->btnBackgroundColor; 41 | } 42 | 43 | void InputPanelIface::setBtnBackgroundColor(const QColor &btnBackgroundColor) { 44 | if (pimpl->btnBackgroundColor != btnBackgroundColor) { 45 | pimpl->btnBackgroundColor = btnBackgroundColor; 46 | emit btnBackgroundColorChanged(); 47 | } 48 | } 49 | 50 | QColor InputPanelIface::btnSpecialBackgroundColor() const { 51 | return pimpl->btnSpecialBackgroundColor; 52 | } 53 | 54 | void InputPanelIface::setBtnSpecialBackgroundColor( 55 | const QColor &btnSpecialBackgroundColor) { 56 | if (pimpl->btnSpecialBackgroundColor != btnSpecialBackgroundColor) { 57 | pimpl->btnSpecialBackgroundColor = btnSpecialBackgroundColor; 58 | emit btnSpecialBackgroundColorChanged(); 59 | } 60 | } 61 | 62 | QColor InputPanelIface::btnTextColor() const { return pimpl->btnTextColor; } 63 | 64 | void InputPanelIface::setBtnTextColor(const QColor &btnTextColor) { 65 | if (pimpl->btnTextColor != btnTextColor) { 66 | pimpl->btnTextColor = btnTextColor; 67 | emit btnTextColorChanged(); 68 | } 69 | } 70 | 71 | QString InputPanelIface::btnTextFontFamily() const { 72 | return pimpl->btnTextFontFamily; 73 | } 74 | 75 | void InputPanelIface::setBtnTextFontFamily(const QString &btnTextFontFamily) { 76 | if (pimpl->btnTextFontFamily != btnTextFontFamily) { 77 | pimpl->btnTextFontFamily = btnTextFontFamily; 78 | emit btnTextFontFamilyChanged(); 79 | } 80 | } 81 | 82 | QString InputPanelIface::backspaceIcon() const { return pimpl->backspaceIcon; } 83 | 84 | void InputPanelIface::setBackspaceIcon(const QString &backspaceIcon) { 85 | if (pimpl->backspaceIcon != backspaceIcon) { 86 | pimpl->backspaceIcon = backspaceIcon; 87 | emit backspaceIconChanged(); 88 | } 89 | } 90 | 91 | QString InputPanelIface::enterIcon() const { return pimpl->enterIcon; } 92 | 93 | void InputPanelIface::setEnterIcon(const QString &enterIcon) { 94 | if (pimpl->enterIcon != enterIcon) { 95 | pimpl->enterIcon = enterIcon; 96 | emit enterIconChanged(); 97 | } 98 | } 99 | 100 | QString InputPanelIface::shiftOnIcon() const { return pimpl->shiftOnIcon; } 101 | 102 | void InputPanelIface::setShiftOnIcon(const QString &shiftOnIcon) { 103 | if (pimpl->shiftOnIcon != shiftOnIcon) { 104 | pimpl->shiftOnIcon = shiftOnIcon; 105 | emit shiftOnIconChanged(); 106 | } 107 | } 108 | 109 | QString InputPanelIface::shiftOffIcon() const { return pimpl->shiftOffIcon; } 110 | 111 | void InputPanelIface::setShiftOffIcon(const QString &shiftOffIcon) { 112 | if (pimpl->shiftOffIcon != shiftOffIcon) { 113 | pimpl->shiftOffIcon = shiftOffIcon; 114 | emit shiftOffIconChanged(); 115 | } 116 | } 117 | 118 | QString InputPanelIface::hideKeyboardIcon() const { 119 | return pimpl->hideKeyboardIcon; 120 | } 121 | 122 | void InputPanelIface::setHideKeyboardIcon(const QString &hideKeyboardIcon) { 123 | if (pimpl->hideKeyboardIcon != hideKeyboardIcon) { 124 | pimpl->hideKeyboardIcon = hideKeyboardIcon; 125 | emit hideKeyboardIconChanged(); 126 | } 127 | } 128 | 129 | QString InputPanelIface::languageIcon() const { return pimpl->languageIcon; } 130 | 131 | void InputPanelIface::setLanguageIcon(const QString &languageIcon) { 132 | if (pimpl->languageIcon != languageIcon) { 133 | pimpl->languageIcon = languageIcon; 134 | emit languageIconChanged(); 135 | } 136 | } 137 | 138 | QStringList InputPanelIface::availableLanguageLayouts() const { 139 | return pimpl->availableLanguageLayouts; 140 | } 141 | 142 | void InputPanelIface::setAvailableLanguageLayouts( 143 | const QStringList &availableLanguageLayouts) { 144 | if (pimpl->availableLanguageLayouts != availableLanguageLayouts) { 145 | pimpl->availableLanguageLayouts = availableLanguageLayouts; 146 | emit availableLanguageLayoutsChanged(); 147 | } 148 | } 149 | 150 | QString InputPanelIface::languageLayout() const { 151 | return pimpl->languageLayout; 152 | } 153 | 154 | void InputPanelIface::setLanguageLayout(const QString &languageLayout) { 155 | if (pimpl->languageLayout != languageLayout) { 156 | pimpl->languageLayout = languageLayout; 157 | emit languageLayoutChanged(); 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /src/qml/CySrBsLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnText: "љ" 12 | inputPanelRef: inputPanel 13 | } 14 | 15 | Key { 16 | btnText: "Њ" 17 | inputPanelRef: inputPanel 18 | } 19 | 20 | Key { 21 | btnText: "е" 22 | inputPanelRef: inputPanel 23 | } 24 | 25 | Key { 26 | btnText: "р" 27 | inputPanelRef: inputPanel 28 | } 29 | 30 | Key { 31 | btnText: "т" 32 | inputPanelRef: inputPanel 33 | } 34 | 35 | Key { 36 | btnText: "з" 37 | inputPanelRef: inputPanel 38 | } 39 | 40 | Key { 41 | btnText: "у" 42 | inputPanelRef: inputPanel 43 | } 44 | 45 | Key { 46 | btnText: "и" 47 | alternativeKeys: "ίϊΐ" 48 | inputPanelRef: inputPanel 49 | } 50 | 51 | Key { 52 | btnText: "о" 53 | alternativeKeys: "ό" 54 | inputPanelRef: inputPanel 55 | } 56 | 57 | Key { 58 | btnText: "п" 59 | inputPanelRef: inputPanel 60 | } 61 | 62 | Key { 63 | btnText: "ш" 64 | inputPanelRef: inputPanel 65 | } 66 | 67 | BackspaceKey { 68 | inputPanelRef: inputPanel 69 | } 70 | 71 | } 72 | 73 | RowLayout { 74 | property real keyWeight: 160 75 | 76 | Key { 77 | weight: 56 78 | functionKey: true 79 | showPreview: false 80 | btnBackground: "transparent" 81 | } 82 | 83 | Key { 84 | btnText: "а" 85 | inputPanelRef: inputPanel 86 | } 87 | 88 | Key { 89 | btnText: "с" 90 | inputPanelRef: inputPanel 91 | } 92 | 93 | Key { 94 | btnText: "д" 95 | inputPanelRef: inputPanel 96 | } 97 | 98 | Key { 99 | btnText: "ф" 100 | inputPanelRef: inputPanel 101 | } 102 | 103 | Key { 104 | btnText: "г" 105 | inputPanelRef: inputPanel 106 | } 107 | 108 | Key { 109 | btnText: "х" 110 | alternativeKeys: "ή" 111 | inputPanelRef: inputPanel 112 | } 113 | 114 | Key { 115 | btnText: "ј" 116 | inputPanelRef: inputPanel 117 | } 118 | 119 | Key { 120 | btnText: "к" 121 | inputPanelRef: inputPanel 122 | } 123 | 124 | Key { 125 | btnText: "л" 126 | inputPanelRef: inputPanel 127 | } 128 | 129 | Key { 130 | btnText: "ч" 131 | inputPanelRef: inputPanel 132 | } 133 | 134 | Key { 135 | btnText: "ћ" 136 | inputPanelRef: inputPanel 137 | } 138 | 139 | EnterKey { 140 | weight: 283 141 | inputPanelRef: inputPanel 142 | } 143 | 144 | } 145 | 146 | RowLayout { 147 | property real keyWeight: 156 148 | 149 | ShiftKey { 150 | } 151 | 152 | Key { 153 | btnText: "џ" 154 | inputPanelRef: inputPanel 155 | } 156 | 157 | Key { 158 | btnText: "ц" 159 | inputPanelRef: inputPanel 160 | } 161 | 162 | Key { 163 | btnText: "в" 164 | inputPanelRef: inputPanel 165 | } 166 | 167 | Key { 168 | btnText: "б" 169 | inputPanelRef: inputPanel 170 | } 171 | 172 | Key { 173 | btnText: "н" 174 | inputPanelRef: inputPanel 175 | } 176 | 177 | Key { 178 | btnText: "м" 179 | inputPanelRef: inputPanel 180 | } 181 | 182 | Key { 183 | btnText: "ђ" 184 | inputPanelRef: inputPanel 185 | } 186 | 187 | Key { 188 | btnText: "ж" 189 | inputPanelRef: inputPanel 190 | } 191 | 192 | Key { 193 | btnKey: Qt.Key_Comma 194 | btnText: "," 195 | inputPanelRef: inputPanel 196 | } 197 | 198 | Key { 199 | btnKey: Qt.Key_Period 200 | btnText: "." 201 | inputPanelRef: inputPanel 202 | } 203 | 204 | Key { 205 | btnKey: Qt.Key_Minus 206 | btnText: "-" 207 | inputPanelRef: inputPanel 208 | } 209 | 210 | ShiftKey { 211 | weight: 204 212 | } 213 | 214 | } 215 | 216 | RowLayout { 217 | property real keyWeight: 154 218 | 219 | SymbolKey { 220 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 221 | } 222 | 223 | LanguageKey { 224 | visible: availableLanguageLayouts.length > 1 225 | weight: 108.5 226 | } 227 | 228 | SpaceKey { 229 | weight: 1168 230 | inputPanelRef: inputPanel 231 | } 232 | 233 | Key { 234 | btnText: "'" 235 | inputPanelRef: inputPanel 236 | } 237 | 238 | HideKey { 239 | weight: 205 240 | } 241 | 242 | } 243 | 244 | } 245 | -------------------------------------------------------------------------------- /src/qml/QwertyLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | inputPanelRef: inputPanel 26 | } 27 | 28 | Key { 29 | btnKey: Qt.Key_R 30 | btnText: "r" 31 | inputPanelRef: inputPanel 32 | } 33 | 34 | Key { 35 | btnKey: Qt.Key_T 36 | btnText: "t" 37 | inputPanelRef: inputPanel 38 | } 39 | 40 | Key { 41 | btnKey: Qt.Key_Y 42 | btnText: "y" 43 | inputPanelRef: inputPanel 44 | } 45 | 46 | Key { 47 | btnKey: Qt.Key_U 48 | btnText: "u" 49 | inputPanelRef: inputPanel 50 | } 51 | 52 | Key { 53 | btnKey: Qt.Key_I 54 | btnText: "i" 55 | inputPanelRef: inputPanel 56 | } 57 | 58 | Key { 59 | btnKey: Qt.Key_O 60 | btnText: "o" 61 | inputPanelRef: inputPanel 62 | } 63 | 64 | Key { 65 | btnKey: Qt.Key_P 66 | btnText: "p" 67 | inputPanelRef: inputPanel 68 | } 69 | 70 | BackspaceKey { 71 | inputPanelRef: inputPanel 72 | } 73 | 74 | } 75 | 76 | RowLayout { 77 | property real keyWeight: 160 78 | 79 | Key { 80 | weight: 56 81 | functionKey: true 82 | showPreview: false 83 | btnBackground: "transparent" 84 | } 85 | 86 | Key { 87 | btnKey: Qt.Key_A 88 | btnText: "a" 89 | inputPanelRef: inputPanel 90 | } 91 | 92 | Key { 93 | btnKey: Qt.Key_S 94 | btnText: "s" 95 | inputPanelRef: inputPanel 96 | } 97 | 98 | Key { 99 | btnKey: Qt.Key_D 100 | btnText: "d" 101 | inputPanelRef: inputPanel 102 | } 103 | 104 | Key { 105 | btnKey: Qt.Key_F 106 | btnText: "f" 107 | inputPanelRef: inputPanel 108 | } 109 | 110 | Key { 111 | btnKey: Qt.Key_G 112 | btnText: "g" 113 | inputPanelRef: inputPanel 114 | } 115 | 116 | Key { 117 | btnKey: Qt.Key_H 118 | btnText: "h" 119 | inputPanelRef: inputPanel 120 | } 121 | 122 | Key { 123 | btnKey: Qt.Key_J 124 | btnText: "j" 125 | inputPanelRef: inputPanel 126 | } 127 | 128 | Key { 129 | btnKey: Qt.Key_K 130 | btnText: "k" 131 | inputPanelRef: inputPanel 132 | } 133 | 134 | Key { 135 | btnKey: Qt.Key_L 136 | btnText: "l" 137 | inputPanelRef: inputPanel 138 | } 139 | 140 | EnterKey { 141 | weight: 283 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | } 146 | 147 | RowLayout { 148 | property real keyWeight: 156 149 | 150 | ShiftKey { 151 | } 152 | 153 | Key { 154 | btnKey: Qt.Key_Z 155 | btnText: "z" 156 | inputPanelRef: inputPanel 157 | } 158 | 159 | Key { 160 | btnKey: Qt.Key_X 161 | btnText: "x" 162 | inputPanelRef: inputPanel 163 | } 164 | 165 | Key { 166 | btnKey: Qt.Key_C 167 | btnText: "c" 168 | inputPanelRef: inputPanel 169 | } 170 | 171 | Key { 172 | btnKey: Qt.Key_V 173 | btnText: "v" 174 | inputPanelRef: inputPanel 175 | } 176 | 177 | Key { 178 | btnKey: Qt.Key_B 179 | btnText: "b" 180 | inputPanelRef: inputPanel 181 | } 182 | 183 | Key { 184 | btnKey: Qt.Key_N 185 | btnText: "n" 186 | inputPanelRef: inputPanel 187 | } 188 | 189 | Key { 190 | btnKey: Qt.Key_M 191 | btnText: "m" 192 | inputPanelRef: inputPanel 193 | } 194 | 195 | Key { 196 | btnKey: Qt.Key_Comma 197 | btnText: "," 198 | inputPanelRef: inputPanel 199 | } 200 | 201 | Key { 202 | btnKey: Qt.Key_Period 203 | btnText: "." 204 | inputPanelRef: inputPanel 205 | } 206 | 207 | ShiftKey { 208 | weight: 204 209 | } 210 | 211 | } 212 | 213 | RowLayout { 214 | property real keyWeight: 154 215 | 216 | SymbolKey { 217 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 218 | } 219 | 220 | LanguageKey { 221 | visible: availableLanguageLayouts.length > 1 222 | weight: 108.5 223 | } 224 | 225 | SpaceKey { 226 | weight: 1168 227 | inputPanelRef: inputPanel 228 | showLanguageDescription: false 229 | } 230 | 231 | Key { 232 | btnKey: Qt.Key_Apostrophe 233 | btnText: "'" 234 | inputPanelRef: inputPanel 235 | } 236 | 237 | HideKey { 238 | weight: 205 239 | } 240 | 241 | } 242 | 243 | } 244 | -------------------------------------------------------------------------------- /src/qml/ItLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | alternativeKeys: "èé" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_R 31 | btnText: "r" 32 | inputPanelRef: inputPanel 33 | } 34 | 35 | Key { 36 | btnKey: Qt.Key_T 37 | btnText: "t" 38 | inputPanelRef: inputPanel 39 | } 40 | 41 | Key { 42 | btnKey: Qt.Key_Y 43 | btnText: "y" 44 | inputPanelRef: inputPanel 45 | } 46 | 47 | Key { 48 | btnKey: Qt.Key_U 49 | btnText: "u" 50 | alternativeKeys: "ùú" 51 | inputPanelRef: inputPanel 52 | } 53 | 54 | Key { 55 | btnKey: Qt.Key_I 56 | btnText: "i" 57 | alternativeKeys: "ìí" 58 | inputPanelRef: inputPanel 59 | } 60 | 61 | Key { 62 | btnKey: Qt.Key_O 63 | btnText: "o" 64 | alternativeKeys: "òó" 65 | inputPanelRef: inputPanel 66 | } 67 | 68 | Key { 69 | btnKey: Qt.Key_P 70 | btnText: "p" 71 | inputPanelRef: inputPanel 72 | } 73 | 74 | BackspaceKey { 75 | inputPanelRef: inputPanel 76 | } 77 | 78 | } 79 | 80 | RowLayout { 81 | property real keyWeight: 160 82 | 83 | Key { 84 | weight: 56 85 | functionKey: true 86 | showPreview: false 87 | btnBackground: "transparent" 88 | } 89 | 90 | Key { 91 | btnKey: Qt.Key_A 92 | btnText: "a" 93 | alternativeKeys: "àá" 94 | inputPanelRef: inputPanel 95 | } 96 | 97 | Key { 98 | btnKey: Qt.Key_S 99 | btnText: "s" 100 | inputPanelRef: inputPanel 101 | } 102 | 103 | Key { 104 | btnKey: Qt.Key_D 105 | btnText: "d" 106 | inputPanelRef: inputPanel 107 | } 108 | 109 | Key { 110 | btnKey: Qt.Key_F 111 | btnText: "f" 112 | inputPanelRef: inputPanel 113 | } 114 | 115 | Key { 116 | btnKey: Qt.Key_G 117 | btnText: "g" 118 | inputPanelRef: inputPanel 119 | } 120 | 121 | Key { 122 | btnKey: Qt.Key_H 123 | btnText: "h" 124 | inputPanelRef: inputPanel 125 | } 126 | 127 | Key { 128 | btnKey: Qt.Key_J 129 | btnText: "j" 130 | inputPanelRef: inputPanel 131 | } 132 | 133 | Key { 134 | btnKey: Qt.Key_K 135 | btnText: "k" 136 | inputPanelRef: inputPanel 137 | } 138 | 139 | Key { 140 | btnKey: Qt.Key_L 141 | btnText: "l" 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | EnterKey { 146 | weight: 283 147 | inputPanelRef: inputPanel 148 | } 149 | 150 | } 151 | 152 | RowLayout { 153 | property real keyWeight: 156 154 | 155 | ShiftKey { 156 | } 157 | 158 | Key { 159 | btnKey: Qt.Key_Z 160 | btnText: "z" 161 | inputPanelRef: inputPanel 162 | } 163 | 164 | Key { 165 | btnKey: Qt.Key_X 166 | btnText: "x" 167 | inputPanelRef: inputPanel 168 | } 169 | 170 | Key { 171 | btnKey: Qt.Key_C 172 | btnText: "c" 173 | inputPanelRef: inputPanel 174 | } 175 | 176 | Key { 177 | btnKey: Qt.Key_V 178 | btnText: "v" 179 | inputPanelRef: inputPanel 180 | } 181 | 182 | Key { 183 | btnKey: Qt.Key_B 184 | btnText: "b" 185 | inputPanelRef: inputPanel 186 | } 187 | 188 | Key { 189 | btnKey: Qt.Key_N 190 | btnText: "n" 191 | inputPanelRef: inputPanel 192 | } 193 | 194 | Key { 195 | btnKey: Qt.Key_M 196 | btnText: "m" 197 | inputPanelRef: inputPanel 198 | } 199 | 200 | Key { 201 | btnKey: Qt.Key_Comma 202 | btnText: "," 203 | inputPanelRef: inputPanel 204 | } 205 | 206 | Key { 207 | btnKey: Qt.Key_Period 208 | btnText: "." 209 | inputPanelRef: inputPanel 210 | } 211 | 212 | ShiftKey { 213 | weight: 204 214 | } 215 | 216 | } 217 | 218 | RowLayout { 219 | property real keyWeight: 154 220 | 221 | SymbolKey { 222 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 223 | } 224 | 225 | LanguageKey { 226 | visible: availableLanguageLayouts.length > 1 227 | weight: 108.5 228 | } 229 | 230 | SpaceKey { 231 | weight: 1168 232 | inputPanelRef: inputPanel 233 | } 234 | 235 | Key { 236 | btnKey: Qt.Key_Apostrophe 237 | btnText: "'" 238 | inputPanelRef: inputPanel 239 | } 240 | 241 | HideKey { 242 | weight: 205 243 | } 244 | 245 | } 246 | 247 | } 248 | -------------------------------------------------------------------------------- /src/qml/PlLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | alternativeKeys: "ę" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_R 31 | btnText: "r" 32 | inputPanelRef: inputPanel 33 | } 34 | 35 | Key { 36 | btnKey: Qt.Key_T 37 | btnText: "t" 38 | inputPanelRef: inputPanel 39 | } 40 | 41 | Key { 42 | btnKey: Qt.Key_Y 43 | btnText: "y" 44 | inputPanelRef: inputPanel 45 | } 46 | 47 | Key { 48 | btnKey: Qt.Key_U 49 | btnText: "u" 50 | inputPanelRef: inputPanel 51 | } 52 | 53 | Key { 54 | btnKey: Qt.Key_I 55 | btnText: "i" 56 | inputPanelRef: inputPanel 57 | } 58 | 59 | Key { 60 | btnKey: Qt.Key_O 61 | btnText: "o" 62 | alternativeKeys: "ó" 63 | inputPanelRef: inputPanel 64 | } 65 | 66 | Key { 67 | btnKey: Qt.Key_P 68 | btnText: "p" 69 | inputPanelRef: inputPanel 70 | } 71 | 72 | BackspaceKey { 73 | inputPanelRef: inputPanel 74 | } 75 | 76 | } 77 | 78 | RowLayout { 79 | property real keyWeight: 160 80 | 81 | Key { 82 | weight: 56 83 | functionKey: true 84 | showPreview: false 85 | btnBackground: "transparent" 86 | } 87 | 88 | Key { 89 | btnKey: Qt.Key_A 90 | btnText: "a" 91 | alternativeKeys: "ą" 92 | inputPanelRef: inputPanel 93 | } 94 | 95 | Key { 96 | btnKey: Qt.Key_S 97 | btnText: "s" 98 | alternativeKeys: "ś" 99 | inputPanelRef: inputPanel 100 | } 101 | 102 | Key { 103 | btnKey: Qt.Key_D 104 | btnText: "d" 105 | inputPanelRef: inputPanel 106 | } 107 | 108 | Key { 109 | btnKey: Qt.Key_F 110 | btnText: "f" 111 | inputPanelRef: inputPanel 112 | } 113 | 114 | Key { 115 | btnKey: Qt.Key_G 116 | btnText: "g" 117 | inputPanelRef: inputPanel 118 | } 119 | 120 | Key { 121 | btnKey: Qt.Key_H 122 | btnText: "h" 123 | inputPanelRef: inputPanel 124 | } 125 | 126 | Key { 127 | btnKey: Qt.Key_J 128 | btnText: "j" 129 | inputPanelRef: inputPanel 130 | } 131 | 132 | Key { 133 | btnKey: Qt.Key_K 134 | btnText: "k" 135 | inputPanelRef: inputPanel 136 | } 137 | 138 | Key { 139 | btnKey: Qt.Key_L 140 | btnText: "l" 141 | alternativeKeys: "ł" 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | EnterKey { 146 | weight: 283 147 | inputPanelRef: inputPanel 148 | } 149 | 150 | } 151 | 152 | RowLayout { 153 | property real keyWeight: 156 154 | 155 | ShiftKey { 156 | } 157 | 158 | Key { 159 | btnKey: Qt.Key_Z 160 | btnText: "z" 161 | alternativeKeys: "źż" 162 | inputPanelRef: inputPanel 163 | } 164 | 165 | Key { 166 | btnKey: Qt.Key_X 167 | btnText: "x" 168 | alternativeKeys: "ź" 169 | inputPanelRef: inputPanel 170 | } 171 | 172 | Key { 173 | btnKey: Qt.Key_C 174 | btnText: "c" 175 | alternativeKeys: "ć" 176 | inputPanelRef: inputPanel 177 | } 178 | 179 | Key { 180 | btnKey: Qt.Key_V 181 | btnText: "v" 182 | inputPanelRef: inputPanel 183 | } 184 | 185 | Key { 186 | btnKey: Qt.Key_B 187 | btnText: "b" 188 | inputPanelRef: inputPanel 189 | } 190 | 191 | Key { 192 | btnKey: Qt.Key_N 193 | btnText: "n" 194 | alternativeKeys: "ń" 195 | inputPanelRef: inputPanel 196 | } 197 | 198 | Key { 199 | btnKey: Qt.Key_M 200 | btnText: "m" 201 | inputPanelRef: inputPanel 202 | } 203 | 204 | Key { 205 | btnKey: Qt.Key_Comma 206 | btnText: "," 207 | inputPanelRef: inputPanel 208 | } 209 | 210 | Key { 211 | btnKey: Qt.Key_Period 212 | btnText: "." 213 | inputPanelRef: inputPanel 214 | } 215 | 216 | ShiftKey { 217 | weight: 204 218 | } 219 | 220 | } 221 | 222 | RowLayout { 223 | property real keyWeight: 154 224 | 225 | SymbolKey { 226 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 227 | } 228 | 229 | LanguageKey { 230 | visible: availableLanguageLayouts.length > 1 231 | weight: 108.5 232 | } 233 | 234 | SpaceKey { 235 | weight: 1168 236 | inputPanelRef: inputPanel 237 | } 238 | 239 | Key { 240 | btnKey: Qt.Key_Apostrophe 241 | btnText: "'" 242 | inputPanelRef: inputPanel 243 | } 244 | 245 | HideKey { 246 | weight: 205 247 | } 248 | 249 | } 250 | 251 | } 252 | -------------------------------------------------------------------------------- /src/qml/FrLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_A 12 | btnText: "a" 13 | alternativeKeys: "àâæ" 14 | inputPanelRef: inputPanel 15 | } 16 | 17 | Key { 18 | btnKey: Qt.Key_Z 19 | btnText: "z" 20 | inputPanelRef: inputPanel 21 | } 22 | 23 | Key { 24 | btnKey: Qt.Key_E 25 | btnText: "e" 26 | alternativeKeys: "éèêë" 27 | inputPanelRef: inputPanel 28 | } 29 | 30 | Key { 31 | btnKey: Qt.Key_R 32 | btnText: "r" 33 | inputPanelRef: inputPanel 34 | } 35 | 36 | Key { 37 | btnKey: Qt.Key_T 38 | btnText: "t" 39 | inputPanelRef: inputPanel 40 | } 41 | 42 | Key { 43 | btnKey: Qt.Key_Y 44 | btnText: "y" 45 | alternativeKeys: "ÿ" 46 | inputPanelRef: inputPanel 47 | } 48 | 49 | Key { 50 | btnKey: Qt.Key_U 51 | btnText: "u" 52 | alternativeKeys: "ùûü" 53 | inputPanelRef: inputPanel 54 | } 55 | 56 | Key { 57 | btnKey: Qt.Key_I 58 | btnText: "i" 59 | alternativeKeys: "îï" 60 | inputPanelRef: inputPanel 61 | } 62 | 63 | Key { 64 | btnKey: Qt.Key_O 65 | btnText: "o" 66 | alternativeKeys: "ôœ" 67 | inputPanelRef: inputPanel 68 | } 69 | 70 | Key { 71 | btnKey: Qt.Key_P 72 | btnText: "p" 73 | inputPanelRef: inputPanel 74 | } 75 | 76 | BackspaceKey { 77 | inputPanelRef: inputPanel 78 | } 79 | 80 | } 81 | 82 | RowLayout { 83 | property real keyWeight: 160 84 | 85 | Key { 86 | weight: 56 87 | functionKey: true 88 | showPreview: false 89 | btnBackground: "transparent" 90 | } 91 | 92 | Key { 93 | btnKey: Qt.Key_Q 94 | btnText: "q" 95 | inputPanelRef: inputPanel 96 | } 97 | 98 | Key { 99 | btnKey: Qt.Key_S 100 | btnText: "s" 101 | inputPanelRef: inputPanel 102 | } 103 | 104 | Key { 105 | btnKey: Qt.Key_D 106 | btnText: "d" 107 | inputPanelRef: inputPanel 108 | } 109 | 110 | Key { 111 | btnKey: Qt.Key_F 112 | btnText: "f" 113 | inputPanelRef: inputPanel 114 | } 115 | 116 | Key { 117 | btnKey: Qt.Key_G 118 | btnText: "g" 119 | inputPanelRef: inputPanel 120 | } 121 | 122 | Key { 123 | btnKey: Qt.Key_H 124 | btnText: "h" 125 | inputPanelRef: inputPanel 126 | } 127 | 128 | Key { 129 | btnKey: Qt.Key_J 130 | btnText: "j" 131 | inputPanelRef: inputPanel 132 | } 133 | 134 | Key { 135 | btnKey: Qt.Key_K 136 | btnText: "k" 137 | inputPanelRef: inputPanel 138 | } 139 | 140 | Key { 141 | btnKey: Qt.Key_L 142 | btnText: "l" 143 | inputPanelRef: inputPanel 144 | } 145 | 146 | Key { 147 | btnKey: Qt.Key_M 148 | btnText: "m" 149 | inputPanelRef: inputPanel 150 | } 151 | 152 | EnterKey { 153 | weight: 283 154 | inputPanelRef: inputPanel 155 | } 156 | 157 | } 158 | 159 | RowLayout { 160 | property real keyWeight: 156 161 | 162 | ShiftKey { 163 | } 164 | 165 | Key { 166 | btnKey: Qt.Key_W 167 | btnText: "w" 168 | inputPanelRef: inputPanel 169 | } 170 | 171 | Key { 172 | btnKey: Qt.Key_X 173 | btnText: "x" 174 | inputPanelRef: inputPanel 175 | } 176 | 177 | Key { 178 | btnKey: Qt.Key_C 179 | btnText: "c" 180 | alternativeKeys: "ç" 181 | inputPanelRef: inputPanel 182 | } 183 | 184 | Key { 185 | btnKey: Qt.Key_V 186 | btnText: "v" 187 | inputPanelRef: inputPanel 188 | } 189 | 190 | Key { 191 | btnKey: Qt.Key_B 192 | btnText: "b" 193 | inputPanelRef: inputPanel 194 | } 195 | 196 | Key { 197 | btnKey: Qt.Key_N 198 | btnText: "n" 199 | inputPanelRef: inputPanel 200 | } 201 | 202 | Key { 203 | btnKey: Qt.Key_Comma 204 | btnText: "," 205 | inputPanelRef: inputPanel 206 | } 207 | 208 | Key { 209 | btnKey: Qt.Key_Period 210 | btnText: "." 211 | inputPanelRef: inputPanel 212 | } 213 | 214 | Key { 215 | btnKey: Qt.Key_Minus 216 | btnText: "-" 217 | inputPanelRef: inputPanel 218 | } 219 | 220 | ShiftKey { 221 | weight: 204 222 | } 223 | 224 | } 225 | 226 | RowLayout { 227 | property real keyWeight: 154 228 | 229 | SymbolKey { 230 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 231 | } 232 | 233 | LanguageKey { 234 | visible: availableLanguageLayouts.length > 1 235 | weight: 108.5 236 | } 237 | 238 | SpaceKey { 239 | weight: 1168 240 | inputPanelRef: inputPanel 241 | } 242 | 243 | Key { 244 | btnKey: Qt.Key_Apostrophe 245 | btnText: "'" 246 | inputPanelRef: inputPanel 247 | } 248 | 249 | HideKey { 250 | weight: 205 251 | } 252 | 253 | } 254 | 255 | } 256 | -------------------------------------------------------------------------------- /src/qml/EsLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | alternativeKeys: "ēęėëêèé" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_R 31 | btnText: "r" 32 | inputPanelRef: inputPanel 33 | } 34 | 35 | Key { 36 | btnKey: Qt.Key_T 37 | btnText: "t" 38 | inputPanelRef: inputPanel 39 | } 40 | 41 | Key { 42 | btnKey: Qt.Key_Y 43 | btnText: "y" 44 | inputPanelRef: inputPanel 45 | } 46 | 47 | Key { 48 | btnKey: Qt.Key_U 49 | btnText: "u" 50 | alternativeKeys: "üûùú" 51 | inputPanelRef: inputPanel 52 | } 53 | 54 | Key { 55 | btnKey: Qt.Key_I 56 | btnText: "i" 57 | alternativeKeys: "ïįîìí" 58 | inputPanelRef: inputPanel 59 | } 60 | 61 | Key { 62 | btnKey: Qt.Key_O 63 | btnText: "o" 64 | alternativeKeys: "öõôòóº" 65 | inputPanelRef: inputPanel 66 | } 67 | 68 | Key { 69 | btnKey: Qt.Key_P 70 | btnText: "p" 71 | inputPanelRef: inputPanel 72 | } 73 | 74 | BackspaceKey { 75 | inputPanelRef: inputPanel 76 | } 77 | 78 | } 79 | 80 | RowLayout { 81 | property real keyWeight: 160 82 | 83 | Key { 84 | weight: 56 85 | functionKey: true 86 | showPreview: false 87 | btnBackground: "transparent" 88 | } 89 | 90 | Key { 91 | btnKey: Qt.Key_A 92 | btnText: "a" 93 | alternativeKeys: "äãâàáª" 94 | inputPanelRef: inputPanel 95 | } 96 | 97 | Key { 98 | btnKey: Qt.Key_S 99 | btnText: "s" 100 | inputPanelRef: inputPanel 101 | } 102 | 103 | Key { 104 | btnKey: Qt.Key_D 105 | btnText: "d" 106 | inputPanelRef: inputPanel 107 | } 108 | 109 | Key { 110 | btnKey: Qt.Key_F 111 | btnText: "f" 112 | inputPanelRef: inputPanel 113 | } 114 | 115 | Key { 116 | btnKey: Qt.Key_G 117 | btnText: "g" 118 | inputPanelRef: inputPanel 119 | } 120 | 121 | Key { 122 | btnKey: Qt.Key_H 123 | btnText: "h" 124 | inputPanelRef: inputPanel 125 | } 126 | 127 | Key { 128 | btnKey: Qt.Key_J 129 | btnText: "j" 130 | inputPanelRef: inputPanel 131 | } 132 | 133 | Key { 134 | btnKey: Qt.Key_K 135 | btnText: "k" 136 | inputPanelRef: inputPanel 137 | } 138 | 139 | Key { 140 | btnKey: Qt.Key_L 141 | btnText: "l" 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | Key { 146 | btnKey: Qt.Key_Ntilde 147 | btnText: "ñ" 148 | } 149 | 150 | EnterKey { 151 | weight: 283 152 | inputPanelRef: inputPanel 153 | } 154 | 155 | } 156 | 157 | RowLayout { 158 | property real keyWeight: 156 159 | 160 | ShiftKey { 161 | } 162 | 163 | Key { 164 | btnKey: Qt.Key_Z 165 | btnText: "z" 166 | inputPanelRef: inputPanel 167 | } 168 | 169 | Key { 170 | btnKey: Qt.Key_X 171 | btnText: "x" 172 | inputPanelRef: inputPanel 173 | } 174 | 175 | Key { 176 | btnKey: Qt.Key_C 177 | btnText: "c" 178 | alternativeKeys: "čçć" 179 | inputPanelRef: inputPanel 180 | } 181 | 182 | Key { 183 | btnKey: Qt.Key_V 184 | btnText: "v" 185 | inputPanelRef: inputPanel 186 | } 187 | 188 | Key { 189 | btnKey: Qt.Key_B 190 | btnText: "b" 191 | inputPanelRef: inputPanel 192 | } 193 | 194 | Key { 195 | btnKey: Qt.Key_N 196 | btnText: "n" 197 | inputPanelRef: inputPanel 198 | } 199 | 200 | Key { 201 | btnKey: Qt.Key_M 202 | btnText: "m" 203 | inputPanelRef: inputPanel 204 | } 205 | 206 | Key { 207 | btnKey: Qt.Key_Comma 208 | btnText: "," 209 | inputPanelRef: inputPanel 210 | } 211 | 212 | Key { 213 | btnKey: Qt.Key_Period 214 | btnText: "." 215 | inputPanelRef: inputPanel 216 | } 217 | 218 | Key { 219 | btnKey: Qt.Key_Minus 220 | btnText: "-" 221 | } 222 | 223 | ShiftKey { 224 | weight: 204 225 | } 226 | 227 | } 228 | 229 | RowLayout { 230 | property real keyWeight: 154 231 | 232 | SymbolKey { 233 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 234 | } 235 | 236 | LanguageKey { 237 | visible: availableLanguageLayouts.length > 1 238 | weight: 108.5 239 | } 240 | 241 | SpaceKey { 242 | weight: 1168 243 | inputPanelRef: inputPanel 244 | } 245 | 246 | Key { 247 | btnKey: Qt.Key_Apostrophe 248 | btnText: "'" 249 | inputPanelRef: inputPanel 250 | } 251 | 252 | HideKey { 253 | weight: 205 254 | } 255 | 256 | } 257 | 258 | } 259 | -------------------------------------------------------------------------------- /src/qml/CsLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | alternativeKeys: "éě" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_R 31 | btnText: "r" 32 | alternativeKeys: "ř" 33 | inputPanelRef: inputPanel 34 | } 35 | 36 | Key { 37 | btnKey: Qt.Key_T 38 | btnText: "t" 39 | alternativeKeys: "ť" 40 | inputPanelRef: inputPanel 41 | } 42 | 43 | Key { 44 | btnKey: Qt.Key_Z 45 | btnText: "z" 46 | alternativeKeys: "ž" 47 | inputPanelRef: inputPanel 48 | } 49 | 50 | Key { 51 | btnKey: Qt.Key_U 52 | btnText: "u" 53 | alternativeKeys: "úů" 54 | inputPanelRef: inputPanel 55 | } 56 | 57 | Key { 58 | btnKey: Qt.Key_I 59 | btnText: "i" 60 | alternativeKeys: "í" 61 | inputPanelRef: inputPanel 62 | } 63 | 64 | Key { 65 | btnKey: Qt.Key_O 66 | btnText: "o" 67 | alternativeKeys: "óö" 68 | inputPanelRef: inputPanel 69 | } 70 | 71 | Key { 72 | btnKey: Qt.Key_P 73 | btnText: "p" 74 | inputPanelRef: inputPanel 75 | } 76 | 77 | BackspaceKey { 78 | inputPanelRef: inputPanel 79 | } 80 | 81 | } 82 | 83 | RowLayout { 84 | property real keyWeight: 160 85 | 86 | Key { 87 | weight: 56 88 | functionKey: true 89 | showPreview: false 90 | btnBackground: "transparent" 91 | } 92 | 93 | Key { 94 | btnKey: Qt.Key_A 95 | btnText: "a" 96 | alternativeKeys: "åäá" 97 | inputPanelRef: inputPanel 98 | } 99 | 100 | Key { 101 | btnKey: Qt.Key_S 102 | btnText: "s" 103 | alternativeKeys: "š" 104 | inputPanelRef: inputPanel 105 | } 106 | 107 | Key { 108 | btnKey: Qt.Key_D 109 | btnText: "d" 110 | alternativeKeys: "ď" 111 | inputPanelRef: inputPanel 112 | } 113 | 114 | Key { 115 | btnKey: Qt.Key_F 116 | btnText: "f" 117 | inputPanelRef: inputPanel 118 | } 119 | 120 | Key { 121 | btnKey: Qt.Key_G 122 | btnText: "g" 123 | inputPanelRef: inputPanel 124 | } 125 | 126 | Key { 127 | btnKey: Qt.Key_H 128 | btnText: "h" 129 | inputPanelRef: inputPanel 130 | } 131 | 132 | Key { 133 | btnKey: Qt.Key_J 134 | btnText: "j" 135 | inputPanelRef: inputPanel 136 | } 137 | 138 | Key { 139 | btnKey: Qt.Key_K 140 | btnText: "k" 141 | inputPanelRef: inputPanel 142 | } 143 | 144 | Key { 145 | btnKey: Qt.Key_L 146 | btnText: "l" 147 | inputPanelRef: inputPanel 148 | } 149 | 150 | EnterKey { 151 | weight: 283 152 | inputPanelRef: inputPanel 153 | } 154 | 155 | } 156 | 157 | RowLayout { 158 | property real keyWeight: 156 159 | 160 | ShiftKey { 161 | } 162 | 163 | Key { 164 | btnKey: Qt.Key_Y 165 | btnText: "y" 166 | alternativeKeys: "ý" 167 | inputPanelRef: inputPanel 168 | } 169 | 170 | Key { 171 | btnKey: Qt.Key_X 172 | btnText: "x" 173 | inputPanelRef: inputPanel 174 | } 175 | 176 | Key { 177 | btnKey: Qt.Key_C 178 | btnText: "c" 179 | alternativeKeys: "ćč" 180 | inputPanelRef: inputPanel 181 | } 182 | 183 | Key { 184 | btnKey: Qt.Key_V 185 | btnText: "v" 186 | inputPanelRef: inputPanel 187 | } 188 | 189 | Key { 190 | btnKey: Qt.Key_B 191 | btnText: "b" 192 | inputPanelRef: inputPanel 193 | } 194 | 195 | Key { 196 | btnKey: Qt.Key_N 197 | btnText: "n" 198 | alternativeKeys: "ń" 199 | inputPanelRef: inputPanel 200 | } 201 | 202 | Key { 203 | btnKey: Qt.Key_M 204 | btnText: "m" 205 | inputPanelRef: inputPanel 206 | } 207 | 208 | Key { 209 | btnKey: Qt.Key_Comma 210 | btnText: "," 211 | inputPanelRef: inputPanel 212 | } 213 | 214 | Key { 215 | btnKey: Qt.Key_Period 216 | btnText: "." 217 | inputPanelRef: inputPanel 218 | } 219 | 220 | ShiftKey { 221 | weight: 204 222 | } 223 | 224 | } 225 | 226 | RowLayout { 227 | property real keyWeight: 154 228 | 229 | SymbolKey { 230 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 231 | } 232 | 233 | LanguageKey { 234 | visible: availableLanguageLayouts.length > 1 235 | weight: 108.5 236 | } 237 | 238 | SpaceKey { 239 | weight: 1168 240 | inputPanelRef: inputPanel 241 | } 242 | 243 | Key { 244 | btnKey: Qt.Key_Minus 245 | btnText: "-" 246 | inputPanelRef: inputPanel 247 | } 248 | 249 | HideKey { 250 | weight: 205 251 | } 252 | 253 | } 254 | 255 | } 256 | -------------------------------------------------------------------------------- /src/qml/InputPanel.qml: -------------------------------------------------------------------------------- 1 | import CuteKeyboard 1.0 2 | import QtQml 2.0 3 | import QtQuick 2.0 4 | 5 | Item { 6 | id: root 7 | 8 | property bool active: Qt.inputMethod.visible 9 | property color backgroundColor: "#000000" 10 | property color btnBackgroundColor: "#808080" 11 | property color btnSpecialBackgroundColor: Qt.darker("#808080") 12 | property color btnTextColor: "#ffffff" 13 | property string btnTextFontFamily 14 | property string languageLayout: "En" 15 | property string backspaceIcon: "qrc:/icons/backspace.png" 16 | property string enterIcon: "" 17 | property string shiftOnIcon: "qrc:/icons/caps-lock-on.png" 18 | property string shiftOffIcon: "qrc:/icons/caps-lock-off.png" 19 | property string hideKeyboardIcon: "qrc:/icons/hide-arrow.png" 20 | property string languageIcon: "qrc:/icons/language.png" 21 | property var availableLanguageLayouts: ["En"] 22 | property alias emptySpaceBar: layoutLoader.emptySpaceBar 23 | 24 | /*! \internal */ 25 | readonly property bool __isRootItem: root.parent !== null && root.parent.parent === null 26 | 27 | function showKeyPopup(keyButton) { 28 | keyPopup.popup(keyButton, root); 29 | } 30 | 31 | function hideKeyPopup() { 32 | keyPopup.visible = false; 33 | } 34 | 35 | function showAlternativesKeyPopup(keyButton) { 36 | alternativesKeyPopup.open(keyButton, root); 37 | } 38 | 39 | function loadLettersLayout() { 40 | var description = InputEngine.descriptionOfLayout(languageLayout); 41 | var spaceIdentifier = InputEngine.spaceIdentifierOfLayout(languageLayout); 42 | var source = InputEngine.fileOfLayout(languageLayout); 43 | if (description !== "" && source !== "") { 44 | layoutLoader.langDescription = description; 45 | layoutLoader.spaceIdentifier = spaceIdentifier; 46 | layoutLoader.setSource(source + ".qml", { 47 | "inputPanel": root 48 | }); 49 | } else { 50 | layoutLoader.langDescription = "English"; 51 | layoutLoader.spaceIdentifier = "space"; 52 | layoutLoader.setSource("EnLayout.qml", { 53 | "inputPanel": root 54 | }); 55 | } 56 | } 57 | 58 | objectName: "inputPanel" 59 | width: parent.width 60 | height: width / 4 61 | onYChanged: InputEngine.setKeyboardRectangle(Qt.rect(x, y, width, height)) 62 | onActiveChanged: { 63 | if (alternativesKeyPopup.visible && !active) 64 | alternativesKeyPopup.visible = false; 65 | 66 | } 67 | onLanguageLayoutChanged: loadLettersLayout() 68 | Component.onCompleted: { 69 | 70 | InputContext.registerInputPanel(root) 71 | 72 | if (availableLanguageLayouts.length == 0) 73 | availableLanguageLayouts = ["En"]; 74 | 75 | InputPanel.backgroundColor = backgroundColor; 76 | InputPanel.btnBackgroundColor = btnBackgroundColor; 77 | InputPanel.btnSpecialBackgroundColor = btnSpecialBackgroundColor; 78 | InputPanel.btnTextColor = btnTextColor; 79 | InputPanel.btnTextFontFamily = btnTextFontFamily; 80 | InputPanel.backspaceIcon = backspaceIcon; 81 | InputPanel.enterIcon = enterIcon; 82 | InputPanel.shiftOnIcon = shiftOnIcon; 83 | InputPanel.shiftOffIcon = shiftOffIcon; 84 | InputPanel.hideKeyboardIcon = hideKeyboardIcon; 85 | InputPanel.languageIcon = languageIcon; 86 | InputPanel.availableLanguageLayouts = availableLanguageLayouts; 87 | InputPanel.languageLayout = languageLayout; 88 | loadLettersLayout(); 89 | } 90 | 91 | KeyPopup { 92 | id: keyPopup 93 | 94 | popupColor: btnBackgroundColor 95 | popupTextColor: btnTextColor 96 | popupTextFont: btnTextFontFamily 97 | visible: false 98 | z: 100 99 | } 100 | 101 | AlternativeKeysPopup { 102 | id: alternativesKeyPopup 103 | 104 | visible: false 105 | z: 100 106 | } 107 | 108 | MouseArea { 109 | id: alternativesKeyPopupMouseArea 110 | 111 | visible: alternativesKeyPopup.visible 112 | enabled: visible 113 | anchors.fill: parent 114 | propagateComposedEvents: false 115 | z: 99 116 | } 117 | 118 | Rectangle { 119 | id: keyboardRect 120 | 121 | color: InputPanel.backgroundColor 122 | anchors.fill: parent 123 | 124 | MouseArea { 125 | anchors.fill: parent 126 | } 127 | 128 | Loader { 129 | id: layoutLoader 130 | 131 | // display empty space bar 132 | property bool emptySpaceBar: false 133 | 134 | // lang description only needed for layouts that share a file 135 | property string langDescription 136 | // space identifier for the correct translation of the word "space" 137 | property string spaceIdentifier 138 | 139 | anchors { 140 | fill: parent 141 | margins: 5 142 | } 143 | 144 | } 145 | 146 | Connections { 147 | function refreshLayouts() { 148 | if (InputEngine.symbolMode) 149 | layoutLoader.setSource("SymbolLayout.qml", { 150 | "inputPanel": root 151 | }); 152 | else if (InputEngine.inputMode === InputEngine.DigitsOnly) 153 | layoutLoader.setSource("DigitsLayout.qml", { 154 | "inputPanel": root 155 | }); 156 | else 157 | loadLettersLayout(); 158 | } 159 | 160 | function onInputModeChanged() { 161 | refreshLayouts(); 162 | } 163 | 164 | function onIsSymbolModeChanged() { 165 | refreshLayouts(); 166 | } 167 | 168 | target: InputEngine 169 | } 170 | 171 | Connections { 172 | function onLanguageLayoutChanged() { 173 | languageLayout = InputPanel.languageLayout; 174 | loadLettersLayout(); 175 | } 176 | 177 | target: InputPanel 178 | } 179 | 180 | } 181 | 182 | } 183 | -------------------------------------------------------------------------------- /src/qml/PtLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | alternativeKeys: "ēęėëêèé" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_R 31 | btnText: "r" 32 | inputPanelRef: inputPanel 33 | } 34 | 35 | Key { 36 | btnKey: Qt.Key_T 37 | btnText: "t" 38 | inputPanelRef: inputPanel 39 | } 40 | 41 | Key { 42 | btnKey: Qt.Key_Y 43 | btnText: "y" 44 | inputPanelRef: inputPanel 45 | } 46 | 47 | Key { 48 | btnKey: Qt.Key_U 49 | btnText: "u" 50 | alternativeKeys: "üûùú" 51 | inputPanelRef: inputPanel 52 | } 53 | 54 | Key { 55 | btnKey: Qt.Key_I 56 | btnText: "i" 57 | alternativeKeys: "ïįîìí" 58 | inputPanelRef: inputPanel 59 | } 60 | 61 | Key { 62 | btnKey: Qt.Key_O 63 | btnText: "o" 64 | alternativeKeys: "öõôòó" 65 | inputPanelRef: inputPanel 66 | } 67 | 68 | Key { 69 | btnKey: Qt.Key_P 70 | btnText: "p" 71 | inputPanelRef: inputPanel 72 | } 73 | 74 | BackspaceKey { 75 | inputPanelRef: inputPanel 76 | } 77 | 78 | } 79 | 80 | RowLayout { 81 | property real keyWeight: 160 82 | 83 | Key { 84 | weight: 56 85 | functionKey: true 86 | showPreview: false 87 | btnBackground: "transparent" 88 | } 89 | 90 | Key { 91 | btnKey: Qt.Key_A 92 | btnText: "a" 93 | alternativeKeys: "äãâàá" 94 | inputPanelRef: inputPanel 95 | } 96 | 97 | Key { 98 | btnKey: Qt.Key_S 99 | btnText: "s" 100 | inputPanelRef: inputPanel 101 | } 102 | 103 | Key { 104 | btnKey: Qt.Key_D 105 | btnText: "d" 106 | inputPanelRef: inputPanel 107 | } 108 | 109 | Key { 110 | btnKey: Qt.Key_F 111 | btnText: "f" 112 | inputPanelRef: inputPanel 113 | } 114 | 115 | Key { 116 | btnKey: Qt.Key_G 117 | btnText: "g" 118 | inputPanelRef: inputPanel 119 | } 120 | 121 | Key { 122 | btnKey: Qt.Key_H 123 | btnText: "h" 124 | inputPanelRef: inputPanel 125 | } 126 | 127 | Key { 128 | btnKey: Qt.Key_J 129 | btnText: "j" 130 | inputPanelRef: inputPanel 131 | } 132 | 133 | Key { 134 | btnKey: Qt.Key_K 135 | btnText: "k" 136 | inputPanelRef: inputPanel 137 | } 138 | 139 | Key { 140 | btnKey: Qt.Key_L 141 | btnText: "l" 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | Key { 146 | btnKey: Qt.Key_Ccedilla 147 | btnText: "ç" 148 | inputPanelRef: inputPanel 149 | } 150 | 151 | EnterKey { 152 | weight: 283 153 | inputPanelRef: inputPanel 154 | } 155 | 156 | } 157 | 158 | RowLayout { 159 | property real keyWeight: 156 160 | 161 | ShiftKey { 162 | } 163 | 164 | Key { 165 | btnKey: Qt.Key_Z 166 | btnText: "z" 167 | inputPanelRef: inputPanel 168 | } 169 | 170 | Key { 171 | btnKey: Qt.Key_X 172 | btnText: "x" 173 | inputPanelRef: inputPanel 174 | } 175 | 176 | Key { 177 | btnKey: Qt.Key_C 178 | btnText: "c" 179 | alternativeKeys: "čć" 180 | inputPanelRef: inputPanel 181 | } 182 | 183 | Key { 184 | btnKey: Qt.Key_V 185 | btnText: "v" 186 | inputPanelRef: inputPanel 187 | } 188 | 189 | Key { 190 | btnKey: Qt.Key_B 191 | btnText: "b" 192 | inputPanelRef: inputPanel 193 | } 194 | 195 | Key { 196 | btnKey: Qt.Key_N 197 | btnText: "n" 198 | inputPanelRef: inputPanel 199 | } 200 | 201 | Key { 202 | btnKey: Qt.Key_M 203 | btnText: "m" 204 | inputPanelRef: inputPanel 205 | } 206 | 207 | Key { 208 | btnKey: Qt.Key_Comma 209 | btnText: "," 210 | inputPanelRef: inputPanel 211 | } 212 | 213 | Key { 214 | btnKey: Qt.Key_Period 215 | btnText: "." 216 | inputPanelRef: inputPanel 217 | } 218 | 219 | Key { 220 | btnKey: Qt.Key_Minus 221 | btnText: "-" 222 | inputPanelRef: inputPanel 223 | } 224 | 225 | ShiftKey { 226 | weight: 204 227 | } 228 | 229 | } 230 | 231 | RowLayout { 232 | property real keyWeight: 154 233 | 234 | SymbolKey { 235 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 236 | } 237 | 238 | LanguageKey { 239 | visible: availableLanguageLayouts.length > 1 240 | weight: 108.5 241 | } 242 | 243 | SpaceKey { 244 | weight: 1168 245 | inputPanelRef: inputPanel 246 | } 247 | 248 | Key { 249 | btnKey: Qt.Key_Apostrophe 250 | btnText: "'" 251 | inputPanelRef: inputPanel 252 | } 253 | 254 | HideKey { 255 | weight: 205 256 | } 257 | 258 | } 259 | 260 | } 261 | -------------------------------------------------------------------------------- /src/qml/EnLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | alternativeKeys: "êëèé" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_R 31 | btnText: "r" 32 | alternativeKeys: "ŕř" 33 | inputPanelRef: inputPanel 34 | } 35 | 36 | Key { 37 | btnKey: Qt.Key_T 38 | btnText: "t" 39 | alternativeKeys: "ţŧť" 40 | inputPanelRef: inputPanel 41 | } 42 | 43 | Key { 44 | btnKey: Qt.Key_Y 45 | btnText: "y" 46 | alternativeKeys: "ÿýŷ" 47 | inputPanelRef: inputPanel 48 | } 49 | 50 | Key { 51 | btnKey: Qt.Key_U 52 | btnText: "u" 53 | alternativeKeys: "űūũûüùú" 54 | inputPanelRef: inputPanel 55 | } 56 | 57 | Key { 58 | btnKey: Qt.Key_I 59 | btnText: "i" 60 | alternativeKeys: "îïīĩìí" 61 | inputPanelRef: inputPanel 62 | } 63 | 64 | Key { 65 | btnKey: Qt.Key_O 66 | btnText: "o" 67 | alternativeKeys: "œøõôöòó" 68 | inputPanelRef: inputPanel 69 | } 70 | 71 | Key { 72 | btnKey: Qt.Key_P 73 | btnText: "p" 74 | inputPanelRef: inputPanel 75 | } 76 | 77 | BackspaceKey { 78 | inputPanelRef: inputPanel 79 | } 80 | 81 | } 82 | 83 | RowLayout { 84 | property real keyWeight: 160 85 | 86 | Key { 87 | weight: 56 88 | functionKey: true 89 | showPreview: false 90 | btnBackground: "transparent" 91 | } 92 | 93 | Key { 94 | btnKey: Qt.Key_A 95 | btnText: "a" 96 | alternativeKeys: "äåãâàá" 97 | inputPanelRef: inputPanel 98 | } 99 | 100 | Key { 101 | btnKey: Qt.Key_S 102 | btnText: "s" 103 | alternativeKeys: "šşś" 104 | inputPanelRef: inputPanel 105 | } 106 | 107 | Key { 108 | btnKey: Qt.Key_D 109 | btnText: "d" 110 | alternativeKeys: "đď" 111 | inputPanelRef: inputPanel 112 | } 113 | 114 | Key { 115 | btnKey: Qt.Key_F 116 | btnText: "f" 117 | inputPanelRef: inputPanel 118 | } 119 | 120 | Key { 121 | btnKey: Qt.Key_G 122 | btnText: "g" 123 | alternativeKeys: "ġģĝğ" 124 | inputPanelRef: inputPanel 125 | } 126 | 127 | Key { 128 | btnKey: Qt.Key_H 129 | btnText: "h" 130 | inputPanelRef: inputPanel 131 | } 132 | 133 | Key { 134 | btnKey: Qt.Key_J 135 | btnText: "j" 136 | inputPanelRef: inputPanel 137 | } 138 | 139 | Key { 140 | btnKey: Qt.Key_K 141 | btnText: "k" 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | Key { 146 | btnKey: Qt.Key_L 147 | btnText: "l" 148 | alternativeKeys: "ĺŀłļľ" 149 | inputPanelRef: inputPanel 150 | } 151 | 152 | EnterKey { 153 | weight: 283 154 | inputPanelRef: inputPanel 155 | } 156 | 157 | } 158 | 159 | RowLayout { 160 | property real keyWeight: 156 161 | 162 | ShiftKey { 163 | } 164 | 165 | Key { 166 | btnKey: Qt.Key_Z 167 | btnText: "z" 168 | alternativeKeys: "žż" 169 | inputPanelRef: inputPanel 170 | } 171 | 172 | Key { 173 | btnKey: Qt.Key_X 174 | btnText: "x" 175 | inputPanelRef: inputPanel 176 | } 177 | 178 | Key { 179 | btnKey: Qt.Key_C 180 | btnText: "c" 181 | alternativeKeys: "çċčć" 182 | inputPanelRef: inputPanel 183 | } 184 | 185 | Key { 186 | btnKey: Qt.Key_V 187 | btnText: "v" 188 | inputPanelRef: inputPanel 189 | } 190 | 191 | Key { 192 | btnKey: Qt.Key_B 193 | btnText: "b" 194 | inputPanelRef: inputPanel 195 | } 196 | 197 | Key { 198 | btnKey: Qt.Key_N 199 | btnText: "n" 200 | alternativeKeys: "ņńň" 201 | inputPanelRef: inputPanel 202 | } 203 | 204 | Key { 205 | btnKey: Qt.Key_M 206 | btnText: "m" 207 | inputPanelRef: inputPanel 208 | } 209 | 210 | Key { 211 | btnKey: Qt.Key_Comma 212 | btnText: "," 213 | inputPanelRef: inputPanel 214 | } 215 | 216 | Key { 217 | btnKey: Qt.Key_Period 218 | btnText: "." 219 | inputPanelRef: inputPanel 220 | } 221 | 222 | ShiftKey { 223 | weight: 204 224 | } 225 | 226 | } 227 | 228 | RowLayout { 229 | property real keyWeight: 154 230 | 231 | SymbolKey { 232 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 233 | } 234 | 235 | LanguageKey { 236 | visible: availableLanguageLayouts.length > 1 237 | weight: 108.5 238 | } 239 | 240 | SpaceKey { 241 | weight: 1168 242 | inputPanelRef: inputPanel 243 | } 244 | 245 | Key { 246 | btnKey: Qt.Key_Apostrophe 247 | btnText: "'" 248 | inputPanelRef: inputPanel 249 | } 250 | 251 | HideKey { 252 | weight: 205 253 | } 254 | 255 | } 256 | 257 | } 258 | -------------------------------------------------------------------------------- /src/qml/NlLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | alternativeKeys: "êëèé" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_R 31 | btnText: "r" 32 | alternativeKeys: "ŕř" 33 | inputPanelRef: inputPanel 34 | } 35 | 36 | Key { 37 | btnKey: Qt.Key_T 38 | btnText: "t" 39 | alternativeKeys: "ţŧť" 40 | inputPanelRef: inputPanel 41 | } 42 | 43 | Key { 44 | btnKey: Qt.Key_Y 45 | btnText: "y" 46 | alternativeKeys: "ÿýŷ" 47 | inputPanelRef: inputPanel 48 | } 49 | 50 | Key { 51 | btnKey: Qt.Key_U 52 | btnText: "u" 53 | alternativeKeys: "űūũûüùú" 54 | inputPanelRef: inputPanel 55 | } 56 | 57 | Key { 58 | btnKey: Qt.Key_I 59 | btnText: "i" 60 | alternativeKeys: "îïīĩìí" 61 | inputPanelRef: inputPanel 62 | } 63 | 64 | Key { 65 | btnKey: Qt.Key_O 66 | btnText: "o" 67 | alternativeKeys: "œøõôöòó" 68 | inputPanelRef: inputPanel 69 | } 70 | 71 | Key { 72 | btnKey: Qt.Key_P 73 | btnText: "p" 74 | inputPanelRef: inputPanel 75 | } 76 | 77 | BackspaceKey { 78 | inputPanelRef: inputPanel 79 | } 80 | 81 | } 82 | 83 | RowLayout { 84 | property real keyWeight: 160 85 | 86 | Key { 87 | weight: 56 88 | functionKey: true 89 | showPreview: false 90 | btnBackground: "transparent" 91 | } 92 | 93 | Key { 94 | btnKey: Qt.Key_A 95 | btnText: "a" 96 | alternativeKeys: "äåãâàá" 97 | inputPanelRef: inputPanel 98 | } 99 | 100 | Key { 101 | btnKey: Qt.Key_S 102 | btnText: "s" 103 | alternativeKeys: "šşś" 104 | inputPanelRef: inputPanel 105 | } 106 | 107 | Key { 108 | btnKey: Qt.Key_D 109 | btnText: "d" 110 | alternativeKeys: "đď" 111 | inputPanelRef: inputPanel 112 | } 113 | 114 | Key { 115 | btnKey: Qt.Key_F 116 | btnText: "f" 117 | inputPanelRef: inputPanel 118 | } 119 | 120 | Key { 121 | btnKey: Qt.Key_G 122 | btnText: "g" 123 | alternativeKeys: "ġģĝğ" 124 | inputPanelRef: inputPanel 125 | } 126 | 127 | Key { 128 | btnKey: Qt.Key_H 129 | btnText: "h" 130 | inputPanelRef: inputPanel 131 | } 132 | 133 | Key { 134 | btnKey: Qt.Key_J 135 | btnText: "j" 136 | inputPanelRef: inputPanel 137 | } 138 | 139 | Key { 140 | btnKey: Qt.Key_K 141 | btnText: "k" 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | Key { 146 | btnKey: Qt.Key_L 147 | btnText: "l" 148 | alternativeKeys: "ĺŀłļľ" 149 | inputPanelRef: inputPanel 150 | } 151 | 152 | EnterKey { 153 | weight: 283 154 | inputPanelRef: inputPanel 155 | } 156 | 157 | } 158 | 159 | RowLayout { 160 | property real keyWeight: 156 161 | 162 | ShiftKey { 163 | } 164 | 165 | Key { 166 | btnKey: Qt.Key_Z 167 | btnText: "z" 168 | alternativeKeys: "žż" 169 | inputPanelRef: inputPanel 170 | } 171 | 172 | Key { 173 | btnKey: Qt.Key_X 174 | btnText: "x" 175 | inputPanelRef: inputPanel 176 | } 177 | 178 | Key { 179 | btnKey: Qt.Key_C 180 | btnText: "c" 181 | alternativeKeys: "çċčć" 182 | inputPanelRef: inputPanel 183 | } 184 | 185 | Key { 186 | btnKey: Qt.Key_V 187 | btnText: "v" 188 | inputPanelRef: inputPanel 189 | } 190 | 191 | Key { 192 | btnKey: Qt.Key_B 193 | btnText: "b" 194 | inputPanelRef: inputPanel 195 | } 196 | 197 | Key { 198 | btnKey: Qt.Key_N 199 | btnText: "n" 200 | alternativeKeys: "ņńň" 201 | inputPanelRef: inputPanel 202 | } 203 | 204 | Key { 205 | btnKey: Qt.Key_M 206 | btnText: "m" 207 | inputPanelRef: inputPanel 208 | } 209 | 210 | Key { 211 | btnKey: Qt.Key_Comma 212 | btnText: "," 213 | inputPanelRef: inputPanel 214 | } 215 | 216 | Key { 217 | btnKey: Qt.Key_Period 218 | btnText: "." 219 | inputPanelRef: inputPanel 220 | } 221 | 222 | ShiftKey { 223 | weight: 204 224 | } 225 | 226 | } 227 | 228 | RowLayout { 229 | property real keyWeight: 154 230 | 231 | SymbolKey { 232 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 233 | } 234 | 235 | LanguageKey { 236 | visible: availableLanguageLayouts.length > 1 237 | weight: 108.5 238 | } 239 | 240 | SpaceKey { 241 | weight: 1168 242 | inputPanelRef: inputPanel 243 | } 244 | 245 | Key { 246 | btnKey: Qt.Key_Apostrophe 247 | btnText: "'" 248 | inputPanelRef: inputPanel 249 | } 250 | 251 | HideKey { 252 | weight: 205 253 | } 254 | 255 | } 256 | 257 | } 258 | -------------------------------------------------------------------------------- /src/qml/SvLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | inputPanelRef: inputPanel 26 | } 27 | 28 | Key { 29 | btnKey: Qt.Key_R 30 | btnText: "r" 31 | inputPanelRef: inputPanel 32 | } 33 | 34 | Key { 35 | btnKey: Qt.Key_T 36 | btnText: "t" 37 | inputPanelRef: inputPanel 38 | } 39 | 40 | Key { 41 | btnKey: Qt.Key_Y 42 | btnText: "y" 43 | inputPanelRef: inputPanel 44 | } 45 | 46 | Key { 47 | btnKey: Qt.Key_U 48 | btnText: "u" 49 | inputPanelRef: inputPanel 50 | } 51 | 52 | Key { 53 | btnKey: Qt.Key_I 54 | btnText: "i" 55 | inputPanelRef: inputPanel 56 | } 57 | 58 | Key { 59 | btnKey: Qt.Key_O 60 | btnText: "o" 61 | inputPanelRef: inputPanel 62 | } 63 | 64 | Key { 65 | btnKey: Qt.Key_P 66 | btnText: "p" 67 | inputPanelRef: inputPanel 68 | } 69 | 70 | Key { 71 | btnKey: Qt.Key_Aring 72 | btnText: "å" 73 | inputPanelRef: inputPanel 74 | } 75 | 76 | BackspaceKey { 77 | inputPanelRef: inputPanel 78 | } 79 | 80 | } 81 | 82 | RowLayout { 83 | property real keyWeight: 160 84 | 85 | Key { 86 | weight: 56 87 | functionKey: true 88 | showPreview: false 89 | btnBackground: "transparent" 90 | } 91 | 92 | Key { 93 | btnKey: Qt.Key_A 94 | btnText: "a" 95 | inputPanelRef: inputPanel 96 | } 97 | 98 | Key { 99 | btnKey: Qt.Key_S 100 | btnText: "s" 101 | alternativeKeys: "ß" 102 | inputPanelRef: inputPanel 103 | } 104 | 105 | Key { 106 | btnKey: Qt.Key_D 107 | btnText: "d" 108 | inputPanelRef: inputPanel 109 | } 110 | 111 | Key { 112 | btnKey: Qt.Key_F 113 | btnText: "f" 114 | inputPanelRef: inputPanel 115 | } 116 | 117 | Key { 118 | btnKey: Qt.Key_G 119 | btnText: "g" 120 | inputPanelRef: inputPanel 121 | } 122 | 123 | Key { 124 | btnKey: Qt.Key_H 125 | btnText: "h" 126 | inputPanelRef: inputPanel 127 | } 128 | 129 | Key { 130 | btnKey: Qt.Key_J 131 | btnText: "j" 132 | inputPanelRef: inputPanel 133 | } 134 | 135 | Key { 136 | btnKey: Qt.Key_K 137 | btnText: "k" 138 | inputPanelRef: inputPanel 139 | } 140 | 141 | Key { 142 | btnKey: Qt.Key_L 143 | btnText: "l" 144 | inputPanelRef: inputPanel 145 | } 146 | 147 | Key { 148 | btnKey: Qt.Key_Odiaeresis 149 | btnText: "ö" 150 | inputPanelRef: inputPanel 151 | } 152 | 153 | Key { 154 | btnKey: Qt.Key_Adiaeresis 155 | btnText: "ä" 156 | inputPanelRef: inputPanel 157 | } 158 | 159 | EnterKey { 160 | weight: 283 161 | inputPanelRef: inputPanel 162 | } 163 | 164 | } 165 | 166 | RowLayout { 167 | property real keyWeight: 156 168 | 169 | ShiftKey { 170 | } 171 | 172 | Key { 173 | btnKey: Qt.Key_Z 174 | btnText: "z" 175 | inputPanelRef: inputPanel 176 | } 177 | 178 | Key { 179 | btnKey: Qt.Key_X 180 | btnText: "x" 181 | inputPanelRef: inputPanel 182 | } 183 | 184 | Key { 185 | btnKey: Qt.Key_C 186 | btnText: "c" 187 | inputPanelRef: inputPanel 188 | } 189 | 190 | Key { 191 | btnKey: Qt.Key_V 192 | btnText: "v" 193 | inputPanelRef: inputPanel 194 | } 195 | 196 | Key { 197 | btnKey: Qt.Key_B 198 | btnText: "b" 199 | inputPanelRef: inputPanel 200 | } 201 | 202 | Key { 203 | btnKey: Qt.Key_N 204 | btnText: "n" 205 | inputPanelRef: inputPanel 206 | } 207 | 208 | Key { 209 | btnKey: Qt.Key_M 210 | btnText: "m" 211 | inputPanelRef: inputPanel 212 | } 213 | 214 | Key { 215 | btnKey: Qt.Key_Comma 216 | btnText: "," 217 | inputPanelRef: inputPanel 218 | } 219 | 220 | Key { 221 | btnKey: Qt.Key_Period 222 | btnText: "." 223 | inputPanelRef: inputPanel 224 | } 225 | 226 | Key { 227 | btnKey: Qt.Key_Minus 228 | btnText: "-" 229 | inputPanelRef: inputPanel 230 | } 231 | 232 | ShiftKey { 233 | weight: 204 234 | } 235 | 236 | } 237 | 238 | RowLayout { 239 | property real keyWeight: 154 240 | 241 | SymbolKey { 242 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 243 | } 244 | 245 | LanguageKey { 246 | visible: availableLanguageLayouts.length > 1 247 | weight: 108.5 248 | } 249 | 250 | SpaceKey { 251 | weight: 1168 252 | inputPanelRef: inputPanel 253 | } 254 | 255 | Key { 256 | btnKey: Qt.Key_Apostrophe 257 | btnText: "'" 258 | inputPanelRef: inputPanel 259 | } 260 | 261 | HideKey { 262 | weight: 205 263 | } 264 | 265 | } 266 | 267 | } 268 | -------------------------------------------------------------------------------- /src/qml/DeLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | inputPanelRef: inputPanel 26 | } 27 | 28 | Key { 29 | btnKey: Qt.Key_R 30 | btnText: "r" 31 | inputPanelRef: inputPanel 32 | } 33 | 34 | Key { 35 | btnKey: Qt.Key_T 36 | btnText: "t" 37 | inputPanelRef: inputPanel 38 | } 39 | 40 | Key { 41 | btnKey: Qt.Key_Z 42 | btnText: "z" 43 | inputPanelRef: inputPanel 44 | } 45 | 46 | Key { 47 | btnKey: Qt.Key_U 48 | btnText: "u" 49 | inputPanelRef: inputPanel 50 | } 51 | 52 | Key { 53 | btnKey: Qt.Key_I 54 | btnText: "i" 55 | inputPanelRef: inputPanel 56 | } 57 | 58 | Key { 59 | btnKey: Qt.Key_O 60 | btnText: "o" 61 | inputPanelRef: inputPanel 62 | } 63 | 64 | Key { 65 | btnKey: Qt.Key_P 66 | btnText: "p" 67 | inputPanelRef: inputPanel 68 | } 69 | 70 | Key { 71 | btnKey: Qt.Key_Udiaeresis 72 | btnText: "ü" 73 | inputPanelRef: inputPanel 74 | } 75 | 76 | BackspaceKey { 77 | inputPanelRef: inputPanel 78 | } 79 | 80 | } 81 | 82 | RowLayout { 83 | property real keyWeight: 160 84 | 85 | Key { 86 | weight: 56 87 | functionKey: true 88 | showPreview: false 89 | btnBackground: "transparent" 90 | } 91 | 92 | Key { 93 | btnKey: Qt.Key_A 94 | btnText: "a" 95 | inputPanelRef: inputPanel 96 | } 97 | 98 | Key { 99 | btnKey: Qt.Key_S 100 | btnText: "s" 101 | alternativeKeys: "ß" 102 | inputPanelRef: inputPanel 103 | } 104 | 105 | Key { 106 | btnKey: Qt.Key_D 107 | btnText: "d" 108 | inputPanelRef: inputPanel 109 | } 110 | 111 | Key { 112 | btnKey: Qt.Key_F 113 | btnText: "f" 114 | inputPanelRef: inputPanel 115 | } 116 | 117 | Key { 118 | btnKey: Qt.Key_G 119 | btnText: "g" 120 | inputPanelRef: inputPanel 121 | } 122 | 123 | Key { 124 | btnKey: Qt.Key_H 125 | btnText: "h" 126 | inputPanelRef: inputPanel 127 | } 128 | 129 | Key { 130 | btnKey: Qt.Key_J 131 | btnText: "j" 132 | inputPanelRef: inputPanel 133 | } 134 | 135 | Key { 136 | btnKey: Qt.Key_K 137 | btnText: "k" 138 | inputPanelRef: inputPanel 139 | } 140 | 141 | Key { 142 | btnKey: Qt.Key_L 143 | btnText: "l" 144 | inputPanelRef: inputPanel 145 | } 146 | 147 | Key { 148 | btnKey: Qt.Key_Odiaeresis 149 | btnText: "ö" 150 | inputPanelRef: inputPanel 151 | } 152 | 153 | Key { 154 | btnKey: Qt.Key_Adiaeresis 155 | btnText: "ä" 156 | inputPanelRef: inputPanel 157 | } 158 | 159 | EnterKey { 160 | weight: 283 161 | inputPanelRef: inputPanel 162 | } 163 | 164 | } 165 | 166 | RowLayout { 167 | property real keyWeight: 156 168 | 169 | ShiftKey { 170 | } 171 | 172 | Key { 173 | btnKey: Qt.Key_Y 174 | btnText: "y" 175 | inputPanelRef: inputPanel 176 | } 177 | 178 | Key { 179 | btnKey: Qt.Key_X 180 | btnText: "x" 181 | inputPanelRef: inputPanel 182 | } 183 | 184 | Key { 185 | btnKey: Qt.Key_C 186 | btnText: "c" 187 | inputPanelRef: inputPanel 188 | } 189 | 190 | Key { 191 | btnKey: Qt.Key_V 192 | btnText: "v" 193 | inputPanelRef: inputPanel 194 | } 195 | 196 | Key { 197 | btnKey: Qt.Key_B 198 | btnText: "b" 199 | inputPanelRef: inputPanel 200 | } 201 | 202 | Key { 203 | btnKey: Qt.Key_N 204 | btnText: "n" 205 | inputPanelRef: inputPanel 206 | } 207 | 208 | Key { 209 | btnKey: Qt.Key_M 210 | btnText: "m" 211 | inputPanelRef: inputPanel 212 | } 213 | 214 | Key { 215 | btnKey: Qt.Key_Comma 216 | btnText: "," 217 | inputPanelRef: inputPanel 218 | } 219 | 220 | Key { 221 | btnKey: Qt.Key_Period 222 | btnText: "." 223 | inputPanelRef: inputPanel 224 | } 225 | 226 | Key { 227 | btnKey: Qt.Key_Minus 228 | btnText: "-" 229 | inputPanelRef: inputPanel 230 | } 231 | 232 | ShiftKey { 233 | weight: 204 234 | } 235 | 236 | } 237 | 238 | RowLayout { 239 | property real keyWeight: 154 240 | 241 | SymbolKey { 242 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 243 | } 244 | 245 | LanguageKey { 246 | visible: availableLanguageLayouts.length > 1 247 | weight: 108.5 248 | } 249 | 250 | SpaceKey { 251 | weight: 1168 252 | inputPanelRef: inputPanel 253 | } 254 | 255 | Key { 256 | btnKey: Qt.Key_Apostrophe 257 | btnText: "'" 258 | inputPanelRef: inputPanel 259 | } 260 | 261 | HideKey { 262 | weight: 205 263 | } 264 | 265 | } 266 | 267 | } 268 | -------------------------------------------------------------------------------- /src/qml/DaLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | alternativeKeys: "éèêë" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_R 31 | btnText: "r" 32 | inputPanelRef: inputPanel 33 | } 34 | 35 | Key { 36 | btnKey: Qt.Key_T 37 | btnText: "t" 38 | inputPanelRef: inputPanel 39 | } 40 | 41 | Key { 42 | btnKey: Qt.Key_Y 43 | btnText: "y" 44 | inputPanelRef: inputPanel 45 | } 46 | 47 | Key { 48 | btnKey: Qt.Key_U 49 | btnText: "u" 50 | alternativeKeys: "úùûü" 51 | inputPanelRef: inputPanel 52 | } 53 | 54 | Key { 55 | btnKey: Qt.Key_I 56 | btnText: "i" 57 | alternativeKeys: "íìîï" 58 | inputPanelRef: inputPanel 59 | } 60 | 61 | Key { 62 | btnKey: Qt.Key_O 63 | btnText: "o" 64 | alternativeKeys: "óòôö" 65 | inputPanelRef: inputPanel 66 | } 67 | 68 | Key { 69 | btnKey: Qt.Key_P 70 | btnText: "p" 71 | inputPanelRef: inputPanel 72 | } 73 | 74 | Key { 75 | btnKey: Qt.Key_Aring 76 | btnText: "å" 77 | inputPanelRef: inputPanel 78 | } 79 | 80 | BackspaceKey { 81 | inputPanelRef: inputPanel 82 | } 83 | 84 | } 85 | 86 | RowLayout { 87 | property real keyWeight: 160 88 | 89 | Key { 90 | weight: 56 91 | functionKey: true 92 | showPreview: false 93 | btnBackground: "transparent" 94 | } 95 | 96 | Key { 97 | btnKey: Qt.Key_A 98 | btnText: "a" 99 | alternativeKeys: "áàâä" 100 | inputPanelRef: inputPanel 101 | } 102 | 103 | Key { 104 | btnKey: Qt.Key_S 105 | btnText: "s" 106 | inputPanelRef: inputPanel 107 | } 108 | 109 | Key { 110 | btnKey: Qt.Key_D 111 | btnText: "d" 112 | inputPanelRef: inputPanel 113 | } 114 | 115 | Key { 116 | btnKey: Qt.Key_F 117 | btnText: "f" 118 | inputPanelRef: inputPanel 119 | } 120 | 121 | Key { 122 | btnKey: Qt.Key_G 123 | btnText: "g" 124 | inputPanelRef: inputPanel 125 | } 126 | 127 | Key { 128 | btnKey: Qt.Key_H 129 | btnText: "h" 130 | inputPanelRef: inputPanel 131 | } 132 | 133 | Key { 134 | btnKey: Qt.Key_J 135 | btnText: "j" 136 | inputPanelRef: inputPanel 137 | } 138 | 139 | Key { 140 | btnKey: Qt.Key_K 141 | btnText: "k" 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | Key { 146 | btnKey: Qt.Key_L 147 | btnText: "l" 148 | inputPanelRef: inputPanel 149 | } 150 | 151 | Key { 152 | btnKey: Qt.Key_AE 153 | btnText: "æ" 154 | inputPanelRef: inputPanel 155 | } 156 | 157 | Key { 158 | btnKey: Qt.Key_Ooblique 159 | btnText: "ø" 160 | inputPanelRef: inputPanel 161 | } 162 | 163 | EnterKey { 164 | weight: 283 165 | inputPanelRef: inputPanel 166 | } 167 | 168 | } 169 | 170 | RowLayout { 171 | property real keyWeight: 156 172 | 173 | ShiftKey { 174 | } 175 | 176 | Key { 177 | btnKey: Qt.Key_Z 178 | btnText: "z" 179 | inputPanelRef: inputPanel 180 | } 181 | 182 | Key { 183 | btnKey: Qt.Key_X 184 | btnText: "x" 185 | inputPanelRef: inputPanel 186 | } 187 | 188 | Key { 189 | btnKey: Qt.Key_C 190 | btnText: "c" 191 | inputPanelRef: inputPanel 192 | } 193 | 194 | Key { 195 | btnKey: Qt.Key_V 196 | btnText: "v" 197 | inputPanelRef: inputPanel 198 | } 199 | 200 | Key { 201 | btnKey: Qt.Key_B 202 | btnText: "b" 203 | inputPanelRef: inputPanel 204 | } 205 | 206 | Key { 207 | btnKey: Qt.Key_N 208 | btnText: "n" 209 | inputPanelRef: inputPanel 210 | } 211 | 212 | Key { 213 | btnKey: Qt.Key_M 214 | btnText: "m" 215 | inputPanelRef: inputPanel 216 | } 217 | 218 | Key { 219 | btnKey: Qt.Key_Comma 220 | btnText: "," 221 | inputPanelRef: inputPanel 222 | } 223 | 224 | Key { 225 | btnKey: Qt.Key_Period 226 | btnText: "." 227 | inputPanelRef: inputPanel 228 | } 229 | 230 | Key { 231 | btnKey: Qt.Key_Minus 232 | btnText: "-" 233 | inputPanelRef: inputPanel 234 | } 235 | 236 | ShiftKey { 237 | weight: 204 238 | } 239 | 240 | } 241 | 242 | RowLayout { 243 | property real keyWeight: 154 244 | 245 | SymbolKey { 246 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 247 | } 248 | 249 | LanguageKey { 250 | visible: availableLanguageLayouts.length > 1 251 | weight: 108.5 252 | } 253 | 254 | SpaceKey { 255 | weight: 1168 256 | inputPanelRef: inputPanel 257 | } 258 | 259 | Key { 260 | btnKey: Qt.Key_Apostrophe 261 | btnText: "'" 262 | inputPanelRef: inputPanel 263 | } 264 | 265 | HideKey { 266 | weight: 205 267 | } 268 | 269 | } 270 | 271 | 272 | } 273 | -------------------------------------------------------------------------------- /src/qml/FiLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | alternativeKeys: "éèêë" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_R 31 | btnText: "r" 32 | inputPanelRef: inputPanel 33 | } 34 | 35 | Key { 36 | btnKey: Qt.Key_T 37 | btnText: "t" 38 | inputPanelRef: inputPanel 39 | } 40 | 41 | Key { 42 | btnKey: Qt.Key_Y 43 | btnText: "y" 44 | inputPanelRef: inputPanel 45 | } 46 | 47 | Key { 48 | btnKey: Qt.Key_U 49 | btnText: "u" 50 | alternativeKeys: "úùûü" 51 | inputPanelRef: inputPanel 52 | } 53 | 54 | Key { 55 | btnKey: Qt.Key_I 56 | btnText: "i" 57 | alternativeKeys: "íìîï" 58 | inputPanelRef: inputPanel 59 | } 60 | 61 | Key { 62 | btnKey: Qt.Key_O 63 | btnText: "o" 64 | alternativeKeys: "óòôö" 65 | inputPanelRef: inputPanel 66 | } 67 | 68 | Key { 69 | btnKey: Qt.Key_P 70 | btnText: "p" 71 | inputPanelRef: inputPanel 72 | } 73 | 74 | Key { 75 | btnKey: Qt.Key_Aring 76 | btnText: "å" 77 | inputPanelRef: inputPanel 78 | } 79 | 80 | BackspaceKey { 81 | inputPanelRef: inputPanel 82 | } 83 | 84 | } 85 | 86 | RowLayout { 87 | property real keyWeight: 160 88 | 89 | Key { 90 | weight: 56 91 | functionKey: true 92 | showPreview: false 93 | btnBackground: "transparent" 94 | } 95 | 96 | Key { 97 | btnKey: Qt.Key_A 98 | btnText: "a" 99 | alternativeKeys: "áàâä" 100 | inputPanelRef: inputPanel 101 | } 102 | 103 | Key { 104 | btnKey: Qt.Key_S 105 | btnText: "s" 106 | inputPanelRef: inputPanel 107 | } 108 | 109 | Key { 110 | btnKey: Qt.Key_D 111 | btnText: "d" 112 | inputPanelRef: inputPanel 113 | } 114 | 115 | Key { 116 | btnKey: Qt.Key_F 117 | btnText: "f" 118 | inputPanelRef: inputPanel 119 | } 120 | 121 | Key { 122 | btnKey: Qt.Key_G 123 | btnText: "g" 124 | inputPanelRef: inputPanel 125 | } 126 | 127 | Key { 128 | btnKey: Qt.Key_H 129 | btnText: "h" 130 | inputPanelRef: inputPanel 131 | } 132 | 133 | Key { 134 | btnKey: Qt.Key_J 135 | btnText: "j" 136 | inputPanelRef: inputPanel 137 | } 138 | 139 | Key { 140 | btnKey: Qt.Key_K 141 | btnText: "k" 142 | inputPanelRef: inputPanel 143 | } 144 | 145 | Key { 146 | btnKey: Qt.Key_L 147 | btnText: "l" 148 | inputPanelRef: inputPanel 149 | } 150 | 151 | Key { 152 | btnKey: Qt.Key_Odiaeresis 153 | btnText: "ö" 154 | inputPanelRef: inputPanel 155 | } 156 | 157 | Key { 158 | btnKey: Qt.Key_Adiaeresis 159 | btnText: "ä" 160 | inputPanelRef: inputPanel 161 | } 162 | 163 | EnterKey { 164 | weight: 283 165 | inputPanelRef: inputPanel 166 | } 167 | 168 | } 169 | 170 | RowLayout { 171 | property real keyWeight: 156 172 | 173 | ShiftKey { 174 | } 175 | 176 | Key { 177 | btnKey: Qt.Key_Z 178 | btnText: "z" 179 | inputPanelRef: inputPanel 180 | } 181 | 182 | Key { 183 | btnKey: Qt.Key_X 184 | btnText: "x" 185 | inputPanelRef: inputPanel 186 | } 187 | 188 | Key { 189 | btnKey: Qt.Key_C 190 | btnText: "c" 191 | inputPanelRef: inputPanel 192 | } 193 | 194 | Key { 195 | btnKey: Qt.Key_V 196 | btnText: "v" 197 | inputPanelRef: inputPanel 198 | } 199 | 200 | Key { 201 | btnKey: Qt.Key_B 202 | btnText: "b" 203 | inputPanelRef: inputPanel 204 | } 205 | 206 | Key { 207 | btnKey: Qt.Key_N 208 | btnText: "n" 209 | inputPanelRef: inputPanel 210 | } 211 | 212 | Key { 213 | btnKey: Qt.Key_M 214 | btnText: "m" 215 | inputPanelRef: inputPanel 216 | } 217 | 218 | Key { 219 | btnKey: Qt.Key_Comma 220 | btnText: "," 221 | inputPanelRef: inputPanel 222 | } 223 | 224 | Key { 225 | btnKey: Qt.Key_Period 226 | btnText: "." 227 | inputPanelRef: inputPanel 228 | } 229 | 230 | Key { 231 | btnKey: Qt.Key_Minus 232 | btnText: "-" 233 | inputPanelRef: inputPanel 234 | } 235 | 236 | ShiftKey { 237 | weight: 204 238 | } 239 | 240 | } 241 | 242 | RowLayout { 243 | property real keyWeight: 154 244 | 245 | SymbolKey { 246 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 247 | } 248 | 249 | LanguageKey { 250 | visible: availableLanguageLayouts.length > 1 251 | weight: 108.5 252 | } 253 | 254 | SpaceKey { 255 | weight: 1168 256 | inputPanelRef: inputPanel 257 | } 258 | 259 | Key { 260 | btnKey: Qt.Key_Apostrophe 261 | btnText: "'" 262 | inputPanelRef: inputPanel 263 | } 264 | 265 | HideKey { 266 | weight: 205 267 | } 268 | 269 | } 270 | 271 | } 272 | -------------------------------------------------------------------------------- /src/qml/LtSrHrBsLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | ColumnLayout { 5 | property var inputPanel 6 | 7 | RowLayout { 8 | property real keyWeight: 160 9 | 10 | Key { 11 | btnKey: Qt.Key_Q 12 | btnText: "q" 13 | inputPanelRef: inputPanel 14 | } 15 | 16 | Key { 17 | btnKey: Qt.Key_W 18 | btnText: "w" 19 | inputPanelRef: inputPanel 20 | } 21 | 22 | Key { 23 | btnKey: Qt.Key_E 24 | btnText: "e" 25 | inputPanelRef: inputPanel 26 | } 27 | 28 | Key { 29 | btnKey: Qt.Key_R 30 | btnText: "r" 31 | inputPanelRef: inputPanel 32 | } 33 | 34 | Key { 35 | btnKey: Qt.Key_T 36 | btnText: "t" 37 | inputPanelRef: inputPanel 38 | } 39 | 40 | Key { 41 | btnKey: Qt.Key_Z 42 | btnText: "z" 43 | inputPanelRef: inputPanel 44 | } 45 | 46 | Key { 47 | btnKey: Qt.Key_U 48 | btnText: "u" 49 | inputPanelRef: inputPanel 50 | } 51 | 52 | Key { 53 | btnKey: Qt.Key_I 54 | btnText: "i" 55 | inputPanelRef: inputPanel 56 | } 57 | 58 | Key { 59 | btnKey: Qt.Key_O 60 | btnText: "o" 61 | inputPanelRef: inputPanel 62 | } 63 | 64 | Key { 65 | btnKey: Qt.Key_P 66 | btnText: "p" 67 | inputPanelRef: inputPanel 68 | } 69 | 70 | Key { 71 | btnKey: Qt.Key_Udiaeresis 72 | btnText: "š" 73 | inputPanelRef: inputPanel 74 | } 75 | 76 | Key { 77 | btnKey: Qt.Key_Asterisk 78 | btnText: "đ" 79 | inputPanelRef: inputPanel 80 | } 81 | 82 | BackspaceKey { 83 | inputPanelRef: inputPanel 84 | } 85 | 86 | } 87 | 88 | RowLayout { 89 | property real keyWeight: 160 90 | 91 | Key { 92 | weight: 56 93 | functionKey: true 94 | showPreview: false 95 | btnBackground: "transparent" 96 | } 97 | 98 | Key { 99 | btnKey: Qt.Key_A 100 | btnText: "a" 101 | inputPanelRef: inputPanel 102 | } 103 | 104 | Key { 105 | btnKey: Qt.Key_S 106 | btnText: "s" 107 | alternativeKeys: "ß" 108 | inputPanelRef: inputPanel 109 | } 110 | 111 | Key { 112 | btnKey: Qt.Key_D 113 | btnText: "d" 114 | inputPanelRef: inputPanel 115 | } 116 | 117 | Key { 118 | btnKey: Qt.Key_F 119 | btnText: "f" 120 | inputPanelRef: inputPanel 121 | } 122 | 123 | Key { 124 | btnKey: Qt.Key_G 125 | btnText: "g" 126 | inputPanelRef: inputPanel 127 | } 128 | 129 | Key { 130 | btnKey: Qt.Key_H 131 | btnText: "h" 132 | inputPanelRef: inputPanel 133 | } 134 | 135 | Key { 136 | btnKey: Qt.Key_J 137 | btnText: "j" 138 | inputPanelRef: inputPanel 139 | } 140 | 141 | Key { 142 | btnKey: Qt.Key_K 143 | btnText: "k" 144 | inputPanelRef: inputPanel 145 | } 146 | 147 | Key { 148 | btnKey: Qt.Key_L 149 | btnText: "l" 150 | inputPanelRef: inputPanel 151 | } 152 | 153 | Key { 154 | btnKey: Qt.Key_Odiaeresis 155 | btnText: "č" 156 | inputPanelRef: inputPanel 157 | } 158 | 159 | Key { 160 | btnKey: Qt.Key_Adiaeresis 161 | btnText: "ć" 162 | inputPanelRef: inputPanel 163 | } 164 | 165 | Key { 166 | btnKey: Qt.Key_Apostrophe 167 | btnText: "ž" 168 | inputPanelRef: inputPanel 169 | } 170 | 171 | EnterKey { 172 | weight: 283 173 | inputPanelRef: inputPanel 174 | } 175 | 176 | } 177 | 178 | RowLayout { 179 | property real keyWeight: 156 180 | 181 | ShiftKey { 182 | } 183 | 184 | Key { 185 | btnKey: Qt.Key_Y 186 | btnText: "y" 187 | inputPanelRef: inputPanel 188 | } 189 | 190 | Key { 191 | btnKey: Qt.Key_X 192 | btnText: "x" 193 | inputPanelRef: inputPanel 194 | } 195 | 196 | Key { 197 | btnKey: Qt.Key_C 198 | btnText: "c" 199 | inputPanelRef: inputPanel 200 | } 201 | 202 | Key { 203 | btnKey: Qt.Key_V 204 | btnText: "v" 205 | inputPanelRef: inputPanel 206 | } 207 | 208 | Key { 209 | btnKey: Qt.Key_B 210 | btnText: "b" 211 | inputPanelRef: inputPanel 212 | } 213 | 214 | Key { 215 | btnKey: Qt.Key_N 216 | btnText: "n" 217 | inputPanelRef: inputPanel 218 | } 219 | 220 | Key { 221 | btnKey: Qt.Key_M 222 | btnText: "m" 223 | inputPanelRef: inputPanel 224 | } 225 | 226 | Key { 227 | btnKey: Qt.Key_Comma 228 | btnText: "," 229 | inputPanelRef: inputPanel 230 | } 231 | 232 | Key { 233 | btnKey: Qt.Key_Period 234 | btnText: "." 235 | inputPanelRef: inputPanel 236 | } 237 | 238 | Key { 239 | btnKey: Qt.Key_Minus 240 | btnText: "-" 241 | inputPanelRef: inputPanel 242 | } 243 | 244 | ShiftKey { 245 | weight: 204 246 | } 247 | 248 | } 249 | 250 | RowLayout { 251 | property real keyWeight: 154 252 | 253 | SymbolKey { 254 | weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 255 | } 256 | 257 | LanguageKey { 258 | visible: availableLanguageLayouts.length > 1 259 | weight: 108.5 260 | } 261 | 262 | SpaceKey { 263 | weight: 1168 264 | inputPanelRef: inputPanel 265 | } 266 | 267 | Key { 268 | btnText: "'" 269 | inputPanelRef: inputPanel 270 | } 271 | 272 | HideKey { 273 | weight: 205 274 | } 275 | 276 | } 277 | 278 | } 279 | -------------------------------------------------------------------------------- /src/DeclarativeInputEngine.cpp: -------------------------------------------------------------------------------- 1 | #include "DeclarativeInputEngine.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "DeclarativeInputEngine.h" 10 | 11 | /** 12 | * Private data class 13 | */ 14 | struct DeclarativeInputEnginePrivate { 15 | explicit DeclarativeInputEnginePrivate(DeclarativeInputEngine *_public); 16 | 17 | struct LayoutData { 18 | QString layoutFile; 19 | QString description; 20 | QString spaceIdentifier = "Space"; 21 | }; 22 | 23 | DeclarativeInputEngine *_this; 24 | bool Animating; 25 | QTimer *AnimatingFinishedTimer{nullptr}; 26 | int InputMode; 27 | QRect KeyboardRectangle; 28 | 29 | bool isUppercase{false}; 30 | bool symbolMode{false}; 31 | QHash layoutFiles = { 32 | {DeclarativeInputEngine::En, {"EnLayout", "English"}}, 33 | {DeclarativeInputEngine::Fr, {"FrLayout", "Français"}}, 34 | {DeclarativeInputEngine::It, {"ItLayout", "Italiano"}}, 35 | {DeclarativeInputEngine::Es, {"EsLayout", "Español"}}, 36 | {DeclarativeInputEngine::De, {"DeLayout", "Deutsch", "Leerzeichen"}}, 37 | {DeclarativeInputEngine::Nl, {"NlLayout", "Nederlands"}}, 38 | {DeclarativeInputEngine::Pt, {"PtLayout", "Português"}}, 39 | {DeclarativeInputEngine::Cs, {"CsLayout", "Čeština"}}, 40 | {DeclarativeInputEngine::El, {"ElLayout", "Ελληνικός"}}, 41 | {DeclarativeInputEngine::Pl, {"PlLayout", "Polski"}}, 42 | {DeclarativeInputEngine::Da, {"DaLayout", "Dansk"}}, 43 | {DeclarativeInputEngine::Fi, {"FiLayout", "Suomi"}}, 44 | {DeclarativeInputEngine::Hr, {"LtSrHrBsLayout", "Hrvatski"}}, 45 | {DeclarativeInputEngine::CyBs, {"CySrBsLayout", "Босански"}}, 46 | {DeclarativeInputEngine::LtBs, {"LtSrHrBsLayout", "Bosanski"}}, 47 | {DeclarativeInputEngine::CySr, {"CySrBsLayout", "Српски"}}, 48 | {DeclarativeInputEngine::LtSr, {"LtSrHrBsLayout", "Srpski"}}, 49 | {DeclarativeInputEngine::Sv, {"SvLayout", "Svenska"}}, 50 | {DeclarativeInputEngine::Ru, {"RuLayout", "Русский", "Пробел"}}, 51 | {DeclarativeInputEngine::Uk, {"UkLayout", "Українська", "Пробіл"}}, 52 | }; 53 | }; 54 | 55 | DeclarativeInputEnginePrivate::DeclarativeInputEnginePrivate( 56 | DeclarativeInputEngine *_public) 57 | : _this(_public), 58 | Animating(false), 59 | InputMode(DeclarativeInputEngine::Letters) {} 60 | 61 | DeclarativeInputEngine::DeclarativeInputEngine(QObject *parent) 62 | : QObject(parent), d(new DeclarativeInputEnginePrivate(this)) { 63 | d->AnimatingFinishedTimer = new QTimer(this); 64 | d->AnimatingFinishedTimer->setSingleShot(true); 65 | d->AnimatingFinishedTimer->setInterval(100); 66 | connect(d->AnimatingFinishedTimer, &QTimer::timeout, this, 67 | &DeclarativeInputEngine::animatingFinished); 68 | } 69 | 70 | DeclarativeInputEngine::~DeclarativeInputEngine() { delete d; } 71 | 72 | bool DeclarativeInputEngine::virtualKeyClick(Qt::Key key, const QString &text, 73 | Qt::KeyboardModifiers modifiers) { 74 | QKeyEvent pressEvent(QEvent::KeyPress, key, 75 | Qt::KeyboardModifiers(modifiers), text); 76 | QKeyEvent releaseEvent(QEvent::KeyRelease, key, 77 | Qt::KeyboardModifiers(modifiers), text); 78 | return QCoreApplication::sendEvent(QGuiApplication::focusObject(), 79 | &pressEvent) && 80 | QCoreApplication::sendEvent(QGuiApplication::focusObject(), 81 | &releaseEvent); 82 | } 83 | 84 | QRect DeclarativeInputEngine::keyboardRectangle() const { 85 | return d->KeyboardRectangle; 86 | } 87 | 88 | void DeclarativeInputEngine::setKeyboardRectangle(const QRect &Rect) { 89 | setAnimating(true); 90 | d->AnimatingFinishedTimer->start(100); 91 | d->KeyboardRectangle = Rect; 92 | emit keyboardRectangleChanged(); 93 | } 94 | 95 | bool DeclarativeInputEngine::isAnimating() const { return d->Animating; } 96 | 97 | void DeclarativeInputEngine::setAnimating(bool Animating) { 98 | if (d->Animating != Animating) { 99 | d->Animating = Animating; 100 | emit animatingChanged(); 101 | } 102 | } 103 | 104 | void DeclarativeInputEngine::animatingFinished() { setAnimating(false); } 105 | 106 | int DeclarativeInputEngine::inputMode() const { return d->InputMode; } 107 | 108 | void DeclarativeInputEngine::setInputMode(int Mode) { 109 | if (Mode != d->InputMode) { 110 | d->InputMode = Mode; 111 | emit inputModeChanged(); 112 | } 113 | } 114 | 115 | bool DeclarativeInputEngine::isUppercase() const { return d->isUppercase; } 116 | 117 | void DeclarativeInputEngine::setUppercase(bool uppercase) { 118 | if (d->isUppercase != uppercase) { 119 | d->isUppercase = uppercase; 120 | emit isUppercaseChanged(); 121 | } 122 | } 123 | 124 | bool DeclarativeInputEngine::isSymbolMode() const { return d->symbolMode; } 125 | 126 | void DeclarativeInputEngine::setSymbolMode(bool symbolMode) { 127 | if (d->symbolMode != symbolMode) { 128 | d->symbolMode = symbolMode; 129 | emit isSymbolModeChanged(); 130 | } 131 | } 132 | 133 | bool DeclarativeInputEngine::inputLayoutValid(const QString &layout) const { 134 | for (int i = InputLayouts::En; i != InputLayouts::EndLayouts; i++) { 135 | const auto validLayout = QMetaEnum::fromType().valueToKey( 136 | static_cast(i)); 137 | if (validLayout == layout) { 138 | return true; 139 | } 140 | } 141 | 142 | qCritical() << "Keyboard layout" << layout 143 | << "is not supported. Falling back to En!"; 144 | return false; 145 | } 146 | 147 | QString DeclarativeInputEngine::fileOfLayout(QString layout) { 148 | if (!inputLayoutValid(layout)) { 149 | return ""; 150 | } 151 | bool ok = false; 152 | auto layoutVal = static_cast( 153 | QMetaEnum::fromType().keyToValue(layout.toUtf8().data(), 154 | &ok)); 155 | if (!ok) { 156 | return ""; 157 | } 158 | return d->layoutFiles.value(layoutVal, {}).layoutFile; 159 | } 160 | 161 | QString DeclarativeInputEngine::descriptionOfLayout(QString layout) { 162 | if (!inputLayoutValid(layout)) { 163 | return ""; 164 | } 165 | bool ok = false; 166 | auto layoutVal = static_cast( 167 | QMetaEnum::fromType().keyToValue(layout.toUtf8().data(), 168 | &ok)); 169 | if (!ok) { 170 | return ""; 171 | } 172 | return d->layoutFiles.value(layoutVal, {}).description; 173 | } 174 | 175 | QString DeclarativeInputEngine::spaceIdentifierOfLayout(QString layout) 176 | { 177 | if (!inputLayoutValid(layout)) { 178 | return ""; 179 | } 180 | bool ok = false; 181 | auto layoutVal = static_cast( 182 | QMetaEnum::fromType().keyToValue(layout.toUtf8().data(), 183 | &ok)); 184 | if (!ok) { 185 | return ""; 186 | } 187 | return d->layoutFiles.value(layoutVal, {}).spaceIdentifier; 188 | } 189 | -------------------------------------------------------------------------------- /src/VirtualKeyboardInputContext.cpp: -------------------------------------------------------------------------------- 1 | #include "VirtualKeyboardInputContext.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "DeclarativeInputEngine.h" 10 | #include "EnterKeyAction.hpp" 11 | #include "EnterKeyActionAttachedType.hpp" 12 | #include "InputPanelIface.hpp" 13 | #include 14 | 15 | /** 16 | * Private data class for VirtualKeyboardInputContext 17 | */ 18 | class VirtualKeyboardInputContextPrivate { 19 | public: 20 | VirtualKeyboardInputContextPrivate(); 21 | 22 | QQuickFlickable *Flickable; 23 | QQuickItem *FocusItem; 24 | bool Visible; 25 | DeclarativeInputEngine *InputEngine; 26 | QPropertyAnimation *FlickableContentScrollAnimation{nullptr}; 27 | 28 | InputPanelIface *inputPanelIface; 29 | }; 30 | 31 | VirtualKeyboardInputContextPrivate::VirtualKeyboardInputContextPrivate() 32 | : Flickable(0), 33 | FocusItem(0), 34 | Visible(false), 35 | InputEngine(new DeclarativeInputEngine()), 36 | inputPanelIface(new InputPanelIface()) {} 37 | 38 | VirtualKeyboardInputContext::VirtualKeyboardInputContext() 39 | : QPlatformInputContext(), d(new VirtualKeyboardInputContextPrivate) { 40 | d->FlickableContentScrollAnimation = new QPropertyAnimation(this); 41 | d->FlickableContentScrollAnimation->setPropertyName("contentY"); 42 | d->FlickableContentScrollAnimation->setDuration(400); 43 | d->FlickableContentScrollAnimation->setEasingCurve( 44 | QEasingCurve(QEasingCurve::OutBack)); 45 | qmlRegisterSingletonType( 46 | "CuteKeyboard", 1, 0, "InputEngine", inputEngineProvider); 47 | connect(d->InputEngine, &DeclarativeInputEngine::animatingChanged, this, 48 | &VirtualKeyboardInputContext::ensureFocusedObjectVisible); 49 | connect(d->InputEngine, &DeclarativeInputEngine::keyboardRectangleChanged, this, &VirtualKeyboardInputContext::emitKeyboardRectChanged); 50 | 51 | qmlRegisterSingletonType("CuteKeyboard", 1, 0, 52 | "InputPanel", inputPanelProvider); 53 | qmlRegisterSingletonType( 54 | "CuteKeyboard", 1, 0, "InputContext", inputContextProvider); 55 | qmlRegisterType("QtQuick.CuteKeyboard", 1, 0, 56 | "EnterKeyAction"); 57 | qmlRegisterType("CuteKeyboard", 1, 0, "EnterKeyAction"); 58 | } 59 | 60 | VirtualKeyboardInputContext::~VirtualKeyboardInputContext() {} 61 | 62 | VirtualKeyboardInputContext *VirtualKeyboardInputContext::instance() { 63 | static VirtualKeyboardInputContext *InputContextInstance = 64 | new VirtualKeyboardInputContext; 65 | return InputContextInstance; 66 | } 67 | 68 | QObject *VirtualKeyboardInputContext::inputItem() const { return d->FocusItem; } 69 | 70 | bool VirtualKeyboardInputContext::focusItemHasEnterKeyAction( 71 | QObject *item) const { 72 | return item != nullptr && 73 | qmlAttachedPropertiesObject(item, false); 74 | } 75 | 76 | void VirtualKeyboardInputContext::registerInputPanel(QObject *inputPanel) 77 | { 78 | Q_ASSERT(!this->inputPanel); 79 | this->inputPanel = inputPanel; 80 | if (QQuickItem *item = qobject_cast(inputPanel)) 81 | item->setZ(std::numeric_limits::max()); 82 | } 83 | 84 | bool VirtualKeyboardInputContext::isValid() const { return true; } 85 | 86 | QRectF VirtualKeyboardInputContext::keyboardRect() const 87 | { 88 | return d->InputEngine->keyboardRectangle(); 89 | } 90 | 91 | void VirtualKeyboardInputContext::showInputPanel() { 92 | d->Visible = true; 93 | QPlatformInputContext::showInputPanel(); 94 | emitInputPanelVisibleChanged(); 95 | } 96 | 97 | void VirtualKeyboardInputContext::hideInputPanel() { 98 | d->Visible = false; 99 | QPlatformInputContext::hideInputPanel(); 100 | emitInputPanelVisibleChanged(); 101 | } 102 | 103 | bool VirtualKeyboardInputContext::isInputPanelVisible() const { 104 | return d->Visible; 105 | } 106 | 107 | bool VirtualKeyboardInputContext::isAnimating() const { return false; } 108 | 109 | void VirtualKeyboardInputContext::setFocusObject(QObject *object) { 110 | static const int NumericInputHints = Qt::ImhPreferNumbers | Qt::ImhDate | 111 | Qt::ImhTime | 112 | Qt::ImhFormattedNumbersOnly; 113 | 114 | QObject::disconnect(visibleConnection); 115 | 116 | if (!object) { 117 | return; 118 | } 119 | 120 | d->FocusItem = dynamic_cast(object); 121 | if (!d->FocusItem) { 122 | return; 123 | } 124 | 125 | bool AcceptsInput = d->FocusItem->inputMethodQuery(Qt::ImEnabled).toBool(); 126 | if (!AcceptsInput) { 127 | hideInputPanel(); 128 | return; 129 | } 130 | 131 | // set the focusItem as parent of InputPanel 132 | if (QObject *item = inputItem()) { 133 | // ToDo: the InputPanel is set once, so cast can be done at register QQuickItem 134 | if (QQuickItem *vkbPanel = qobject_cast(inputPanel)) { 135 | // ToDo: cast of inputItem is overflow ... use d->FocusItem 136 | if (QQuickItem *quickItem = qobject_cast(item)) { 137 | const QVariant isRootItem = vkbPanel->property("__isRootItem"); 138 | /* 139 | For integrated keyboards, make sure it's a sibling to the overlay. The 140 | high z-order will make sure it gets events also during a modal session. 141 | */ 142 | if (isRootItem.isValid() && !isRootItem.toBool()) { 143 | vkbPanel->setParentItem(quickItem->window()->contentItem()); 144 | vkbPanel->setProperty("__reparented", true); 145 | } 146 | } 147 | } 148 | } 149 | 150 | visibleConnection = QObject::connect(d->FocusItem, &QQuickItem::visibleChanged, this, [&](){ 151 | if(!d->FocusItem->isVisible()) 152 | hideInputPanel(); 153 | else 154 | showInputPanel(); 155 | }); 156 | 157 | emit inputItemChanged(); 158 | 159 | Qt::InputMethodHints InputMethodHints( 160 | d->FocusItem->inputMethodQuery(Qt::ImHints).toInt()); 161 | if (InputMethodHints & Qt::ImhDigitsOnly) { 162 | d->InputEngine->setInputMode(DeclarativeInputEngine::DigitsOnly); 163 | d->InputEngine->setSymbolMode(false); 164 | d->InputEngine->setUppercase(false); 165 | } else if (InputMethodHints & NumericInputHints) { 166 | d->InputEngine->setInputMode(DeclarativeInputEngine::Letters); 167 | d->InputEngine->setSymbolMode(true); 168 | d->InputEngine->setUppercase(false); 169 | } else { 170 | d->InputEngine->setInputMode(DeclarativeInputEngine::Letters); 171 | d->InputEngine->setSymbolMode(false); 172 | d->InputEngine->setUppercase(false); 173 | } 174 | 175 | QQuickItem *i = d->FocusItem; 176 | d->Flickable = 0; 177 | while (i) { 178 | QQuickFlickable *Flickable = dynamic_cast(i); 179 | if (Flickable) { 180 | d->Flickable = Flickable; 181 | } 182 | i = i->parentItem(); 183 | } 184 | 185 | ensureFocusedObjectVisible(); 186 | } 187 | 188 | void VirtualKeyboardInputContext::ensureFocusedObjectVisible() { 189 | if (!d->Visible || !d->Flickable || d->InputEngine->isAnimating()) { 190 | return; 191 | } 192 | 193 | QRectF FocusItemRect(0, 0, d->FocusItem->width(), d->FocusItem->height()); 194 | FocusItemRect = d->Flickable->mapRectFromItem(d->FocusItem, FocusItemRect); 195 | d->FlickableContentScrollAnimation->setTargetObject(d->Flickable); 196 | if (FocusItemRect.bottom() >= d->Flickable->height()) { 197 | auto ContentY = d->Flickable->contentY() + 198 | (FocusItemRect.bottom() - d->Flickable->height()) + 20; 199 | d->FlickableContentScrollAnimation->setEndValue(ContentY); 200 | d->FlickableContentScrollAnimation->start(); 201 | } else if (FocusItemRect.top() < 0) { 202 | auto ContentY = d->Flickable->contentY() + FocusItemRect.top() - 20; 203 | d->FlickableContentScrollAnimation->setEndValue(ContentY); 204 | d->FlickableContentScrollAnimation->start(); 205 | } 206 | } 207 | 208 | QObject *VirtualKeyboardInputContext::inputEngineProvider( 209 | QQmlEngine *engine, QJSEngine *scriptEngine) { 210 | Q_UNUSED(engine) 211 | Q_UNUSED(scriptEngine) 212 | return VirtualKeyboardInputContext::instance()->d->InputEngine; 213 | } 214 | 215 | QObject *VirtualKeyboardInputContext::inputPanelProvider( 216 | QQmlEngine *engine, QJSEngine *scriptEngine) { 217 | Q_UNUSED(engine) 218 | Q_UNUSED(scriptEngine) 219 | return VirtualKeyboardInputContext::instance()->d->inputPanelIface; 220 | } 221 | 222 | QObject *VirtualKeyboardInputContext::inputContextProvider( 223 | QQmlEngine *engine, QJSEngine *scriptEngine) { 224 | Q_UNUSED(engine) 225 | Q_UNUSED(scriptEngine) 226 | const auto instance=VirtualKeyboardInputContext::instance(); 227 | #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 228 | QQmlEngine::setObjectOwnership(instance, QQmlEngine::CppOwnership); 229 | #else 230 | QJSEngine::setObjectOwnership(instance,QJSEngine::CppOwnership); 231 | #endif 232 | return instance; 233 | } 234 | -------------------------------------------------------------------------------- /src/qml/SymbolLayout.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Layouts 1.12 3 | 4 | Item { 5 | property var inputPanel 6 | property bool secondPage 7 | 8 | onVisibleChanged: { 9 | if (!visible) 10 | secondPage = false; 11 | 12 | } 13 | 14 | ColumnLayout { 15 | id: page1 16 | 17 | anchors.fill: parent 18 | visible: !secondPage 19 | 20 | RowLayout { 21 | property real keyWeight: 160 22 | 23 | Key { 24 | btnKey: Qt.Key_1 25 | btnText: "1" 26 | inputPanelRef: inputPanel 27 | } 28 | 29 | Key { 30 | btnKey: Qt.Key_2 31 | btnText: "2" 32 | inputPanelRef: inputPanel 33 | } 34 | 35 | Key { 36 | btnKey: Qt.Key_3 37 | btnText: "3" 38 | inputPanelRef: inputPanel 39 | } 40 | 41 | Key { 42 | btnKey: Qt.Key_4 43 | btnText: "4" 44 | inputPanelRef: inputPanel 45 | } 46 | 47 | Key { 48 | btnKey: Qt.Key_5 49 | btnText: "5" 50 | inputPanelRef: inputPanel 51 | } 52 | 53 | Key { 54 | btnKey: Qt.Key_6 55 | btnText: "6" 56 | inputPanelRef: inputPanel 57 | } 58 | 59 | Key { 60 | btnKey: Qt.Key_7 61 | btnText: "7" 62 | inputPanelRef: inputPanel 63 | } 64 | 65 | Key { 66 | btnKey: Qt.Key_8 67 | btnText: "8" 68 | inputPanelRef: inputPanel 69 | } 70 | 71 | Key { 72 | btnKey: Qt.Key_9 73 | btnText: "9" 74 | inputPanelRef: inputPanel 75 | } 76 | 77 | Key { 78 | btnKey: Qt.Key_0 79 | btnText: "0" 80 | inputPanelRef: inputPanel 81 | } 82 | 83 | BackspaceKey { 84 | inputPanelRef: inputPanel 85 | } 86 | 87 | } 88 | 89 | RowLayout { 90 | property real keyWeight: 160 91 | 92 | Key { 93 | weight: 56 94 | functionKey: true 95 | showPreview: false 96 | btnBackground: "transparent" 97 | } 98 | 99 | Key { 100 | btnKey: Qt.Key_At 101 | btnText: "@" 102 | inputPanelRef: inputPanel 103 | } 104 | 105 | Key { 106 | btnKey: Qt.Key_NumberSign 107 | btnText: "#" 108 | inputPanelRef: inputPanel 109 | } 110 | 111 | Key { 112 | btnKey: Qt.Key_Percent 113 | btnText: "%" 114 | inputPanelRef: inputPanel 115 | } 116 | 117 | Key { 118 | btnKey: Qt.Key_Ampersand 119 | btnText: "&" 120 | inputPanelRef: inputPanel 121 | } 122 | 123 | Key { 124 | btnKey: Qt.Key_Asterisk 125 | btnText: "*" 126 | inputPanelRef: inputPanel 127 | } 128 | 129 | Key { 130 | btnKey: Qt.Key_Minus 131 | btnText: "-" 132 | inputPanelRef: inputPanel 133 | } 134 | 135 | Key { 136 | btnKey: Qt.Key_Plus 137 | btnText: "+" 138 | inputPanelRef: inputPanel 139 | } 140 | 141 | Key { 142 | btnKey: Qt.Key_ParenLeft 143 | btnText: "(" 144 | inputPanelRef: inputPanel 145 | } 146 | 147 | Key { 148 | btnKey: Qt.Key_ParenRight 149 | btnText: ")" 150 | inputPanelRef: inputPanel 151 | } 152 | 153 | EnterKey { 154 | weight: 283 155 | inputPanelRef: inputPanel 156 | } 157 | 158 | } 159 | 160 | RowLayout { 161 | property real keyWeight: 156 162 | 163 | Key { 164 | weight: 204 165 | btnDisplayedText: "1/2" 166 | showPreview: false 167 | functionKey: true 168 | onClicked: secondPage = !secondPage 169 | } 170 | 171 | Key { 172 | btnKey: Qt.Key_Exclam 173 | btnText: "!" 174 | alternativeKeys: "¡" 175 | inputPanelRef: inputPanel 176 | } 177 | 178 | Key { 179 | btnKey: Qt.Key_QuoteDbl 180 | btnText: '"' 181 | inputPanelRef: inputPanel 182 | } 183 | 184 | Key { 185 | btnKey: Qt.Key_Less 186 | btnText: "<" 187 | inputPanelRef: inputPanel 188 | } 189 | 190 | Key { 191 | btnKey: Qt.Key_Greater 192 | btnText: ">" 193 | inputPanelRef: inputPanel 194 | } 195 | 196 | Key { 197 | btnKey: Qt.Key_Apostrophe 198 | btnText: "'" 199 | inputPanelRef: inputPanel 200 | } 201 | 202 | Key { 203 | btnKey: Qt.Key_Colon 204 | btnText: ":" 205 | inputPanelRef: inputPanel 206 | } 207 | 208 | Key { 209 | btnKey: Qt.Key_Semicolon 210 | btnText: ";" 211 | inputPanelRef: inputPanel 212 | } 213 | 214 | Key { 215 | btnKey: Qt.Key_Slash 216 | btnText: "/" 217 | inputPanelRef: inputPanel 218 | } 219 | 220 | Key { 221 | btnKey: Qt.Key_Question 222 | btnText: "?" 223 | alternativeKeys: "¿" 224 | inputPanelRef: inputPanel 225 | } 226 | 227 | Key { 228 | weight: 204 229 | btnDisplayedText: "1/2" 230 | showPreview: false 231 | functionKey: true 232 | onClicked: secondPage = !secondPage 233 | } 234 | 235 | } 236 | 237 | RowLayout { 238 | property real keyWeight: 154 239 | 240 | SymbolKey { 241 | weight: 217 242 | } 243 | 244 | SpaceKey { 245 | weight: 1168 246 | inputPanelRef: inputPanel 247 | showLanguageDescription: false 248 | } 249 | 250 | Key { 251 | btnKey: Qt.Key_Period 252 | btnText: "." 253 | inputPanelRef: inputPanel 254 | } 255 | 256 | HideKey { 257 | weight: 205 258 | } 259 | 260 | } 261 | 262 | } 263 | 264 | ColumnLayout { 265 | id: page2 266 | 267 | anchors.fill: parent 268 | visible: secondPage 269 | 270 | RowLayout { 271 | property real keyWeight: 160 272 | 273 | Key { 274 | btnKey: Qt.Key_AsciiTilde 275 | btnText: "~" 276 | inputPanelRef: inputPanel 277 | } 278 | 279 | Key { 280 | btnKey: Qt.Key_Agrave 281 | btnText: "`" 282 | inputPanelRef: inputPanel 283 | } 284 | 285 | Key { 286 | btnKey: Qt.Key_Bar 287 | btnText: "|" 288 | inputPanelRef: inputPanel 289 | } 290 | 291 | Key { 292 | btnKey: Qt.Key_periodcentered 293 | btnText: "·" 294 | inputPanelRef: inputPanel 295 | } 296 | 297 | Key { 298 | btnKey: 8730 299 | btnText: "√" 300 | inputPanelRef: inputPanel 301 | } 302 | 303 | Key { 304 | btnKey: Qt.Key_division 305 | btnText: "÷" 306 | inputPanelRef: inputPanel 307 | } 308 | 309 | Key { 310 | btnKey: Qt.Key_multiply 311 | btnText: "×" 312 | inputPanelRef: inputPanel 313 | } 314 | 315 | Key { 316 | btnKey: Qt.Key_onehalf 317 | btnText: "½" 318 | alternativeKeys: "¼⅓¾⅞" 319 | inputPanelRef: inputPanel 320 | } 321 | 322 | Key { 323 | btnKey: Qt.Key_BraceLeft 324 | btnText: "{" 325 | inputPanelRef: inputPanel 326 | } 327 | 328 | Key { 329 | btnKey: Qt.Key_BraceRight 330 | btnText: "}" 331 | inputPanelRef: inputPanel 332 | } 333 | 334 | BackspaceKey { 335 | inputPanelRef: inputPanel 336 | } 337 | 338 | } 339 | 340 | RowLayout { 341 | property real keyWeight: 160 342 | 343 | Key { 344 | weight: 56 345 | functionKey: true 346 | showPreview: false 347 | btnBackground: "transparent" 348 | } 349 | 350 | Key { 351 | btnKey: Qt.Key_Dollar 352 | btnText: "$" 353 | inputPanelRef: inputPanel 354 | } 355 | 356 | Key { 357 | btnKey: 8364 358 | btnText: "€" 359 | inputPanelRef: inputPanel 360 | } 361 | 362 | Key { 363 | btnKey: 194 364 | btnText: "£" 365 | inputPanelRef: inputPanel 366 | } 367 | 368 | Key { 369 | btnKey: 162 370 | btnText: "¢" 371 | inputPanelRef: inputPanel 372 | } 373 | 374 | Key { 375 | btnKey: 165 376 | btnText: "¥" 377 | inputPanelRef: inputPanel 378 | } 379 | 380 | Key { 381 | btnKey: Qt.Key_Equal 382 | btnText: "=" 383 | inputPanelRef: inputPanel 384 | } 385 | 386 | Key { 387 | btnKey: Qt.Key_section 388 | btnText: "§" 389 | inputPanelRef: inputPanel 390 | } 391 | 392 | Key { 393 | btnKey: Qt.Key_BracketLeft 394 | btnText: "[" 395 | inputPanelRef: inputPanel 396 | } 397 | 398 | Key { 399 | btnKey: Qt.Key_BracketRight 400 | btnText: "]" 401 | inputPanelRef: inputPanel 402 | } 403 | 404 | EnterKey { 405 | weight: 283 406 | inputPanelRef: inputPanel 407 | } 408 | 409 | } 410 | 411 | RowLayout { 412 | property real keyWeight: 156 413 | 414 | Key { 415 | weight: 204 416 | btnDisplayedText: "2/2" 417 | showPreview: false 418 | functionKey: true 419 | onClicked: secondPage = !secondPage 420 | } 421 | 422 | Key { 423 | btnKey: Qt.Key_Underscore 424 | btnText: "_" 425 | inputPanelRef: inputPanel 426 | } 427 | 428 | Key { 429 | btnKey: 8482 430 | btnText: '™' 431 | inputPanelRef: inputPanel 432 | } 433 | 434 | Key { 435 | btnKey: 174 436 | btnText: '®' 437 | inputPanelRef: inputPanel 438 | } 439 | 440 | Key { 441 | btnKey: Qt.Key_guillemotleft 442 | btnText: '«' 443 | inputPanelRef: inputPanel 444 | } 445 | 446 | Key { 447 | btnKey: Qt.Key_guillemotright 448 | btnText: '»' 449 | inputPanelRef: inputPanel 450 | } 451 | 452 | Key { 453 | btnKey: 8220 454 | btnText: '“' 455 | inputPanelRef: inputPanel 456 | } 457 | 458 | Key { 459 | btnKey: 8221 460 | btnText: '”' 461 | inputPanelRef: inputPanel 462 | } 463 | 464 | Key { 465 | btnKey: Qt.Key_Backslash 466 | btnText: "\\" 467 | inputPanelRef: inputPanel 468 | } 469 | 470 | Key { 471 | btnKey: Qt.Key_AsciiCircum 472 | btnText: "^" 473 | inputPanelRef: inputPanel 474 | } 475 | 476 | Key { 477 | weight: 204 478 | btnDisplayedText: "2/2" 479 | showPreview: false 480 | functionKey: true 481 | onClicked: secondPage = !secondPage 482 | } 483 | 484 | } 485 | 486 | RowLayout { 487 | property real keyWeight: 154 488 | 489 | SymbolKey { 490 | weight: 217 491 | } 492 | 493 | SpaceKey { 494 | weight: 1168 495 | inputPanelRef: inputPanel 496 | showLanguageDescription: false 497 | } 498 | 499 | Key { 500 | btnKey: Qt.Key_Period 501 | btnText: "." 502 | inputPanelRef: inputPanel 503 | } 504 | 505 | HideKey { 506 | weight: 205 507 | } 508 | 509 | } 510 | 511 | } 512 | 513 | } 514 | --------------------------------------------------------------------------------