CN114020159A - Linux system kernel virtual keyboard customization method, device, equipment and medium - Google Patents

Linux system kernel virtual keyboard customization method, device, equipment and medium Download PDF

Info

Publication number
CN114020159A
CN114020159A CN202111134151.2A CN202111134151A CN114020159A CN 114020159 A CN114020159 A CN 114020159A CN 202111134151 A CN202111134151 A CN 202111134151A CN 114020159 A CN114020159 A CN 114020159A
Authority
CN
China
Prior art keywords
keyboard
virtual keyboard
kernel
kernel virtual
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111134151.2A
Other languages
Chinese (zh)
Inventor
钟瑞
严文魁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhixiang Information Technology Co ltd
Original Assignee
Beijing Zhixiang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhixiang Information Technology Co ltd filed Critical Beijing Zhixiang Information Technology Co ltd
Priority to CN202111134151.2A priority Critical patent/CN114020159A/en
Publication of CN114020159A publication Critical patent/CN114020159A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/0202Constructional details or processes of manufacture of the input device
    • G06F3/0219Special purpose keyboards
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method, a device, equipment and a medium for customizing a kernel virtual keyboard of a Linux system, wherein the method comprises the following steps: s1, newly adding keys with required number on the Input device, customizing corresponding key values for each key, and setting a keyboard name; s2, compiling the system to generate a standard KO file; and S3, when the equipment is started, registering the KO file on the system through the start script, and adding a kernel virtual keyboard with the keyboard name as the set keyboard name to the system. According to the method, the corresponding key values are customized and compiled into a standard KO file through newly adding keys on the Input equipment of the system, and then the KO file is registered on the system through the start script, so that the kernel virtual keyboard on the kernel can be obtained for the use of the Linux kernel.

Description

