Customizable virtual keyboard based on QT framework and use method thereof
Through a customizable virtual keyboard based on the QT framework, the problem of missing input methods and splitting user experience in embedded systems is solved, plug-and-play and customization functions are realized, adapted to multiple operating systems, and the scalability and user experience of input methods are improved.
Patent Information
- Application Number
- CN202510231718.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-07-29
AI Technical Summary
The existing input method framework cannot come with its own input method in embedded systems, which leads to inconvenience of user input Chinese when there is no external keyboard. The virtual keyboard solutions of different operating systems divide the user experience and lack scalability and customization functions.
Design a customizable virtual keyboard based on the QT framework, including relay modules, numeric keyboard components and full keyboard components, which can be used by modifying system variables, supports custom keyboard layout and input modes, and is suitable for any operating system and compiler version.
It realizes plug-and-play, reduces development difficulty, provides high-performance and flexible customization functions, adapts to different operating systems and compilers, and improves user experience.
Smart Images

Figure CN120386458A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and particularly to a customizable virtual keyboard based on the QT framework and a method for using the same. Background Art
[0002] At present, Fcitx and IBus are two commonly used input method frameworks (input method engines) for providing input method support on Linux systems and other Unix-like systems. Fcitx is a flexible and lightweight input method framework designed for Chinese and multilingual input, with high scalability and performance. Users can implement various input method solutions through plugins, and it is compatible with multiple desktop environments, with simple configuration and smooth experience. IBus is another input method framework. It adopts a modular design to provide stable and feature-rich input method support. In particular, it is closely integrated with the GNOME desktop environment and has become one of the default choices for mainstream Linux distributions. Both can meet the input method requirements, but they have different emphases in architecture and usage environment.
[0003] In terms of technical architecture, Fcitx uses the C++ programming language and adopts a plugin-based architecture. Its advantage lies in its scalability, which allows for the convenient addition or replacement of input method engines. Users can install different input method engines according to their needs. IBus is mainly written in the C language. The C language is used to build the core part of the input method framework, including key functions such as handling input events and interacting with the operating system. The code written in C language can make full use of system resources to ensure that IBus can operate efficiently in various different hardware environments. In terms of implementation methods, Fcitx implements an input method framework. Users need to configure the input method engines, input methods, etc. they need to use by themselves, and different versions of the Fcitx framework are required for support according to different program versions. Its scalability, portability, and compatibility are poor. IBus also implements an input method framework and needs to configure the input method engines, input methods, etc. it needs to use by itself, with weak scalability. In terms of scalability, Fcitx and IBus have fixed code versions, can only be configured, and have weak scalability. Other input methods can be selected online and imported into the framework for use, but advanced functions such as custom keyboard layouts cannot be achieved.
[0004] Embedded systems generally do not come with an input method framework by default, which may cause inconvenience when users need to input Chinese and there is no external keyboard. In addition, today's operating system versions are complex, and each desktop operating system has its own set of virtual keyboard solutions, resulting in a fragmented user experience. Therefore, there is an urgent need to develop a customizable virtual keyboard based on the QT framework and a method for using the same to solve the above technical problems.
[0005] In view of this, the present invention is hereby provided. Summary of the Invention
[0006] The object of the present invention is to provide a customizable virtual keyboard based on the QT framework and its usage method, which significantly reduces the usage difficulty for developers. After installation, no user configuration is required. It can be used after modifying the environment variables. By recompiling the source code, it can be adapted to any operating system and compiler version. Any desired custom functions can be achieved by modifying the source code, having broad application prospects and being conducive to popularization and application.
[0007] To achieve the above object, a customizable virtual keyboard based on the QT framework provided by the present invention includes a relay module, a numeric keypad component, a full keyboard component, and other keyboards customized by developers. The relay module is respectively connected forwardly to the numeric keypad component, the full keyboard component, and other keyboards customized by developers. The relay module determines the type of keyboard to be used according to the attributes of the currently focused component. When in use, the user clicks on the input component to call the virtual keyboard, and the virtual keyboard outputs the corresponding content into the component.
[0008] The present invention also provides a usage method for the above-mentioned customizable virtual keyboard based on the QT framework, including the following steps: S1: Set the virtual keyboard as the system input method preference through system variables; The user defines the QT_IM_MODULE environment variable as virtualkeyboardx, where virtualkeyboardx is the name used by this virtual keyboard software, and sets the input method within the QT program to this virtual keyboard software to use this virtual keyboard within the QT program; S2: Virtual keyboard call; When the user clicks on the component that needs to use keyboard input within the QT program, the QT program will call this virtual keyboard software as the default input method, call the dynamic library file libplugin.so generated after compiling this virtual keyboard software, and display the virtual keyboard interface in the middle position below the device screen. When the user clicks on the uppermost area of the keyboard to drag the keyboard, when the keyboard is called, it will determine which keyboard to call according to the attributes of the component that currently requires keyboard input; S3: User input; The user performs corresponding input operations by clicking on the buttons inside the virtual keyboard. When the input mode is English, numeric, or symbol, the content will be directly input into the currently focused component; when the input mode is Chinese, the content input by the user will be placed in the buffer inside the keyboard. The virtual keyboard will match the appropriate words from the Google Pinyin dictionary based on the content in the buffer and display them in the candidate area for the user to select. After the user selects, the buffer will be cleared, and the content selected by the user will be input into the component.
[0009] Preferably, in S2, the components that require keyboard input include a single-line text input box or a multi-line text input box.
[0010] Preferably, in S2, whether the display position of the keyboard can be dragged is configurable.
[0011] Preferably, in S2, when the component defines the IM_DigitsOnly property that restricts input to only numbers, the virtual keyboard software will adaptively call the numeric keypad for input operations. In theory, any property can be used as the criterion for triggering the keyboard, which can be implemented within the source code of the virtual keyboard software.
[0012] A customizable virtual keyboard based on the QT framework and its usage method provided by the present invention have the following beneficial effects.
[0013] 1. High performance and resource optimization: QT provides efficient low-level access, enabling better handling of complex graphics and high-performance rendering. It is suitable for applications that require real-time performance and reduces resource consumption during application runtime. Lower learning curve: For developers with existing C++ or QML experience, using QT allows for faster getting started and shorter development cycles. Flexible signal-slot mechanism: The signal-slot mechanism of QT provides flexibility for complex user interactions, reduces coding complexity, and improves event handling efficiency.
[0014] 2. The present invention significantly reduces the usage difficulty for developers, achieving plug-and-play functionality. It can be removed at any time if not needed; after installation, no additional configuration is required, and it can be run simply by temporarily modifying the system variables. It has weak system invasiveness and does not modify any system files.
[0015] 3. The present invention can achieve any desired custom functions by modifying the source code, including new keyboard layouts, new key presets, and all functions that can be implemented through the QT framework. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a structural block diagram of a customizable virtual keyboard based on the QT framework provided by the present invention; Figure 2 It is a system call flowchart of a customizable virtual keyboard based on the QT framework provided by the present invention; Figure 3 It is a user usage flowchart of a customizable virtual keyboard based on the QT framework provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] The following further describes the present invention in conjunction with specific embodiments and the accompanying drawings to facilitate understanding of the content of the present invention.
[0018] As shown Figure 1 in the figure, it is a structural block diagram of a customizable virtual keyboard based on the QT framework provided by the present invention. The customizable virtual keyboard based on the QT framework includes a relay module, a numeric keypad component, a full keyboard component, and other keyboards customized by developers. The relay module is respectively connected forwardly to the numeric keypad component, the full keyboard component, and other keyboards customized by developers. The relay module determines the type of keyboard to be used according to the attributes of the currently focused component. When in use, the user clicks on the input component to call the virtual keyboard, and the virtual keyboard outputs the corresponding content to the component.
[0019] As shown Figures 2 - 3 in the figure are respectively the system call flow chart and the user usage flow chart of a customizable virtual keyboard based on the QT framework provided by the present invention. The usage method of the customizable virtual keyboard based on the QT framework includes the following steps: S1: Set the virtual keyboard as the system input method preference through system variables; The user defines the QT_IM_MODULE environment variable as virtualkeyboardx, where virtualkeyboardx is the name used by this virtual keyboard software, and sets the input method within the QT program to this virtual keyboard software to use this virtual keyboard within the QT program.
[0020] S2: Virtual keyboard call; As shown Figure 3 in the figure is the virtual keyboard call flow chart.
[0021] When the user clicks on the component that needs to use keyboard input within the QT program, the QT program will call this virtual keyboard software as the default input method, call the dynamic library file libplugin.so generated after compiling this virtual keyboard software, and display the virtual keyboard interface in the middle position below the device screen. The user clicks on the topmost area of the keyboard to drag the keyboard, and whether the keyboard display position can be dragged is configurable. When the keyboard is called, it will determine which keyboard to call according to the attributes of the component that currently needs keyboard input. When the component defines the IM_DigitsOnly attribute that restricts input to only numbers, the virtual keyboard software will adaptively call the numeric keypad for input operations. In theory, any attribute can be used as the determination for triggering the keyboard, which can be implemented within the source code of the virtual keyboard software. Among them, the components that need to use keyboard input include single-line text input boxes or multi-line text input boxes.
[0022] S3: User input; The user performs corresponding input operations by clicking the buttons inside the virtual keyboard. When the input mode is English, numbers, or symbols, the content will be directly input into the currently focused component. When the input mode is Chinese, the content input by the user will be placed in the buffer inside the keyboard. The virtual keyboard will match appropriate words from the Google Pinyin dictionary based on the content in the buffer and display them in the candidate area for the user to select. After the user makes a selection, the buffer will be cleared, and the content selected by the user will be input into the component.
[0023] The present invention realizes customization and can be highly customized. Different keyboard layouts and buttons can be customized according to the needs of the program, achieving a rich variety of keyboard types and facilitating users to quickly input content when using touchscreen devices. The user habits and input requirements of different programs vary. The present invention can be further modified by developers on the source code to achieve more diverse keyboard styles, ensuring the best input experience for users. The lightweight and easy-to-install features of the present invention perfectly meet the needs of virtual keyboards in embedded systems, providing an input solution for embedded systems. The present invention has strong portability and can be used in any operating system with a Linux kernel, and is easy to use and can be used as a general solution.
[0024] The present invention is developed using the C++ language, providing high-performance low-level access and being suitable for applications that require high-performance rendering and complex graphics processing. The QT framework implements event handling through the signal and slot mechanism, which provides flexible support for asynchronous operations and is suitable for complex user interactions. The present invention implements a virtual soft keyboard that can be used without any configuration by the user after modifying the environment variables. The present invention can be adapted to any operating system and compiler version by recompiling the source code; modify the source code to implement any desired custom functions, including new keyboard layouts, new key presets, and all functions that can be implemented through the QT framework.
[0025] Specific examples are applied in this article to elaborate on the inventive concept in detail. The description of the above embodiments is only used to help understand the core idea of the present invention. It should be noted that for those of ordinary skill in the art of this technology, any obvious modifications, equivalent replacements, or other improvements made without departing from the inventive concept shall be included within the protection scope of the present invention.
Claims
1. A customizable virtual keyboard based on the QT framework, characterized in that, It includes a relay module, a numeric keypad component, a full keyboard component, and other keyboards customized by developers. The relay module is respectively connected forwardly to the numeric keypad component, the full keyboard component, and other keyboards customized by developers. The relay module determines the type of keyboard to be used according to the attributes of the currently focused component. When in use, the user clicks on the input component to invoke the virtual keyboard, and the virtual keyboard outputs the corresponding content into the component.
2. A method for using a customizable virtual keyboard based on the QT framework according to claim 1, characterized in that, It includes the following steps: S1: Set the virtual keyboard as the system input method preference through system variables; The user defines the QT_IM_MODULE environment variable as virtualkeyboardx, where virtualkeyboardx is the name used by this virtual keyboard software, and sets the input method within the QT program to this virtual keyboard software to use this virtual keyboard within the QT program. S2: Invoke the virtual keyboard; When the user clicks on the component that requires keyboard input within the QT program, the QT program will invoke this virtual keyboard software as the default input method, call the dynamic library file libplugin.so generated after compiling this virtual keyboard software, and display the virtual keyboard interface in the middle position below the device screen. When the user clicks on the topmost area of the keyboard to drag the keyboard, when the keyboard is invoked, it will determine which keyboard to invoke according to the attributes of the component that currently requires keyboard input. S3: User input; The user performs corresponding input operations by clicking on the buttons inside the virtual keyboard. When the input mode is English, numbers, or symbols, the content will be directly input into the currently focused component; when the input mode is Chinese, the content input by the user will be placed in the buffer inside the keyboard. The virtual keyboard will match the appropriate words from the Google Pinyin dictionary according to the content in the buffer and display them in the candidate area for the user to select. After the user selects, the buffer will be cleared, and the content selected by the user will be input into the component.
3. The usage method of a customizable virtual keyboard based on the QT framework according to claim 2, characterized in that, In S2, the components that require keyboard input include single-line text input boxes or multi-line text input boxes.
4. The usage method of a customizable virtual keyboard based on the QT framework according to claim 3, characterized in that, In S2, whether the display position of the keyboard can be dragged is configurable.
5. The usage method of a customizable virtual keyboard based on the QT framework according to claim 4, characterized in that In S2, when the component defines the IM_DigitsOnly property that restricts input to only numbers, the virtual keyboard software will adaptively invoke the numeric keypad for input operations. In theory, any property can be used as the determination for triggering the keyboard, which can be implemented within the source code of the virtual keyboard software.