Keyboard key detection method and device and computer storage medium

Through infrared keyboard design, the infrared light network and light-shading column are used to detect the button depth, which solves the problem that existing keyboard key detection cannot perceive depth changes and high cost, and achieves accurate button depth detection and reduces hardware costs.

CN120335622APending Publication Date: 2025-07-18SHENZHEN TIMELINK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510392618.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The existing keyboard key detection methods cannot sense the depth change information of the keys during pressing, and the cost is high, and the photoelectric components are susceptible to mechanical impact and vibration to affect their life.

Method used

An infrared keyboard design is adopted. An infrared light network is formed by setting an infrared transmitter and receiving tube around the keyboard, and a light-shading column is set at the bottom of the key to detect changes in infrared light signal intensity to determine the depth of the key. The target key is identified by the shading column invading the shading path formed by the infrared light network.

Benefits of technology

It realizes accurate detection of the depth of key pressing, meets personalized needs, reduces the number of components and hardware costs, and improves the service life of the keyboard.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335622A_ABST
    Figure CN120335622A_ABST
Patent Text Reader

Abstract

The invention discloses a keyboard key detection method and device and a computer storage medium, and relates to the technical field of input device.The method comprises the steps that the signal intensity value of infrared light received by an infrared receiving tube is detected; when the signal intensity value is lower than a preset threshold value, the shielded infrared light is identified, and a shielded light path combination is generated; determining a triggered target key based on the shielding light path combination; and calculating the stroke depth of the target key according to the signal intensity change value of the shielding light path combination. The infrared transmitting tubes and the infrared receiving tubes are arranged on the periphery of the keyboard to form the infrared light net, the shading cylinders are arranged at the bottoms of the keys, the triggered target key is determined by utilizing the shading light path combination formed when the shading cylinders invade the infrared light net, and meanwhile the target key is triggered according to the signal intensity change value of the shading light path combination. Accurate detection of the press depth of the key is realized, and individual requirements of different users on the key are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of input devices, and in particular to a method, device, and computer storage medium for detecting keyboard keys. Background Art

[0002] Currently, keyboard key detection is mainly implemented by mechanical switches, thin-film circuits, or infrared pairs of tubes. However, these methods can only trigger signals when the keys are fully pressed and only provide a binary state of "pressed" or "not pressed", and cannot sense the information on the key depth change during the key pressing process. If optical detection or pressure sensing is used to detect the key depth, independent optoelectronic components need to be installed under each key, resulting in a linear increase in the number of required components with the number of keys. At the same time, since the optoelectronic components are directly installed under the key moving parts, during daily use, the mechanical impact and continuous vibration of the keys will directly act on these optoelectronic components, easily causing performance degradation or even failure of the optoelectronic components, thereby affecting the service life of the keyboard. Summary of the Invention

[0003] The main purpose of this application is to provide a method, device, and computer storage medium for detecting keyboard keys, aiming to solve the technical problem of the too high cost of keyboard key depth detection.

[0004] To achieve the above objective, an embodiment of this application provides a method for detecting keyboard keys, which is applied to an infrared keyboard. The infrared keyboard includes a keyboard operation area, and at least one set of opposite sides around the keyboard operation area is provided with an infrared array. The infrared array includes multiple groups of infrared emitting tubes and infrared receiving tubes, and each group of the infrared emitting tubes and the infrared receiving tubes are arranged opposite to each other, forming an infrared light network composed of multiple intersecting infrared light rays in the keyboard operation area. A key is provided in the keyboard operation area, and a light-shielding column that can move vertically with the key movement is fixedly arranged at the bottom position of the key. The light-shielding column is located at a preset distance above the infrared light network in the initial state. The method for detecting keyboard keys includes: Detecting the signal intensity value of the infrared light received by the infrared receiving tube; When the signal intensity value is lower than a preset threshold, identifying the blocked infrared light rays and generating a blocked light path combination; Based on the blocked light path combination, determining the triggered target key; Calculating the travel depth of the target key according to the signal intensity change value of the blocked light path combination.

[0005] In an embodiment, the step of when the signal intensity value is lower than a preset threshold, identifying the blocked infrared light rays and generating a blocked light path combination includes: Obtain the signal intensity values of all the infrared rays currently, and filter out the infrared rays whose signal intensity values are lower than a preset threshold to obtain the blocked infrared rays; Determine the sequence numbers of the blocked infrared rays according to a preset infrared ray numbering rule; Combine the sequence numbers of the blocked infrared rays within the same time window to form a blocked optical path combination.

[0006] In one embodiment, the step of determining the triggered target key based on the blocked optical path combination includes: Query a preset key mapping table, which stores the corresponding relationships between each key and the blocked optical path combination; Match the blocked optical path combination with the key mapping table to determine the triggered target key.

[0007] In one embodiment, the step of matching the blocked optical path combination with the key mapping table to determine the triggered target key includes: When there is no single target key that exactly matches the blocked optical path combination in the key mapping table, find all candidate keys in the key mapping table that have a partial match with the blocked optical path combination; According to the preset blocked optical path combinations corresponding to the candidate keys, determine whether there is a key combination such that after the preset blocked optical path combinations corresponding to the key combination are combined, they exactly match the blocked optical path combination; If there is, determine the key combination as the triggered target key.

[0008] In one embodiment, the step of if there is, determining the key combination as the triggered target key includes: Calculate the occlusion priority of each key in the key combination according to the number of blocked infrared rays in the preset blocked optical path combinations corresponding to each key in the key combination; Determine the trigger order of each key in the key combination in descending order of the occlusion priority; Wherein, the calculation method of the occlusion priority is: the ratio of the number of actually blocked infrared rays in the preset blocked optical path combination corresponding to the key to the total number of infrared rays in the preset blocked optical path combination.

[0009] In one embodiment, the step of calculating the travel depth of the target key according to the signal intensity change value of the blocked optical path combination includes: Obtain the initial signal intensity value and the current signal intensity value of each infrared ray in the blocked optical path combination; Calculate the signal intensity change value of each infrared ray, where the signal intensity change value is the difference between the initial signal intensity value and the current signal intensity value; Determine the travel depth of the target key according to the mapping relationship between the signal intensity change value and the preset travel depth.

[0010] In one embodiment, after the step of calculating the travel depth of the target key according to the signal intensity change value of the occluded optical path combination, the method further includes: When it is detected that the travel depth of the target key reaches a preset trigger threshold, generate a corresponding key trigger signal; Adjust the trigger sensitivity of the key trigger signal according to the change rate of the travel depth; Among them, the adjustment method of the trigger sensitivity is: when it is detected that the change rate of the travel depth exceeds the first rate threshold, lower the trigger threshold; When it is detected that the change rate of the travel depth is lower than the second rate threshold, increase the trigger threshold.

[0011] In one embodiment, after the step of generating a corresponding key trigger signal when it is detected that the travel depth of the target key reaches a preset trigger threshold, the method further includes: Detect the signal intensity change of the infrared rays in the adjacent area of the target key; When there is an accompanying signal change in the adjacent area, determine whether it is a misoperation; If it is confirmed as a misoperation, suppress the signal output in the adjacent area of the target key.

[0012] An embodiment of the present application further provides a keyboard key detection device, where the keyboard key detection device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the keyboard key detection method as described above.

[0013] An embodiment of the present application further provides a computer storage medium, where the computer storage medium is a computer-readable storage medium, and a computer program is stored on the computer storage medium, and when the computer program is executed by a processor, the steps of the keyboard key detection method as described above are implemented.

[0014] An embodiment of the present application discloses a method for detecting keyboard keys. The method includes detecting the signal intensity value of the infrared light received by the infrared receiving tube; when the signal intensity value is lower than a preset threshold, identifying the blocked infrared light to generate a blocked light path combination; determining the target key triggered based on the blocked light path combination; and calculating the travel depth of the target key according to the signal intensity change value of the blocked light path combination. By arranging infrared transmitting tubes and receiving tubes around the keyboard to form an infrared light network and arranging light-blocking cylinders at the bottom of the keys, the present application determines the triggered target key using the blocked light path combination formed when the light-blocking cylinders invade the infrared light network. At the same time, according to the signal intensity change value of the blocked light path combination, accurate detection of the key pressing depth is achieved, meeting the personalized needs of different users for keys. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 FIG. 6 is a flowchart of the first embodiment of the keyboard key detection method according to the embodiment of the present application; Figure 2A FIG. 9 is a layout diagram of the infrared transmitting tube and the infrared receiving tube in the first embodiment of the keyboard key detection method according to the embodiment of the present application; Figure 2B FIG. 12 is a schematic diagram of the infrared light network in the first embodiment of the keyboard key detection method according to the embodiment of the present application; Figure 3 FIG. 15 is a flowchart of the second embodiment of the keyboard key detection method according to the embodiment of the present application; Figure 4 FIG. 18 is a flowchart of the third embodiment of the keyboard key detection method according to the embodiment of the present application; Figure 5A FIG. 21 is a schematic diagram of the blocked infrared light network when a key is pressed in the third embodiment of the keyboard key detection method according to the embodiment of the present application; Figure 5B FIG. 24 is a schematic diagram of the blocked infrared light network when two keys are pressed in the third embodiment of the keyboard key detection method according to the embodiment of the present application; Figure 6 FIG. 27 is a flowchart of the fourth embodiment of the keyboard key detection method according to the embodiment of the present application; Figure 7 FIG. 30 is a flowchart of the fifth embodiment of the keyboard key detection method according to the embodiment of the present application; Figure 8 FIG. 33 is a structural diagram of the keyboard key detection device according to the embodiment of the present application.

[0016] The implementation, functional features, and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0017] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0018] Currently, keyboard key detection is mainly implemented by means of mechanical switches, thin-film circuits, or infrared pairs of tubes, etc. However, these methods can only trigger signals when the keys are fully pressed, and only provide binary states of "pressed" or "not pressed", and cannot sense the change information of the key depth during the key pressing process. If optical detection or pressure sensing is used to detect the key depth, independent optoelectronic components need to be installed under each key, resulting in a linear increase in the number of required components with the number of keys. At the same time, since the optoelectronic components are directly installed under the key moving parts, during daily use, the mechanical impact and continuous vibration of the keys will directly act on these optoelectronic components, easily causing performance degradation or even failure of the optoelectronic components, thus affecting the service life of the keyboard.

[0019] To solve the above-mentioned defects existing in the related art, an embodiment of the present application proposes a keyboard key detection method. This method detects the signal intensity value of the infrared light received by the infrared receiving tube; when the signal intensity value is lower than a preset threshold, it identifies the blocked infrared light and generates a blocked light path combination; based on the blocked light path combination, it determines the triggered target key; and calculates the travel depth of the target key according to the signal intensity change value of the blocked light path combination. The present application forms an infrared light network by setting infrared emitting tubes and receiving tubes around the keyboard, and sets light-shielding columns at the bottom of the keys. By using the blocked light path combination formed when the light-shielding columns invade the infrared light network, it determines the triggered target key, and at the same time, according to the signal intensity change value of the blocked light path combination, it realizes accurate detection of the key pressing depth and meets the personalized needs of different users for the keys.

[0020] It should be noted that the execution subject of this embodiment can be a keyboard key detection system, or an input device with functions such as infrared signal acquisition, data processing, network communication, and program operation, such as a keyboard, a game controller, etc., or a keyboard key detection device capable of implementing the above functions. Hereinafter, taking the keyboard key detection system as an example (hereinafter referred to as the "system"), this embodiment and the following embodiments will be described. The keyboard key detection system can be integrated inside the keyboard body, or can be used as an independent external processing unit, and performs data interaction with the keyboard optical sensor module in a wired or wireless manner. In practical applications, the specific implementation form of the keyboard key detection system can be adapted and adjusted according to the product form and functional requirements, but all should include the core technical features described in the present application.

[0021] The keyboard key detection method of the first embodiment proposed in this application is applied to an infrared keyboard. The infrared keyboard includes a keyboard operation area, and at least one set of opposite sides around the keyboard operation area is provided with an infrared array. The infrared array includes multiple groups of infrared emitting tubes and infrared receiving tubes. Each group of the infrared emitting tubes and the infrared receiving tubes are arranged opposite to each other to form an infrared light network composed of multiple intersecting infrared light rays in the keyboard operation area. A key is provided in the keyboard operation area, and a light-shielding column that can move vertically with the key action is fixedly arranged at the bottom position of the key. The light-shielding column is located at a preset distance above the infrared light network in the initial state. Please refer to Figure 1 , and this method includes steps S10 to S40: Step S10: Detect the signal intensity value of the infrared light received by the infrared receiving tube.

[0022] In this embodiment, by providing an infrared array on at least one set of opposite sides around the keyboard operation area, such as the upper and lower edges and / or the left and right edges, the infrared array includes multiple groups of infrared emitting tubes and infrared receiving tubes. Among them, when arranging multiple groups of infrared emitting tubes and infrared receiving tubes, the arrangement spacing is set to be non-equidistant, and the arrangement spacing of the infrared emitting tubes and the infrared receiving tubes can be adjusted according to the distribution density of the keys in different areas. This adaptive arrangement method can reduce the number of components while ensuring the key detection accuracy, thereby optimizing the hardware cost.

[0023] An infrared light network composed of multiple intersecting infrared light rays is formed in the keyboard operation area. The density of the infrared light network is determined by the spacing between the infrared emitting tubes and the infrared receiving tubes. Generally, it is necessary to satisfy that the spacing between adjacent infrared light rays is less than 1 / 2 of the minimum key size to ensure the resolution of key detection. Each infrared emitting tube has a specific radiation angle when emitting infrared light, and only the infrared receiving tubes within the radiation angle range can effectively receive the infrared light emitted by the infrared emitting tube. The angle of the radiation angle of each infrared emitting tube can be different, and the angle range of the radiation angle can also be set according to actual needs.

[0024] It should be emphasized that regardless of the arrangement spacing between the infrared emitting tubes and the infrared receiving tubes and the radiation angle of the infrared emitting tubes, the detection logic in this embodiment is determined based on the change in signal intensity, and the arrangement spacing between the infrared emitting tubes and the infrared receiving tubes and the radiation angle of the infrared emitting tubes are not limited in this embodiment.

[0025] In this embodiment, the non-uniform arrangement design is to improve the accuracy of key detection. By arranging the infrared emitting tubes and the infrared receiving tubes at non-uniform intervals on the opposite edges, even if the positions of two keys are close, different optical path combinations will be formed when they block the infrared light, so that the system can distinguish different key actions.

[0026] After the infrared emitting tube emits infrared light, when there is no key operation, the infrared receiving tube will receive an infrared light signal with a stable signal intensity. The infrared receiving tube is a device that can convert the received infrared light signal into an electrical signal, and the strength of the electrical signal it outputs is related to the intensity of the received infrared light. Detecting the signal intensity value of the infrared light received by the infrared receiving tube is to quantify the electrical signal received by the infrared receiving tube, so as to obtain a specific value to represent the intensity of the currently received infrared light. When the signal intensity value received by the infrared receiving tube changes, it can be judged that a key action has occurred. Specifically, when the user presses a key, the light-shielding column fixed at the bottom of the key will move downwards and enter the path of the infrared light network, partially or completely blocking the corresponding infrared light. This blockage will cause a significant decrease in the signal intensity detected by the infrared receiving tube in the blocked optical path.

[0027] In this embodiment, the signal intensity values output by each infrared receiving tube are collected in real time through a high-speed analog-to-digital converter. And in the keyboard design stage, the system pre-determines the initial signal intensity of each infrared light. For example, if the range of the signal intensity value of the infrared light is set to 0-100, the signal intensity when it is completely blocked is 0, and the signal intensity when there is no blockage is 100, then during the process of pressing the keyboard key, the signal intensity will gradually change from 100-0, so as to achieve the purpose of judging the target key and the pressing stroke depth of the target key.

[0028] Optionally, the bottom of the light-shielding column is set to be conical or hemispherical, so that only the tip of the light-shielding column blocks a small amount of the optical path during the downward movement. As the depth of the key pressing increases, the thicker part of the light-shielding column invades the infrared light network and blocks more optical paths.

[0029] Optionally, the length of the light-shielding column is greater than the maximum stroke distance of the key. Specifically, the length of the light-shielding column includes three dimensional data: one is the preset distance between the bottom of the light-shielding column and the infrared light network when the key is not pressed; the second is the maximum stroke distance of the key from the initial state to the fully pressed state; the third is the distance buffer margin, which is used to prevent mechanical components from colliding at the limit position. Therefore, the length of the light-shielding column = the preset distance from the infrared light network + the maximum stroke distance of the key + the distance buffer margin. Among them, the preset distance and the distance buffer margin can be set according to the actual scenario, and this embodiment does not make any restrictions on this.

[0030] Step S20: When the signal intensity value is lower than the preset threshold, identify the blocked infrared light and generate a blocked optical path combination.

[0031] The preset threshold is a reference value set according to the signal intensity value received by the infrared receiving tube when there is no key operation. When a key is pressed, the key blocks part of the infrared light, resulting in a decrease in the signal intensity received by the infrared receiving tube.

[0032] To accurately distinguish and locate different infrared rays, the corresponding infrared rays are determined according to the arrangement positions of the infrared emitting tubes and the infrared receiving tubes. For example, in the order from left to right and from top to bottom, a unique serial number is assigned to each infrared ray in turn, and the position of the infrared ray is associated with the corresponding serial number to obtain an infrared ray serial number mapping table.

[0033] It can be understood that when the infrared emitting tubes and the infrared receiving tubes are installed on the keyboard, the physical position relationship between the infrared emitting tubes and the infrared receiving tubes is fixed and determined. And since the radiation angle range of each infrared emitting tube has been preset in the hardware design stage, during the initialization process of the system, a unique identification serial number is assigned to each infrared ray according to the spatial position relationship between each infrared emitting tube and the corresponding infrared receiving tube and stored, ensuring that each infrared ray has a clear unique identification in the system, providing reliable reference data for subsequent key recognition and position determination.

[0034] Exemplarily, from left to right, the infrared ray formed by the first infrared emitting tube E1 and the first infrared receiving tube R1 is marked as 1; the infrared ray formed by the first infrared emitting tube E1 and the second infrared receiving tube R2 is marked as 2.

[0035] In this embodiment, there are multiple different optical paths formed by infrared emitting tubes and infrared receiving tubes in the keyboard operation area. When the detected signal intensity value is lower than the preset threshold, it can be determined that some infrared rays are blocked. Then, according to the infrared ray serial number mapping table, the serial numbers corresponding to these blocked infrared rays are quickly queried and determined, and then the serial numbers of these blocked infrared rays are integrated to generate a blocked optical path combination.

[0036] Further, when the key is pressed, the light-shielding column moves downward vertically and intrudes into the plane of the infrared light network. During this process, the movement process of the light-shielding column is divided into three stages: (1) Initial contact stage: The edge of the light-shielding column first contacts the infrared light network, and the signal intensity received by the infrared receiving tube shows the first decrease, indicating the start of key pressing.

[0037] (2) Dynamic blocking stage: As the pressing depth of the key increases, since the diameter of the light-shielding column is larger than the adjacent optical path spacing, the light-shielding column will block multiple cross-arranged infrared rays at the same time.

[0038] (3) Stable determination stage: When the key is pressed to a certain depth, it is determined to be an effective press when any of the following conditions is met: a. The pressing speed slows down, and the rate of change of the signal intensity drops within the range value of the preset signal intensity change. For example, the rate of change of the signal intensity drops to 3 - 8% / ms; b. There is no new blocked optical path within the preset time range. For example, there is no new blocked optical path for 2.5 - 3.5 ms; c. The cumulative number of blocked optical paths reaches the preset optical path threshold to adapt to different pressing habits; d. The light - shielding cylinder reaches the maximum stroke distance of the key.

[0039] In this embodiment, the system scans the infrared array to detect the blocked infrared rays in real - time, records the serial numbers of the blocked infrared rays, and thus determines the corresponding blocked optical path combination in the current key operation.

[0040] Step S30: Based on the blocked optical path combination, determine the triggered target key.

[0041] In this embodiment, since the positions of the keys on the keyboard are fixed, the system can pre - establish a mapping relationship table between the keys and the blocked optical path combinations, that is, each key is pre - associated with a specific blocked optical path combination. Specifically, after determining the serial number of each infrared ray in advance according to the arrangement positions of the infrared emitting tubes and infrared receiving tubes, by pressing each key on the keyboard one by one, record the serial numbers of the blocked infrared rays in the infrared light network when each key is pressed. Then record the serial numbers of the blocked infrared rays corresponding to all keys and store them in a virtual table for storing the corresponding relationship between the keys and the serial numbers of the blocked infrared rays.

[0042] When a specific blocked optical path combination is detected, the system matches the detected blocked optical path combination with the preset blocked optical path combination in the virtual table. In this way, the system can reversely determine the triggered target key.

[0043] Step S40: Calculate the stroke depth of the target key according to the signal intensity change value of the blocked optical path combination.

[0044] The stroke depth of a key refers to the displacement when the key is pressed and can be used to evaluate the feel of the key. In this embodiment, the stroke depth of the target key is calculated by detecting the signal intensity change value of the blocked optical path combination. When the key is pressed, the degree of occlusion of the infrared rays by the light - shielding cylinder at the bottom of the key changes with the displacement of the key, resulting in a change in the signal intensity. By analyzing the change law of the signal intensity, a relationship model between the signal intensity change value and the key stroke depth can be established, and then the stroke depth of the target key can be calculated.

[0045] Exemplarily, to help understand the implementation process of the keyboard key detection method in this embodiment, please refer toFigure 2A , Figure 2A A layout schematic diagram of an infrared emitting tube and an infrared receiving tube is provided. Specifically: On the edges of the operation area of the keyboard, multiple groups of infrared emitting tubes and infrared receiving tubes are arranged on the upper and lower sides respectively. Each group of infrared emitting tubes and infrared receiving tubes are arranged facing each other. Among them, the infrared emitting tubes and infrared receiving tubes are arranged at non-uniform intervals, and the intervals between adjacent infrared emitting tubes and adjacent infrared receiving tubes can be adjusted according to the keyboard size and key layout.

[0046] Exemplarily, to facilitate understanding of the implementation process of the keyboard key detection method in this embodiment, please refer to Figure 2B , Figure 2B An infrared light network schematic diagram is provided. Specifically: On the edges of the operation area of the keyboard, multiple groups of infrared emitting tubes and infrared receiving tubes are arranged on the upper and lower sides respectively. Each group of infrared emitting tubes and infrared receiving tubes are arranged facing each other to obtain multiple intersecting infrared light rays. These infrared light rays intersect with each other within the keyboard operation area to form a dense infrared light network for detecting the actions of the keys. Among them, each infrared emitting tube has a radiation angle, and only the infrared receiving tubes within the radiation angle can receive the infrared light rays emitted by the corresponding infrared emitting tube.

[0047] When a certain key on the keyboard is pressed, the light-shielding column body at the bottom of the key will move downward and intrude into the infrared light network. As the light-shielding column body moves, it will block the infrared light rays passing through the position of the key. Each infrared receiving tube will detect the change in the signal intensity of the infrared light rays emitted by the corresponding infrared emitting tube. If the change in signal intensity exceeds the preset threshold, the system will record the serial number of the infrared light rays that have changed, thereby obtaining the combination of blocked light paths corresponding to the key.

[0048] By analyzing the combination of blocked light paths, the system can identify the target key that has been pressed. At the same time, according to the signal intensity change value of the combination of blocked light paths, the system can calculate the vertical depth of the light-shielding column body intruding into the infrared light network, thereby obtaining the pressing depth of the target key. This embodiment can not only detect whether a key is pressed, but also measure the pressing depth of the key, providing a richer interaction experience for users.

[0049] Based on the above embodiment, please refer to Figure 3 , the keyboard key detection method of the second embodiment proposed by this application, step S20 includes steps S210~S230: Step S210: Obtain the signal intensity values of all the current infrared light rays, and screen out the infrared light rays whose signal intensity values are lower than the preset threshold to obtain the blocked infrared light rays.

[0050] During the operation of the infrared keyboard, when a key is pressed, it blocks some infrared light, causing a change in the signal intensity received by the corresponding infrared receiving tube. The preset threshold is determined during the system initialization phase. Based on the initial signal intensity value received by the infrared receiving tube during normal operation without key presses, after multiple sampling analyses and considering factors such as environmental interference, it is set to effectively avoid interference from signal intensity changes caused by mis-triggered operations while ensuring sensitivity. Optionally, the preset threshold can also be determined based on expert experience or historical keyboard key usage data.

[0051] The system periodically collects the signal intensity values received by the infrared receiving tube. These signal intensity values are converted from analog signals to digital signals through an analog-to-digital conversion circuit and then read by the system. The pre-written program algorithm in the system compares each collected signal intensity value with the preset threshold. Infrared light with a signal intensity value lower than the preset threshold is determined to be blocked infrared light.

[0052] Step S220: Determine the serial number of the blocked infrared light according to the preset infrared light numbering rule.

[0053] In this embodiment, in order to accurately distinguish and locate different infrared lights, the corresponding infrared lights can be determined according to the arrangement positions of the infrared emitting tubes and the infrared receiving tubes. For example, a unique serial number is assigned to each infrared light in sequence from left to right and from top to bottom. The serial number information of the infrared lights is stored in the system memory to form an infrared light serial number mapping table. After determining the blocked infrared lights, according to the infrared light serial number mapping table, quickly query and determine the corresponding serial numbers of these blocked infrared lights respectively.

[0054] Step S230: Combine the serial numbers of the blocked infrared lights within the same time window to form a blocked optical path combination.

[0055] The time window refers to a time range during the system detection process, used to determine which signal intensity changes of the infrared lights are from key operations at the same moment. The system uses the method of sequentially activating the infrared emitting tubes to detect the keyboard key operations. Specifically, the system pre-determines the activation sequence of each infrared emitting tube, and each infrared emitting tube emits infrared light in sequence within the same time window. When an infrared emitting tube is activated, the infrared light emitted by this infrared emitting tube will be synchronously received by the corresponding infrared receiving tube within the effective radiation angle range. At the same time, the system will synchronously collect the signal intensity values received by the infrared receiving tube within this time window.

[0056] Optionally, the activation of the infrared emitting diodes is controlled by a PWM (Pulse Width Modulation) signal. The activation time of each infrared emitting diode is very short, and sequential activation can be achieved by rapid switching.

[0057] Optionally, the activation sequence of the infrared emitting diodes is controlled by an electronic switch or a logic circuit, and each infrared emitting diode is activated according to a predetermined pattern or sequence.

[0058] It should be noted that when all the infrared emitting diodes complete one activation in sequence according to the preset order, it constitutes a detection cycle. The system assigns a unique timestamp to each detection cycle for marking and differentiating the infrared light data of different detection cycles. In this embodiment, a detection cycle can be used as an event window. Within each time window, if the system detects that the signal intensity value received by the infrared receiving diode is lower than the preset threshold, it is determined that the corresponding infrared light is blocked. Since these blocked infrared lights are detected within the same time window, it is considered that they are blocked due to the same key operation. At this time, the system will obtain the serial numbers of all the infrared lights determined to be blocked within this time window. Then, these serial numbers are arranged according to a rule (such as from small to large), forming an occlusion optical path combination corresponding to the key. Finally, the system can match the occlusion optical path combination with the preset occlusion optical path combination corresponding to the known key by querying the pre-stored mapping relation table between the key and the occlusion optical path combination, so as to determine the specific key position.

[0059] Based on the above embodiments, please refer to Figure 4 For the keyboard key detection method according to the third embodiment proposed in this application, step S30 includes steps S310 to S320: Step S310: Query the preset key mapping table, where the key mapping table stores the corresponding relationship between each key and the occlusion optical path combination.

[0060] Step S320: Match the occlusion optical path combination with the key mapping table to determine the triggered target key.

[0061] The key mapping table stores the corresponding relationship between each key and the occlusion optical path combination. In this embodiment, since the key positions on the keyboard are fixed, the system pre-establishes a mapping relation table between the key and the occlusion optical path combination, and each key is pre-associated with a specific occlusion optical path combination. Specifically, according to the arrangement positions of the infrared emitting diodes and the infrared receiving diodes, the serial number of each infrared light is determined in advance. By pressing each key on the keyboard one by one, the serial numbers of the infrared lights blocked in the infrared light network when each key is pressed are recorded. Then, the serial numbers of the blocked infrared rays corresponding to all the keys are recorded and stored in the key mapping table to store the corresponding relationship between each key and the serial numbers of the corresponding blocked infrared rays.

[0062] When the system obtains the current occluded optical path combination, it will call the key mapping table from the storage area. By traversing the key mapping table, it searches for the occluded optical path combination that matches the detected current occluded optical path combination. Once a match is found, the target key that is triggered can be determined.

[0063] In an alternative embodiment, step S320 may further include steps S3210 to S3230: Step S3210: When there is no single target key in the key mapping table that exactly matches the occluded optical path combination, search for all candidate keys in the key mapping table that have a partial match with the occluded optical path combination.

[0064] In this embodiment, the key mapping table stores the unique correspondence between each key and the occluded optical path combination. However, in the scenario where multiple keys are pressed simultaneously, the detected occluded optical path combination may not exactly match the preset occluded optical path corresponding to a single key in the mapping table. At this time, the system needs to search for all candidate keys in the mapping table that have a partial match with the detected current occluded optical path combination. A partial match means that a part of the detected current occluded optical path combination overlaps with the preset occluded optical path combination corresponding to a certain key in the key mapping table.

[0065] Step S3220: According to the preset occluded optical path combinations corresponding to the candidate keys, determine whether there is a key combination such that after the preset occluded optical path combinations corresponding to the key combination are combined, they exactly match the occluded optical path combination.

[0066] Step S3230: If there is, determine the key combination as the triggered target key.

[0067] After finding all candidate keys with partial matches, the system needs to further determine whether there is a key combination such that after the preset occluded optical path combinations corresponding to these candidate keys are combined, they can exactly match the detected occluded optical path combination. Specifically, the system will permute and combine these candidate keys, and combine (take the union and remove duplicate optical paths) the preset occluded optical path combinations corresponding to each permuted and combined key combination, and then compare with the detected current occluded optical path combination. If the combined occluded optical path combination of a certain key combination is exactly the same as the detected current occluded optical path combination, it means that this key combination is the target key that is currently triggered simultaneously, and then the system will trigger the corresponding operation according to the determined target key.

[0068] In this embodiment, the system processes the recognition problem of single-key and multi-key presses simultaneously based on a key mapping table. Specifically, the mapping relation table stores the basic mapping relations of the preset blocked optical path combinations for each independent key. Therefore, based on the basic mapping relations, combinational logic mapping can also be implemented to represent the association relations of the blocked optical path combinations between different keys, including the key combinations allowed to be triggered simultaneously and the change characteristics of the blocked optical path combinations corresponding to the key combinations.

[0069] Specifically, when the system detects the current blocked optical path combination, it will execute a multi-level judgment process: First, it checks whether it conforms to the basic mapping relation of the blocked optical path combination of a single key; if no exact match is found, combinational logic recognition is performed. By analyzing the serial number distribution characteristics in the blocked optical path combination, the blocked optical path combination is disassembled into the intersection of the blocked optical path combinations corresponding to multiple single keys, thereby obtaining candidate keys. Then, it is verified whether there is a key combination among these candidate keys such that the union of the blocked optical path combinations corresponding to the key combination is exactly the same as the current blocked optical path combination.

[0070] Exemplarily, after pressing the A key, the corresponding blocked optical path combination is 1, 3, 5, and after pressing the B key, the corresponding blocked optical path combination is 8, 9, 11. Then, when the system detects that the blocked optical path combination of a certain key is 1, 3, 5, 8, 9, 11, it can be inferred that the A key and the B key are pressed simultaneously.

[0071] In another alternative implementation, step S3230 may further include steps S32310 to S32320: Step S32310: Calculate the blocking priority of each key in the key combination according to the number of infrared rays blocked in the preset blocked optical path combination corresponding to each key in the key combination.

[0072] S32320: Determine the triggering order of each key in the key combination in the order from high to low of the blocking priority.

[0073] In this embodiment, when it is confirmed that the current key trigger operation is a multi-key simultaneous trigger, the system needs to further determine the triggering order in the key combination. Therefore, the system will calculate the blocking priority of each candidate key, and the blocking priority reflects the order of each key in the current blocking situation in each key combination. The calculation of the blocking priority is based on the ratio of the number of actually blocked infrared rays in the preset blocked optical path combination corresponding to each key to the total number of infrared rays in the preset blocked optical path combination corresponding to the key.

[0074] After determining the occlusion priorities of each key in the key combination, the system sorts the keys from high to low according to these priorities to determine the triggering order of the keys. The key with a higher priority is considered the key that the user presses first, so it will be triggered first. In this way, the system can more accurately identify the user's key operations in the scenario of multiple keys being pressed simultaneously, improving the accuracy of input.

[0075] Exemplarily, to help understand the implementation process of the keyboard key detection method in this embodiment, please refer to Figure 5A , Figure 5A which provides a schematic diagram of the infrared light network blocked when a key is pressed. Specifically: In the keyboard operation area, when a single key is pressed, the light-shielding column at the bottom of the key moves downwards and intrudes into the infrared light network, and part of the infrared light passing through the bottom of the key is blocked. As can be seen from Figure 5A , in the infrared light network formed by the infrared emitting tube and the infrared receiving tube arranged oppositely, a specific group of infrared light rays is blocked due to the key action. The system obtains the serial numbers of each blocked infrared light ray in this group through a pre-set infrared light ray numbering rule, and then combines all the serial numbers of the corresponding infrared light rays in this group to form an occlusion optical path combination corresponding to the key.

[0076] Exemplarily, to help understand the implementation process of the keyboard key detection method in this embodiment, please refer to Figure 5B , Figure 5B which provides a schematic diagram of the infrared light network blocked when two keys are pressed. Specifically: In the keyboard operation area, when two keys are pressed simultaneously, the light-shielding columns at the bottoms of the two keys move downwards simultaneously and intrude into the infrared light network. At this time, more infrared light rays are blocked. As can be seen from Figure 5B , two groups of infrared light rays passing through the positions of these two keys are blocked. During the process of detecting the key action, the system also determines the serial numbers of the blocked infrared light rays in these two groups according to the infrared light ray numbering rule and integrates them to form an occlusion optical path combination corresponding to these two keys.

[0077] It should be noted that when two or more keys are pressed simultaneously, there may be a situation where some infrared light rays are blocked repeatedly. To ensure the accuracy of the occlusion optical path combination, the system will integrate the serial numbers of the blocked infrared light rays and remove the duplicate serial numbers to obtain an occlusion optical path combination that does not contain duplicate serial numbers.

[0078] Based on the above embodiment, please refer to Figure 6 , the keyboard key detection method of the fourth embodiment proposed in this application, step S40 further includes steps S410 to S430: Step S410: Obtain the initial signal intensity value and the current signal intensity value of each infrared ray in the blocked optical path combination.

[0079] The initial signal intensity value refers to the signal intensity received by the infrared receiving tube corresponding to the infrared ray when there is no key operation. During the keyboard design stage, the system will sample the signal intensity corresponding to each infrared ray multiple times and determine a stable initial value. The current signal intensity value is the signal intensity received by the infrared receiving tube corresponding to the infrared ray that is collected in real time by the system when a key operation is detected and the blocked optical path combination is formed. When the system detects the existence of a key operation, it will immediately start signal acquisition, convert the analog signal received by the infrared receiving tube into a digital signal, and then obtain the current signal intensity value corresponding to each infrared ray in the blocked optical path combination in the current key operation.

[0080] Based on the blocked optical path combination corresponding to the current key operation, the system will determine the initial signal intensity value of the corresponding infrared ray according to the serial number of each infrared ray in the current blocked optical path combination, and simultaneously collect the current signal intensity value synchronously.

[0081] Step S420: Calculate the signal intensity change value of each infrared ray, where the signal intensity change value is the difference between the initial signal intensity value and the current signal intensity value.

[0082] After the system obtains the initial signal intensity value and the current signal intensity value of each infrared ray in the blocked optical path combination, it starts to perform subtraction operations to calculate the signal intensity change value of each infrared ray. This signal intensity change value intuitively reflects that after the key is pressed, the light-shielding column blocks the infrared ray, resulting in a change in the signal intensity received by the infrared receiving tube. The larger the signal intensity change value, the higher the degree of blocking of the infrared ray by the light-shielding column at the bottom of the key, which also means that the pressing stroke of the key is deeper.

[0083] Step S430: Determine the stroke depth of the target key according to the mapping relationship between the signal intensity change value and the preset stroke depth.

[0084] The preset mapping relationship between the signal intensity change value and the stroke depth is established during the keyboard design and testing stages. By pressing the key with different stroke depths for testing and recording the signal intensity change value corresponding to each stroke depth, the corresponding relationship between the signal intensity change value and the stroke depth is obtained. Therefore, when the system calculates the signal intensity change value of each infrared ray, it will take the average value of the signal intensity change values of these infrared rays as the intensity change value corresponding to the blocked optical path combination corresponding to the current key operation. Then, the system will search and match in the preset relationship model or the mapping relationship between the signal intensity change value and the stroke depth.

[0085] It should be noted that the correspondence between the signal intensity change value corresponding to the light path occlusion combination and the stroke depth can be obtained by simulating the key-pressing habits of different users and collecting a large amount of key-pressing data, including the force, speed, duration when the key is pressed, and the signal intensity change detected by the infrared receiving tube. Then, statistical analysis and machine learning algorithms are used to process the key-pressing data to obtain the correlation law between the stroke depth and the signal intensity change value.

[0086] Optionally, a relationship model between the signal intensity change value and the key stroke depth can be established, or a stroke depth mapping relationship between the intensity change value and the key stroke depth can be established.

[0087] It should be noted that if the signal intensity change value does not exactly correspond to the value in the preset relationship model or stroke depth mapping relationship, methods such as linear interpolation can be used to estimate the corresponding stroke depth through the calculation of adjacent data points, and finally determine the stroke depth of the target key.

[0088] Based on the above embodiments, please refer to Figure 7 , after step S40 of the keyboard key detection method according to the fifth embodiment proposed by the present application, steps S50 to S60 are further included: Step S50: When it is detected that the stroke depth of the target key reaches a preset trigger threshold, a corresponding key trigger signal is generated.

[0089] The preset trigger threshold is a key parameter set according to the design purpose of the keyboard and the user operation habits. It indicates that the key needs to be pressed to a certain stroke depth to be recognized as an effective trigger. Keyboards with different design purposes, such as gaming keyboards and office keyboards, have different requirements for the stroke depth of key triggers. Gaming keyboards may require more sensitive triggers, that is, the trigger threshold is set relatively low so that players can quickly respond to game operations; while office keyboards may pay more attention to stability, and the trigger threshold will be set slightly higher. At the same time, considering that different users have different key-pressing habits when using the keyboard. Some users prefer to get a response by lightly touching the key, while some users pay attention to the key-pressing force. This difference will result in individual differences between the stroke depth of the key and the signal intensity change value of the light path occlusion combination corresponding to the key. Therefore, in order to adapt to the key-pressing habits of different users, the key trigger conditions can be set, for example, by adjusting the position of the key trigger, so that the keyboard has different key-pressing experiences and meets the personalized needs of different users for the keyboard.

[0090] It should be noted that the higher the trigger threshold, the deeper the stroke depth required to press the key.

[0091] In an alternative embodiment, the user can customize the trigger threshold of the key travel depth to obtain a more personalized user experience. This can be achieved by combining key operations or through software settings. Through the software interface, the user can access a configuration menu that provides options to adjust the trigger threshold to meet individual requirements for keyboard response speed and accuracy. Additionally, specific key combinations can be used to quickly access and modify these settings, making the entire adjustment process more intuitive and convenient.

[0092] Exemplarily, the vertical depth of the key is divided into three regions, and different trigger thresholds are set for each region. The light press region is set to a travel depth of 1 - 2 mm; the standard region is set to a travel of 2 - 3 mm; the deep press region is set to a travel exceeding 3 mm. Through this division, the system can provide different trigger thresholds, achieve more precise key detection, enhance the adaptability of the keyboard to different user habits, and improve the overall user experience.

[0093] Step S60: Adjust the trigger sensitivity of the key trigger signal according to the change rate of the travel depth.

[0094] The change rate of the travel depth represents the speed of the key press. Since different users have different key pressing habits and different key pressing speeds, in order to enable the keyboard to respond stably and accurately at various operation speeds, the system can adjust the trigger sensitivity according to the change rate of the travel depth.

[0095] Specifically, the system continuously monitors the travel depth data of the target key within a preset time interval. The formula is: change rate of travel depth = (current travel depth - travel depth at the previous moment) / preset time interval.

[0096] Furthermore, the adjustment method of the trigger sensitivity is as follows: when it is detected that the change rate of the travel depth exceeds the first rate threshold, it indicates that the user presses the key relatively fast. To avoid the situation where some keys are not fully pressed and cannot be triggered due to too fast a key press speed, the system will lower the trigger threshold. Therefore, in this case, the key only needs to be pressed to a relatively shallow depth to reach the new lower trigger threshold and be effectively triggered.

[0097] When it is detected that the change rate of the travel depth is lower than the second rate threshold, it indicates that the user presses the key relatively slowly. To prevent accidental key presses, the system will increase the trigger threshold.

[0098] Exemplarily, in a game scenario, when a player is in a fierce team battle, they need to quickly press multiple skill buttons to release combo moves. At this time, the player's button-pressing speed is extremely fast, and the rate of change of the travel depth will exceed the first rate threshold. If the system does not adjust the trigger threshold, due to the extremely short time when the player presses the button, some buttons may not reach the original trigger threshold in time, resulting in the inability to release skills, which affects the game operation and the trend of the battle situation. To avoid this situation, the system will automatically lower the trigger threshold. For example, if the original trigger threshold is set to a button press depth of 2 mm, after the system lowers the threshold, it may only need to press a depth of 1.5 mm for the button to be effectively triggered, ensuring that the player's quick operations can be promptly responded to, enabling the player to release skills smoothly in the game and enhancing the game experience.

[0099] Exemplarily, in an office scenario, such as in copywriting work, users are usually in a state of typing while thinking, and at this time, the user's typing speed is relatively slow, and the rate of change of the travel depth will be lower than the second rate threshold. If the trigger threshold is low, there may be accidental touch situations, such as when the finger gently touches the button, it triggers button input, resulting in incorrect characters being entered. To prevent such accidental touch situations from occurring, the system will automatically increase the trigger threshold. Assuming the original trigger threshold is 1.5 mm, after the system increases the threshold, it may become 2 mm, so that the user needs to press the button harder to trigger, thereby reducing the probability of accidental touch and improving the accuracy and efficiency of office typing.

[0100] In an alternative implementation, after step S50, steps S51 to S53 may further be included: Step S51: Detect the change in the signal intensity of the infrared light in the adjacent area of the target button.

[0101] In actual keyboard operations, the user may accidentally touch the area around the target button, causing a change in the signal intensity of the infrared light in the adjacent area. To identify this situation, after the system detects that the travel depth of the target button reaches the trigger threshold and generates a button trigger signal, it will further detect the change in the signal intensity of the infrared light in the adjacent area of the target button.

[0102] The system pre-defines the range of each button's adjacent area, determines the corresponding optical path to be detected, and then periodically collects the signal intensity values received by the infrared receiving tubes in these adjacent areas in the same signal intensity detection method as that for detecting the target button.

[0103] Step S52: When there is an accompanying signal change in the adjacent area, determine whether it is an accidental touch operation.

[0104] It should be noted that the accompanying signal change refers to the non-actively triggered associated signal change of the infrared light in the adjacent area when the target button is pressed.

[0105] Under normal circumstances, the accompanying signal change has the following characteristics: it occurs synchronously with the main key pressing action, that is, the time deviation is less than the preset deviation threshold; or the signal strength attenuation amplitude is less than the preset attenuation value of the corresponding area of the target key; or the occlusion area where the accompanying signal change occurs does not conform to the area contour corresponding to the preset key position.

[0106] When it is detected that there is a change in the infrared light signal strength in the adjacent area of the target key, the system will analyze according to the preset judgment rules. For example, if the signal strength change pattern in the adjacent area is too different from the signal strength change pattern generated in the adjacent area during normal key operation, or if there are large-amplitude changes in the infrared light signal strengths in multiple adjacent areas at the same time and do not conform to the signal change characteristics in the adjacent area during normal key operation, the system will determine that there may be a mis-touch operation.

[0107] Exemplarily, during normal key operation, the signal strength change is usually concentrated on the optical path corresponding to the target key, with a large change amplitude and a certain order. For example, when the user presses the space key, the signal strength change mainly appears on the optical path corresponding to the space key, and this change occurs step by step. However, in a mis-touch operation, the signal strength changes in adjacent optical paths are often small and more dispersed, and may even appear on multiple optical paths at the same time. For example, if the user accidentally blocks the adjacent optical paths with the edge of the finger when pressing the "space key", the signal strength change amplitude of these optical paths may only be about 30% of the change amplitude of the target key optical path, and these changes occur almost simultaneously, with a very small time deviation, usually within 1-2 milliseconds.

[0108] In addition, a mis-touch operation may also cause a signal strength change to appear in an area that does not conform to the key layout. For example, under normal circumstances, only the optical path corresponding to the space key will be blocked when pressing the space key, but if a mis-touch causes the edge of the finger to block the optical path above or below the space key, the signal strength changes in these optical paths do not conform to the area distribution characteristics of normal key operation.

[0109] Step S53: If it is confirmed as a mis-touch, suppress the signal output of the adjacent area of the target key.

[0110] When the system determines that the adjacent area of the target key in the current operation is a mis-touch, to avoid outputting incorrect key signals to the computer system and causing mis-operations, the system will suppress the signal output of the adjacent area of the target key and only output the signal corresponding to the target key, so as to perform the corresponding operation.

[0111] An embodiment of the present application provides a keyboard key detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the keyboard key detection method in the first embodiment above.

[0112] Reference is made below Figure 8 to FIG., which shows a schematic structural diagram of a keyboard key detection device suitable for implementing the embodiments of the present application. The keyboard key detection device in the embodiments of the present application may include various hardware and software components for implementing the keyboard key detection method. Figure 8 The shown keyboard key detection device is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.

[0113] As Figure 8 shown, the keyboard key detection device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which may execute various appropriate actions and processes according to a program stored in a read-only memory (ROM, Read Only Memory) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM, Random Access Memory) 1004. In the random access memory 1004, various programs and data required for the operation of the keyboard key detection device are also stored. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, etc.; an output device 1008 including, for example, a liquid crystal display (LCD, Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the keyboard key detection device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a keyboard key detection device with various systems, it should be understood that it is not required to implement or have all the shown systems. More or fewer systems may be alternatively implemented or had.

[0114] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium. The computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by a processing device 1001, the above functions defined in the methods of the embodiments disclosed in the present application are executed.

[0115] The keyboard key detection device provided in the present application adopts the keyboard key detection method in the above embodiment, and can solve the technical problem of too high cost of keyboard key depth detection. Compared with the prior art, the beneficial effects of the keyboard key detection device provided in the present application are the same as those of the keyboard key detection method provided in the above embodiment, and other technical features in the keyboard key detection device are the same as the features disclosed in the method of the previous embodiment, and will not be elaborated here.

[0116] It should be understood that the various parts disclosed in the present application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in a suitable manner in any one or more embodiments or examples.

[0117] As described above, the above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0118] The embodiments of the present application provide a computer-readable storage medium, having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the keyboard key detection method in the above embodiment.

[0119] The computer-readable storage medium provided by the present application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or component. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination of the above.

[0120] The above computer-readable storage medium can be included in the keyboard key detection device; or it can exist separately without being assembled into the keyboard key detection device.

[0121] The above computer-readable storage medium carries one or more programs. When the one or more programs are executed by the keyboard key detection device, the keyboard key detection device is caused to: detect the signal intensity value of the infrared light received by the infrared receiving tube; when the signal intensity value is lower than a preset threshold, identify the blocked infrared light and generate a blocked light path combination; based on the blocked light path combination, determine the triggered target key; and calculate the travel depth of the target key according to the signal intensity change value of the blocked light path combination.

[0122] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by connecting through the Internet using an Internet service provider).

[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of the code, and this module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes may occur in a different order than that marked in the accompanying drawings. For example, two consecutively represented boxes can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0124] The modules described in the embodiments of this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.

[0125] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned keyboard key detection method, and can solve the technical problem of the too high cost of keyboard key depth detection. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the keyboard key detection method provided by the above embodiments, and will not be elaborated here.

[0126] An embodiment of the present application provides a computer program product, including a computer program which, when executed by a processor, implements the steps of the keyboard key detection method as described above.

[0127] The computer program product provided by the present application can solve the technical problem of too high cost of keyboard key depth detection. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as those of the keyboard key detection method provided by the above embodiment, and will not be elaborated here.

[0128] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent scope of the present application.

[0129] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or system including that element.

[0130] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0131] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.

Claims

1. A keyboard key detection method, characterized in that, Applied to an infrared keyboard, the infrared keyboard includes a keyboard operation area, and at least one set of opposite sides around the keyboard operation area is provided with an infrared array. The infrared array includes multiple groups of infrared emitting tubes and infrared receiving tubes. Each group of the infrared emitting tubes and the infrared receiving tubes are arranged opposite to each other, and an infrared light network formed by multiple intersecting infrared light rays is formed in the keyboard operation area. The keyboard operation area is provided with keys, and a light-shielding column that can move vertically with the movement of the keys is fixedly arranged at the bottom position of the keys. The light-shielding column is located at a preset distance above the infrared light network in the initial state. The keyboard key detection method includes: Detecting the signal intensity value of the infrared light received by the infrared receiving tube; When the signal intensity value is lower than a preset threshold, identifying the blocked infrared light rays and generating a blocked light path combination; Based on the blocked light path combination, determining the triggered target key; Calculating the travel depth of the target key according to the signal intensity change value of the blocked light path combination.

2. The keyboard key detection method according to claim 1, wherein, The step of when the signal intensity value is lower than a preset threshold, identifying the blocked infrared light rays and generating a blocked light path combination includes: Obtaining the signal intensity values of all the current infrared light rays, screening out the infrared light rays with signal intensity values lower than the preset threshold to obtain the blocked infrared light rays; Determining the serial numbers of the blocked infrared light rays according to a preset infrared light ray numbering rule; Combining the serial numbers of the blocked infrared light rays within the same time window to form a blocked light path combination.

3. The keyboard key detection method according to claim 1, wherein, The step of based on the blocked light path combination, determining the triggered target key includes: Querying a preset key mapping table, where the key mapping table stores the corresponding relationship between each key and the blocked light path combination; Matching the blocked light path combination with the key mapping table to determine the triggered target key.

4. The keyboard key detection method according to claim 3, wherein The step of matching the blocked light path combination with the key mapping table to determine the triggered target key includes: When there is no single target key that completely matches the blocked light path combination in the key mapping table, searching for all candidate keys in the key mapping table that have partial matches with the blocked light path combination; According to the preset blocked light path combinations corresponding to the candidate keys, determining whether there is a key combination such that after the preset blocked light path combinations corresponding to the key combination are merged, they completely match the blocked light path combination; If so, determining the key combination as the triggered target key.

5. The keyboard key detection method according to claim 4, wherein, The step of if so, determining the key combination as the triggered target key includes: Calculating the blocking priority of each key in the key combination according to the number of blocked infrared light rays in the preset blocked light path combinations corresponding to each key in the key combination; Determining the triggering order of each key in the key combination in descending order of the blocking priority; Wherein, the calculation method of the blocking priority is: the ratio of the number of actually blocked infrared light rays to the total number of infrared light rays in the preset blocked light path combination corresponding to the key.

6. The keyboard key detection method according to claim 1, wherein The step of calculating the travel depth of the target key according to the signal intensity change value of the blocked optical path combination includes: Obtain the initial signal intensity value and the current signal intensity value of each infrared ray in the blocked optical path combination; Calculate the signal intensity change value of each infrared ray, where the signal intensity change value is the difference between the initial signal intensity value and the current signal intensity value; Determine the travel depth of the target key according to the mapping relationship between the signal intensity change value and the preset travel depth.

7. The keyboard key detection method according to claim 1, characterized in that After the step of calculating the travel depth of the target key according to the signal intensity change value of the blocked optical path combination, the method further includes: When it is detected that the travel depth of the target key reaches a preset trigger threshold, generate a corresponding key trigger signal; Adjust the trigger sensitivity of the key trigger signal according to the change rate of the travel depth; Wherein, the adjustment method of the trigger sensitivity is: when it is detected that the change rate of the travel depth exceeds the first rate threshold, reduce the trigger threshold; When it is detected that the change rate of the travel depth is lower than the second rate threshold, increase the trigger threshold.

8. The keyboard key detection method according to claim 7, wherein After the step of generating a corresponding key trigger signal when it is detected that the travel depth of the target key reaches a preset trigger threshold, the method further includes: Detect the signal intensity change of the infrared rays in the adjacent area of the target key; When there is an accompanying signal change in the adjacent area, determine whether it is a misoperation; If it is confirmed as a misoperation, suppress the signal output in the adjacent area of the target key.

9. A keyboard key detection device, characterized in that, The keyboard key detection device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the keyboard key detection method according to any one of claims 1 to 8.

10. A computer storage medium, characterized in that, The computer storage medium is a computer-readable storage medium, and a computer program is stored on the computer storage medium, and when the computer program is executed by the processor, the steps of the keyboard key detection method according to any one of claims 1 to 8 are implemented.