Linux system kernel virtual keyboard customization method, device, equipment and medium
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, equipment and a medium for customizing a kernel virtual keyboard of embedded equipment.
Background
Many application scenarios of many embedded devices require a key to trigger, such as playing a third-party application youtube on a voice device, when a user wakes up the system through voice, for example: "alexa, what's time", or "hours, now? "there is always remix at this time, and in order to solve the problem of remix, when waking up the system, it needs to send pause command to the keyboard in the Linux kernel, then to wayland (which is a simple" Display Server "), and finally to youtube, to pause the video playing. The voice device therefore needs to provide a keyboard that can be used by the Linux kernel.
However, many current embedded devices generally do not have a keyboard, and do not support a USB keyboard, or have a keyboard, but have too many or too few key values, thereby affecting the use efficiency or the convenience of use. Therefore, when a developer needs to use special customized special keys due to adding some special functions to a third-party application, for example, adding special keys such as play/use/forward/background/next/previous and the like to some third-party applications, a customized kernel virtual keyboard is needed.
The adc-keys are also a kernel virtual keyboard of the Linux system, but the coupling degree is too high due to the fact that the adc-keys are the kernel virtual keyboard special for a certain chip platform, so that the adc-keys are not beneficial to transplantation and have no universality. Therefore, a kernel virtual keyboard with strong universality is needed to improve the adaptability of the embedded device.
Disclosure of Invention
The invention aims to provide a method, a device, equipment and a medium for customizing a virtual keyboard, which realize the virtual keyboard for a kernel through simulation, are favorable for transplantation and have strong universality.
In a first aspect, the present invention provides a method for customizing a virtual keyboard of a Linux system kernel, comprising the following steps:
s1, newly adding keys with required number on the Input equipment, customizing corresponding key values for each key, and setting a keyboard name;
s2, compiling the system to generate a standard KO file;
and S3, when the equipment is started, registering the KO file on the system through the start script, and adding a kernel virtual keyboard with the keyboard name as the set keyboard name to the system.
In a second aspect, the present invention provides a device for customizing a virtual keyboard of a Linux system kernel, including:
the user-defined module is used for newly adding keys with required number on the Input equipment, defining corresponding key values for each key by user and setting keyboard names;
the compiling module is used for compiling the system to generate a standard KO file;
and the keyboard registration module registers the KO file on the system through the start script when the equipment is started, and the system has one more kernel virtual keyboard with the keyboard name set.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of the first aspect when executing the program.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages: the method includes the steps that a required number of keys are newly added through an Input device of the system, corresponding key values are defined for each key and compiled into a standard KO file, the KO file is registered on the system through a start script, and then the kernel virtual keyboard on the kernel can be obtained and can be used by a Linux kernel.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method according to one embodiment of the present invention;
FIG. 2 is a diagram illustrating test results according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an apparatus according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a third embodiment of the invention;
fig. 5 is a schematic structural diagram of a medium according to a fourth embodiment of the present invention.
Detailed Description
The embodiment of the application provides a method, a device, equipment and a medium for customizing a virtual keyboard, realizes the virtual keyboard for a kernel to use through simulation, is favorable for transplantation, and has strong universality.
The technical scheme in the embodiment of the application has the following general idea: and (3) newly adding a required number of keys through Input equipment of the system in an analog mode, customizing corresponding key values for the keys, compiling the keys into a standard KO file, and registering the KO file on the system through a start script to obtain the kernel virtual keyboard on the kernel, wherein the kernel virtual keyboard can be used by a Linux kernel. The kernel input method and the kernel input device solve the problem of kernel input of embedded equipment without a keyboard or with insufficient keys, are strong in universality and beneficial to transplantation because the kernel input method and the kernel input device are not a kernel virtual keyboard special for a certain chip platform.
Example one
As shown in fig. 1, the present embodiment provides a method for customizing a virtual keyboard of a Linux system kernel, including the following steps:
s1, newly adding keys with required number on the Input device, customizing corresponding key values for each key, and setting a keyboard name;
s2, compiling the system to generate a standard KO file;
and S3, when the equipment is started, registering the KO file on the system through the start script, and adding a kernel virtual keyboard with the keyboard name as the set keyboard name to the system.
When the kernel virtual keyboard is used, the system sends the key values of the corresponding keys to the kernel virtual keyboard in a command line mode, and then sends the key values to the corresponding application.
In order to check whether the key values sent to the kernel virtual keyboard are received by the kernel virtual keyboard, the key values can be checked through the weston log. The specific method comprises the following steps:
opening a weston log switch, and modifying a weston library method, mainly adding debugging codes, recompiling makeweston-rebuild under a wetston root directory, and adding two new read-write specific events on the just modified tape, such as: the newly added method of reading the designated event is M8_ read _ test.out, and the newly added method of writing the designated event is M8_ write _ test.out.
The specific testing steps are as follows:
KO files are registered in a kernel through an insmod instruction, wherein zeasn _ keyboard.ko is a file name, and system/lib/modules/are paths where the KO files are located.
(vii) insmod/system/lib/modules/zeasn _ keyboard.ko pulls up ko;
look through cat/pro.
cat/proc/bus/input/devices;
One can see the following print, illustrating virtual _ kb and run:
I:Bus=0000Vendor=0000Product=0000Version=0000
N:Name="zeasn_virtual_kb"
P:Phys=
S:Sysfs=/devices/virtual/input/input5
U:Uniq=
H:Handlers=kbdevent5cpufreqdmcfreq
B:PROP=0
B:EV=3
B:KEY=100000000000000
view weston. log # tail-f/userdata/weston. log
OUt5 lets event5 in read state #./M8_ read _ test
Out5116 writes a key to event5, where "116" is the key value.
As can be seen from fig. 2: the system sends the key values of the corresponding keys to the kernel virtual keyboard in a command line mode, and weston can read the key values.
Based on the same inventive concept, the application also provides a device corresponding to the method in the first embodiment, which is detailed in the second embodiment.
Example two
As shown in fig. 3, in this embodiment, there is provided a customization apparatus for a virtual keyboard of a Linux system kernel, including:
the user-defined module is used for newly adding keys with required number on the Input equipment, defining corresponding key values for each key by user and setting keyboard names;
the compiling module is used for compiling the system to generate a standard KO file;
and the keyboard registration module registers the KO file on the system through the start script when the equipment is started, and the system has one more kernel virtual keyboard with the keyboard name set.
And after receiving the key value, the kernel virtual keyboard forwards the key value to the corresponding application, wherein the key value is sent in a command line form.
Since the apparatus described in the second embodiment of the present invention is an apparatus used for implementing the method of the first embodiment of the present invention, based on the method described in the first embodiment of the present invention, a person skilled in the art can understand the specific structure and the deformation of the apparatus, and thus the details are not described herein. All the devices adopted in the method of the first embodiment of the present invention belong to the protection scope of the present invention.
Based on the same inventive concept, the application provides an electronic device embodiment corresponding to the first embodiment, which is detailed in the third embodiment.
EXAMPLE III
The embodiment provides an electronic device, as shown in fig. 4, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any one of the first embodiment modes may be implemented.
Since the electronic device described in this embodiment is a device used for implementing the method in the first embodiment of the present application, based on the method described in the first embodiment of the present application, a specific implementation of the electronic device in this embodiment and various variations thereof can be understood by those skilled in the art, and therefore, how to implement the method in the first embodiment of the present application by the electronic device is not described in detail herein. The equipment used by those skilled in the art to implement the methods in the embodiments of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium, as shown in fig. 5, on which a computer program is stored, and when the computer program is executed by a processor, any one of the embodiments can be implemented.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages: the kernel virtual keyboard on the kernel can be obtained and used by a Linux kernel, and the kernel virtual keyboard is not a kernel virtual keyboard special for a certain chip platform, so that the universality is strong, and the transplantation is facilitated.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus or system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (6)

1. A method for customizing a kernel virtual keyboard of a Linux system is characterized by comprising the following steps: the method comprises the following steps:
s1, newly adding keys with required number on the Input device, customizing corresponding key values for each key, and setting a keyboard name;
s2, compiling the system to generate a standard KO file;
and S3, when the equipment is started, registering the KO file on the system through the start script, and adding a kernel virtual keyboard with the keyboard name as the set keyboard name to the system.
2. The customization method of the Linux system kernel virtual keyboard according to claim 1, wherein: when the kernel virtual keyboard is used, the system sends the key values of the corresponding keys to the kernel virtual keyboard in a command line mode, and then sends the key values to the corresponding application.
3. A Linux system kernel virtual keyboard customization device is characterized in that: the method comprises the following steps:
the user-defined module is used for newly adding keys with required number on the Input equipment, defining corresponding key values for each key by user and setting keyboard names;
the compiling module is used for compiling the system to generate a standard KO file;
and the keyboard registration module registers the KO file on the system through the start script when the equipment is started, and the system has one more kernel virtual keyboard with the keyboard name set.
4. The apparatus of claim 3, wherein the apparatus for customizing the virtual keyboard of the Linux system kernel comprises: and after receiving the key value, the kernel virtual keyboard forwards the key value to the corresponding application, wherein the key value is sent in a command line form.
5. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to claim 1 or 2 when executing the program.
6. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of claim 1 or 2.
CN202111134151.2A 2021-09-27 2021-09-27 Linux system kernel virtual keyboard customization method, device, equipment and medium Pending CN114020159A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111134151.2A CN114020159A (en) 2021-09-27 2021-09-27 Linux system kernel virtual keyboard customization method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111134151.2A CN114020159A (en) 2021-09-27 2021-09-27 Linux system kernel virtual keyboard customization method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114020159A true CN114020159A (en) 2022-02-08

Family

ID=80055000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111134151.2A Pending CN114020159A (en) 2021-09-27 2021-09-27 Linux system kernel virtual keyboard customization method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114020159A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870316A (en) * 2014-04-11 2014-06-18 烽火通信科技股份有限公司 JAVA virtual machine implementation method for intelligent operating system
CN106293756A (en) * 2016-08-16 2017-01-04 汉柏科技有限公司 A kind of for quick-replaceable self-defined linux kernel system
CN106341777A (en) * 2016-08-11 2017-01-18 深圳创维-Rgb电子有限公司 USB virtual device creation method, device and system
CN109142868A (en) * 2018-08-10 2019-01-04 上海电机学院 Electric harmonic detector

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870316A (en) * 2014-04-11 2014-06-18 烽火通信科技股份有限公司 JAVA virtual machine implementation method for intelligent operating system
CN106341777A (en) * 2016-08-11 2017-01-18 深圳创维-Rgb电子有限公司 USB virtual device creation method, device and system
CN106293756A (en) * 2016-08-16 2017-01-04 汉柏科技有限公司 A kind of for quick-replaceable self-defined linux kernel system
CN109142868A (en) * 2018-08-10 2019-01-04 上海电机学院 Electric harmonic detector

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
UNI-少林寺武功: "适配自定义按键", Retrieved from the Internet <URL:https://blog.csdn.net/yikunbai5708/article/details/103842904> *
宇宙的蚂蚁: "雷柏无线键盘linux驱动程序,虚拟键盘驱动程序", Retrieved from the Internet <URL:https://blog.csdn.net/weixin_29775447/article/details/116777445> *

Similar Documents

Publication Publication Date Title
CN106970873B (en) On-line mock testing method, device and system
US8627296B1 (en) Unified unit and integration test with automatic mock creation
US20100115496A1 (en) Filter generation for load testing managed environments
US20110154299A1 (en) Apparatus and method for executing instrumentation code
US10095611B1 (en) Methodology for unit test and regression framework
US20110154110A1 (en) Verifying a Register-Transfer Level Design of an Execution Unit
CN112667315A (en) Game engine editor starting method and device, electronic equipment and storage medium
CN111111201A (en) Skill creating method, skill creating device, skill creating server and skill creating medium based on game
CN112650658A (en) Application program exception recording and reproduction method, device and storage medium
CN105512031A (en) Mobile terminal and automatic test method
CN110908880A (en) Embedded point code injection method, event reporting method and related equipment thereof
CN109284222B (en) Software unit, project testing method, device and equipment in data processing system
CN112947907B (en) Method for creating code branches
CN111538659B (en) Interface testing method, system, electronic equipment and storage medium of business scene
CN111176663B (en) Data processing method, device, equipment and storage medium of application program
CN115656788B (en) Chip testing system, method, equipment and storage medium
US20230101154A1 (en) Resumable instruction generation
CN114020159A (en) Linux system kernel virtual keyboard customization method, device, equipment and medium
CN112069158A (en) Data restoration method, device, equipment and storage medium
CN111399926A (en) Method and device for downloading starting program
CN111459547B (en) Method and device for displaying function call link
CN110096888B (en) Method and system for accelerating verification and analyzing SMM potential safety hazard
CN113672465A (en) Method, system, medium, terminal and unmanned aerial vehicle for generating process log system by process name
CN116431518B (en) Multi-level and multi-mode software fault injection method based on simulation platform
CN115470151B (en) Application operation analysis method, computing device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination