CN110109788B - Multi-key detection method and device, electronic equipment and storage medium - Google Patents

Multi-key detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110109788B
CN110109788B CN201910360925.XA CN201910360925A CN110109788B CN 110109788 B CN110109788 B CN 110109788B CN 201910360925 A CN201910360925 A CN 201910360925A CN 110109788 B CN110109788 B CN 110109788B
Authority
CN
China
Prior art keywords
key
keys
column line
lines
row
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.)
Active
Application number
CN201910360925.XA
Other languages
Chinese (zh)
Other versions
CN110109788A (en
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.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication 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 Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN201910360925.XA priority Critical patent/CN110109788B/en
Publication of CN110109788A publication Critical patent/CN110109788A/en
Application granted granted Critical
Publication of CN110109788B publication Critical patent/CN110109788B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Telephone Function (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

The embodiment of the application discloses a multi-key detection method, a device, an electronic device and a storage medium. Therefore, when a plurality of keys in the electronic equipment are pressed, row line coordinates and column line coordinates of the plurality of keys are obtained; calculating key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys; performing key mapping on a plurality of keys according to key values of the keys to obtain target key events corresponding to the keys; and executing the target key event. According to the embodiment of the application, the values of all key points can be read at one time, the key values do not need to be read from a register, the key detection speed is improved, the method and the device can be seamlessly combined with a native mechanism, and the code stability and portability are strong.

Description

Multi-key detection method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of electronic devices, and in particular, to a method and apparatus for detecting multiple keys, an electronic device, and a storage medium.
Background
Along with the wider and wider application of electronic devices such as mobile phones and tablet computers in daily life, new demands are continuously put forward on the structure and functions of the electronic devices, such as a metal shell with smaller device specification, larger screen occupation ratio and better hand feeling.
If the keyboard of the handset is also rich in combined key functions, like the keyboard of a personal computer Personal Computer, PC), more interesting functions can be implemented on the simple keyboard of the handset. For example, in a game interface, a combination key is used for killing a game; such as entering a particular security mode or detection mode using a particular combination key; for example, a specific combination key is utilized to enter a specific password function, so that people can not easily find that the combination key is realized on the basis that the bottom layer key driving must support simultaneous detection of multiple keys.
However, for many low-end platforms, the number of key interfaces is limited, so that simultaneous detection of a plurality of keys cannot be supported simultaneously, and although some of the low-end platforms support simultaneous detection of 2 keys, for example, a concurrency (MediaTek, MTK) platform supports simultaneous detection of 2 keys, but key detection codes are packaged and read from a register, and cannot be further expanded.
Disclosure of Invention
The embodiment of the application provides a multi-key detection method, a device, electronic equipment and a storage medium, which can read the values of all key points at one time without reading key values from a register, and has the advantages of high key detection speed, seamless combination with a native mechanism, stable code and strong portability.
In a first aspect, the present application provides a multi-key detection method applied to an electronic device, where the electronic device includes a key matrix formed by the plurality of key column lines and the plurality of key row lines, the plurality of key row lines are configured to output a low-level mode, and the plurality of key column lines are configured to output a low-level interrupt trigger mode, and the multi-key detection method includes:
when a plurality of keys in the electronic equipment are pressed, acquiring row line coordinates and column line coordinates of the keys;
calculating key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys;
performing key mapping on the plurality of keys according to key values of the plurality of keys to obtain target key events corresponding to the plurality of keys;
and executing the target key event.
In some embodiments of the present application, before the plurality of keys is pressed in the electronic device, the method further comprises:
configuring the plurality of key row lines to output a low level mode;
and configuring the plurality of key column lines into a low-level interrupt trigger mode.
In some embodiments of the present application, when a plurality of keys in the electronic device are pressed, acquiring row line coordinates and column line coordinates of the plurality of keys includes:
when a plurality of keys in the electronic equipment are pressed, determining a target key column line for detecting the pressing of the keys;
traversing and detecting all keys corresponding to the target key column line, and determining the keys which are detected to be pressed down as the plurality of keys;
and acquiring row line coordinates and column line coordinates of the plurality of keys.
In some embodiments of the present application, when a plurality of keys in the electronic device are pressed, determining a target key column line for detecting a key press includes:
when a plurality of keys in the electronic equipment are pressed, determining a target key column line outputting low level;
and storing the key column line value corresponding to the target key column line in a preset array, and marking the number of key column lines in the target key column line.
In some embodiments of the application, the method further comprises:
after the target key event is executed, a key row line mode is reinitialized to configure the plurality of key row lines to output a low level mode and the plurality of key row lines to be configured to a low level interrupt trigger mode.
In a second aspect, the present application provides a multi-key detection apparatus applied to an electronic device, where the electronic device includes a key matrix formed by the plurality of key column lines and the plurality of key row lines, the plurality of key row lines are configured to output a low-level mode, and the plurality of key column lines are configured to output a low-level interrupt trigger mode, and the multi-key detection apparatus includes:
the first acquisition unit is used for acquiring row line coordinates and column line coordinates of a plurality of keys when the plurality of keys in the electronic equipment are pressed;
a calculating unit, configured to calculate key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys;
the second obtaining unit is used for carrying out key mapping on the plurality of keys according to the key values of the plurality of keys to obtain target key events corresponding to the plurality of keys;
and the execution unit is used for executing the target key event.
In some embodiments of the present application, the multi-key detection apparatus further includes:
a configuration unit, configured to configure the plurality of key row lines to output a low level mode before a plurality of keys are pressed in the electronic device; and configuring the plurality of key column lines into a low-level interrupt trigger mode.
In some embodiments of the present application, the first obtaining unit is specifically configured to:
when a plurality of keys in the electronic equipment are pressed, determining a target key column line for detecting the pressing of the keys;
traversing and detecting all keys corresponding to the target key column line, and determining the keys which are detected to be pressed down as the plurality of keys;
and acquiring row line coordinates and column line coordinates of the plurality of keys.
In some embodiments of the present application, the first obtaining unit is specifically configured to:
when a plurality of keys in the electronic equipment are pressed, determining a target key column line outputting low level;
and storing the key column line value corresponding to the target key column line in a preset array, and marking the number of key column lines in the target key column line.
In some embodiments of the application, the configuration unit is further configured to: after the target key event is executed, a key row line mode is reinitialized to configure the plurality of key row lines to output a low level mode and the plurality of key row lines to be configured to a low level interrupt trigger mode.
In a third aspect, the present application provides an electronic device, where the electronic device includes a key matrix formed by the plurality of key column lines and the plurality of key row lines, the plurality of key row lines are configured to output a low-level mode, and the plurality of key column lines are configured to output a low-level interrupt trigger mode, and the electronic device further includes:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor as steps in the multi-key detection method of any of the first aspects.
In a fourth aspect, the present application also provides a storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the multi-key detection method of any one of the first aspects.
In the multi-key detection method of the embodiment of the application, as a plurality of key row lines of the key matrix of the electronic device are configured to output a low-level mode, a plurality of key column lines are configured to be in a low-level interrupt trigger mode. Therefore, when a plurality of keys in the electronic equipment are pressed, row line coordinates and column line coordinates of the plurality of keys are obtained; calculating key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys; performing key mapping on a plurality of keys according to key values of the keys to obtain target key events corresponding to the keys; and executing the target key event. According to the embodiment of the application, the values of all key points can be read at one time, the key values do not need to be read from a register, the key detection speed is improved, the method and the device can be seamlessly combined with a native mechanism, and the code stability and portability are strong.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an embodiment of a method for multi-key detection according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a key matrix structure;
FIG. 3 is a schematic diagram illustrating a structure of an embodiment of a multi-key detection device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an embodiment of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
In the present application, the term "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described as "exemplary" in this disclosure is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes have not been described in detail so as not to obscure the description of the application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The terms "system" and "network" are often used interchangeably herein. The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
The application provides a multi-key detection method, a multi-key detection device, an electronic device and a storage medium, and the multi-key detection method, the device, the electronic device and the storage medium are respectively described in detail below.
First, the present application provides a multi-key detection method applied to an electronic device, wherein the electronic device includes a key matrix composed of a plurality of key column lines and a plurality of key row lines, the plurality of key row lines are configured to output a low-level mode, the plurality of key column lines are configured to output a low-level interrupt trigger mode, and the multi-key detection method includes: when a plurality of keys in the electronic equipment are pressed, acquiring row line coordinates and column line coordinates of the keys; calculating key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys; performing key mapping on the plurality of keys according to key values of the plurality of keys to obtain target key events corresponding to the plurality of keys; and executing the target key event.
Fig. 1 is a schematic flow chart of an embodiment of a multi-key detection method according to the present application, where the multi-key detection method is applied to an electronic device, and the electronic device includes a key matrix formed by the plurality of key row lines and the plurality of key row lines, the plurality of key row lines are configured to output a low-level mode, the plurality of key row lines are configured to output a low-level interrupt trigger mode, and the multi-key detection method includes:
101. and when a plurality of keys in the electronic equipment are pressed, acquiring row line coordinates and column line coordinates of the plurality of keys.
As shown in fig. 2, a key matrix structure of a native key module is shown, wherein ROW0 to ROW5 are 6 key ROW lines in the native key module, COL0 to COL 6 are 7 key column lines in the MTK native key module, the native key module supports a ROW-column key matrix design of maximum 6*7, and there are 42 keys (S0 to S41 in fig. 2), in the embodiment of the present application, the key ROW lines are all configured to output a low level mode, the key column lines are set to an interrupt mode, and the low level is triggered; when a certain key is pressed, the corresponding row line is short-circuited, and the interrupt is triggered.
Thus, in an embodiment of the present application, before the plurality of keys are pressed in the electronic device, the method further includes: configuring the plurality of key row lines to output a low level mode; and configuring the plurality of key column lines into a low-level interrupt trigger mode.
In some embodiments of the present application, when a plurality of keys in the electronic device are pressed, acquiring row line coordinates and column line coordinates of the plurality of keys includes:
(1) And when a plurality of keys in the electronic equipment are pressed, determining a target key column line for detecting the pressing of the keys.
Wherein, when the plurality of keys in the electronic device are pressed, determining a target key column line for detecting the pressing of the keys, and further comprising: when a plurality of keys in the electronic equipment are pressed, determining a target key column line outputting low level; and storing the key column line value corresponding to the target key column line in a preset array, and marking the number of key column lines in the target key column line. At this time, the target key column line is determined, that is, the column line coordinates corresponding to the plurality of keys are determined.
In the following, a specific example is described as an example, when a plurality of keys in the electronic device are pressed, a target key column line COL of the plurality of keys is confirmed, reading of all COL gpio lines detected to be low level is mainly completed, a key column line value corresponding to the target key column line is stored in a preset array col_low, and a total count of COL gpio detected to be low level is M. The method comprises the following specific steps: all ROW gpio is set to output low level in the initial state, at this time, COL gpio is set to read mode, if low level is detected, it is indicated that there may be one or more key presses on this COL gpio line, but specifically which ROW gpio triggers, and it cannot be confirmed. The COL gpio (case column line value corresponding to the target key column line) detected as the low level is stored in the col_low array, and the number of key column lines in the target key column line is denoted as M.
(2) And traversing and detecting all keys corresponding to the target key column line, and determining the keys which are detected to be pressed down as the plurality of keys.
Similarly, by way of a specific example, all the keys corresponding to the target key ROW line are detected, the key pressed by the key detected in all the keys corresponding to the target key ROW line is determined as one of the plurality of keys, and at this time, ROW line coordinates and column line coordinates of the plurality of keys, that is, ROW coordinates and COL coordinates as shown in fig. 2, can be sequentially determined, so that the positions of the physical keys in the plurality of keys can be determined.
The method comprises the following specific steps: assuming that there are M key column lines in total in the target key column lines, that is, the low-level COL line is detected in the M key column lines, at this time, all keys corresponding to each key column line are sequentially traversed from the 1 st key column line to the M key column line in the M key column lines (as shown in fig. 2, all keys corresponding to the COL1 column line are S0, S7, S14, S21, S28 and S35, respectively), and the determination of the key detected to be pressed by the key is one of the plurality of keys. And sequentially calculating to obtain the positions of all the pressed keys on the corresponding target key column line.
Traversing all keys corresponding to each key column line, and confirming that the key in the key column line is one of a plurality of keys comprises the following steps: for a key column line col gpio where a key press has been detected, the row gpio position, i.e. row coordinates (row line coordinates), of all key presses on this key column line can be located and the coordinates of the final key are recorded. The specific implementation is as follows: on a given nth col line, if the nth col is output low level and the other cols are output high level, the level value is read from the row gpio, and if the low level is detected at three positions a, b and c of the row gpio, it is indicated that the key is pressed at three positions (a, N) (b, N) (c and N).
The following is exemplified by the case that only one column line and a plurality of column lines in the target key column lines are used, if m=1, that is, the target key column lines include 1 key column line, S10 (row 1, col 3), S17 (row 2, col 3), S24 (row 3, col 3), and simultaneously, the preset col_low array has only 1 key column line, that is, m=1, col 3gpio, because all keys are on the col 3 key column line; at this time, only once, since col_low has only 1 col 3, the physical key coordinates of the plurality of keys can be read as (1, 3), (2, 3) and (3, 3) by traversing all keys corresponding to the key column line col 3.
If m=3, i.e. the target key row line includes 3 key row lines, it is assumed that S16 (row 2, col 2), S24 (row 3, col 3), S232 (row 4, col 4), and pressing at the same time, since there are only 3 col_low arrays, respectively col 2, col 3, col 4, m=3; cases corresponding to 3 key column lines need to be traversed and detected respectively, and (2, 2) can be obtained on the assumption that n=2 is the first time; second time n=3, (3, 3) can be obtained, and third time n=4, (4, 4) can be obtained.
(3) And acquiring row line coordinates and column line coordinates of the plurality of keys.
After the positions of the keys are determined, row line coordinates and column line coordinates of the keys can be obtained.
102. And calculating key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys.
The method specifically includes the steps of calculating key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys, wherein the key values comprise: and respectively taking each key in the plurality of keys as a target key, and calculating a key value of the target key according to row line coordinates and column line coordinates of the target key.
Further, calculating the key value of the target key according to the row line coordinate and the column line coordinate of the target key may include: calculating the sum of the row line coordinates of the target key and the column line coordinates of the target key; and taking the sum value as a key value of the target key. Taking the column line coordinates and the row line coordinates of the target key as 6 and 3, respectively as an example, the key value of the target key is 6+3=9.
103. And performing key mapping on the plurality of keys according to the key values of the plurality of keys to obtain target key events corresponding to the plurality of keys.
The key value of each key corresponds to the key (physical key value) of the bottom layer, for example, a certain key value is 9, and corresponds to the bottom layer physical key S9, but in a specific application scene of the electronic device, the key value needs to be analyzed and mapped into various key values of the upper layer, for example, S22 is a key a of the bottom layer, and is mapped to a left key of an upper game interface, but is possibly a numeric key of the main interface, which is a common key design scheme, the physical layer obtains the truest key event, and the upper layer maps more and richer key functions according to the interface where the user is located. And then, after the key values are analyzed and mapped into various upper-layer key values, target key events corresponding to a plurality of keys (upper-layer key values) are acquired.
104. And executing the target key event.
Specifically, a specific module of the electronic device needs to perform corresponding processing on the target key event, for example, it is assumed that a plurality of keys are respectively S16, S24 and S32, and correspond to top keys of Ctrl, alt and Delete respectively, and a user presses the top keys at the same time and can set to enter a lock screen; and supposing that the three combination keys correspond to the roles of the game interface, the functions of the peep-proof function can be used, and then the peep-proof function can be played in combination with other conditions, so that the entertainment and the user experience of the mobile phone are improved.
In some embodiments of the present application, after one key event processing is completed, the initialization state needs to be restored, and the key interrupt event is waited for triggering, that is, the multi-key detection method may further include: after the target key event is executed, a key row line mode is reinitialized to configure the plurality of key row lines to output a low level mode and the plurality of key row lines to be configured to a low level interrupt trigger mode.
According to the embodiment of the application, the values of all key points can be read at one time, the key values do not need to be read from a register, the key detection speed is improved, the method and the device can be seamlessly combined with a native mechanism, and the code stability and portability are strong.
In order to better implement the multi-key detection method according to the embodiment of the present application, on the basis of the multi-key detection method, the embodiment of the present application further provides a multi-key detection device, where the multi-key detection device is applied to an electronic device, and the electronic device includes a key matrix formed by the plurality of key row lines and the plurality of key row lines, where the plurality of key row lines are configured to output a low-level mode, and the plurality of key row lines are configured to output a low-level interrupt trigger mode, as shown in fig. 3, and the multi-key detection device 300 includes:
a first obtaining unit 301, configured to obtain row line coordinates and column line coordinates of a plurality of keys when the plurality of keys are pressed in the electronic device;
a calculating unit 302, configured to calculate key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys;
a second obtaining unit 303, configured to perform key mapping on the plurality of keys according to key values of the plurality of keys, and obtain target key events corresponding to the plurality of keys;
and the execution unit 304 is configured to execute the target key event.
In some embodiments of the present application, the multi-key detection apparatus 300 further includes:
a configuration unit, configured to configure the plurality of key row lines to output a low level mode before a plurality of keys are pressed in the electronic device; and configuring the plurality of key column lines into a low-level interrupt trigger mode.
In some embodiments of the present application, the first obtaining unit 301 is specifically configured to:
when a plurality of keys in the electronic equipment are pressed, determining a target key column line for detecting the pressing of the keys;
traversing and detecting all keys corresponding to the target key column line, and determining the keys which are detected to be pressed down as the plurality of keys;
and acquiring row line coordinates and column line coordinates of the plurality of keys.
In some embodiments of the present application, the first obtaining unit 301 is specifically configured to:
when a plurality of keys in the electronic equipment are pressed, determining a target key column line outputting low level;
and storing the key column line value corresponding to the target key column line in a preset array, and marking the number of key column lines in the target key column line.
In some embodiments of the application, the configuration unit is further configured to: after the target key event is executed, a key row line mode is reinitialized to configure the plurality of key row lines to output a low level mode and the plurality of key row lines to be configured to a low level interrupt trigger mode.
The embodiment of the application also provides an electronic device, which comprises a key matrix formed by the plurality of key column lines and the plurality of key row lines, wherein the plurality of key row lines are configured to output a low-level mode, the plurality of key column lines are configured to output a low-level interrupt trigger mode, and the electronic device further comprises:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor as steps in any of the above-described multi-key detection method embodiments.
Accordingly, an embodiment of the present application also provides an electronic device, as shown in fig. 4, where the electronic device may include a Radio Frequency (RF) circuit 401, a memory 402 including one or more computer readable storage media, an input unit 403, a display unit 404, a sensor 405, an audio circuit 406, a wireless fidelity (WiFi, wireless Fidelity) module 407, a processor 408 including one or more processing cores, and a power supply 409. Those skilled in the art will appreciate that the electronic device structure shown in fig. 4 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components. Wherein:
the RF circuit 401 may be used for receiving and transmitting signals during the process of receiving and transmitting information or communication, in particular, after receiving downlink information of a base station, the downlink information is processed by one or more processors 408; in addition, data relating to uplink is transmitted to the base station. Typically, RF circuitry 401 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM, subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 401 may also communicate with networks and other devices through wireless communications. The wireless communication may use any communication standard or protocol including, but not limited to, global system for mobile communications storage (GSM, global System of Mobile communication), general packet radio service (GPRS, general Packet Radio Service), code division multiple access (CDMA, code Division Multiple Access), wideband code division multiple access (WCDMA, wideband Code Division Multiple Access), long term evolution (LTE, long Term Evolution), email, short message service (SMS, short Messaging Service), and the like.
The memory 402 may be used to store software programs and modules, and the processor 408 may execute various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store a storage medium, an application program (such as a sound playing function, an image playing function, etc.) required for operating at least one function, and the like; the storage data area may store data created according to the use of the electronic device (such as audio data, phonebooks, etc.), and the like. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide access to the memory 402 by the processor 408 and the input unit 403.
The input unit 403 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, input unit 403 may include a touch-sensitive surface, as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations thereon or thereabout by a user using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. Alternatively, the touch-sensitive surface may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 408, and can receive commands from the processor 408 and execute them. In addition, touch sensitive surfaces may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface, the input unit 403 may also comprise other input devices. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 404 may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of the electronic device, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 404 may include a display panel, which may be optionally configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay a display panel, and upon detection of a touch operation thereon or thereabout, the touch-sensitive surface is communicated to the processor 408 to determine a type of touch event, and the processor 408 then provides a corresponding visual output on the display panel based on the type of touch event. Although in fig. 4 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement the input and output functions.
The electronic device may also include at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. In particular, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or backlight when the electronic device is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the electronic device are not described in detail herein.
Audio circuitry 406, speakers, and a microphone may provide an audio interface between the user and the electronic device. The audio circuit 406 may transmit the received electrical signal after audio data conversion to a speaker, where the electrical signal is converted to a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 406 and converted into audio data, which are processed by the audio data output processor 408 for transmission via the RF circuit 401 to, for example, another electronic device, or for output to the memory 402 for further processing. Audio circuitry 406 may also include an ear bud jack to provide communication of the peripheral headphones with the electronic device.
WiFi belongs to a short-distance wireless transmission technology, and the electronic equipment can help a user to send and receive emails, browse webpages, access streaming media and the like through the WiFi module 407, so that wireless broadband Internet access is provided for the user. Although fig. 4 shows a WiFi module 407, it is understood that it does not belong to the necessary constitution of the electronic device, and can be omitted entirely as required within a range that does not change the essence of the application.
The processor 408 is a control center of the electronic device that uses various interfaces and lines to connect the various parts of the overall handset, performing various functions of the electronic device and processing the data by running or executing software programs and/or modules stored in the memory 402, and invoking data stored in the memory 402, thereby performing overall monitoring of the handset. Optionally, the processor 408 may include one or more processing cores; preferably, the processor 408 may integrate an application processor that primarily processes operating storage media, user interfaces, applications, etc., with a modem processor that primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 408.
The electronic device also includes a power supply 409 (e.g., a battery) that powers the various components, preferably logically connected to the processor 408 through a power management storage medium, whereby the functions of managing charging, discharging, and power consumption are performed through the power management storage medium. The power supply 409 may also include one or more of any of a direct current or alternating current power supply, a rechargeable storage medium, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the electronic device may further include a camera, a bluetooth module, etc., which will not be described herein. In particular, in this embodiment, the processor 408 in the electronic device loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 408 executes the application programs stored in the memory 402, so as to implement various functions.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the multi-key detection methods provided by the embodiments of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
The above description of the multi-key detection method, the device, the electronic equipment and the storage medium provided by the embodiment of the present application applies specific examples to illustrate the principles and the implementation of the present application, and the above description of the embodiment is only used to help understand the method and the core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.

Claims (7)

1. A multi-key detection method, which is applied to an electronic device, wherein the electronic device includes a key matrix formed by a plurality of key column lines and a plurality of key row lines, the plurality of key row lines are configured to output a low-level mode, the plurality of key column lines are configured to output a low-level interrupt trigger mode, and when a key in the electronic device is pressed, the corresponding key column lines output a low level, the multi-key detection method includes:
when a plurality of keys in the electronic equipment are pressed, acquiring row line coordinates and column line coordinates of the keys;
calculating key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys;
performing key mapping on the plurality of keys according to key values of the plurality of keys to obtain target key events corresponding to the plurality of keys;
executing the target key event;
when a plurality of keys in the electronic device are pressed, acquiring row line coordinates and column line coordinates of the plurality of keys comprises:
when a plurality of keys in the electronic equipment are pressed, determining a target key column line outputting low level;
storing the key column line value corresponding to the target key column line in a preset array, and marking the number of key column lines in the target key column line;
traversing and detecting all keys corresponding to the target key column line, and determining the keys which are detected to be pressed down as the plurality of keys;
and acquiring row line coordinates and column line coordinates of the plurality of keys.
2. The multi-key detection method of claim 1, wherein before a plurality of keys are pressed in the electronic device, the method further comprises:
configuring the plurality of key row lines to output a low level mode;
and configuring the plurality of key column lines into a low-level interrupt trigger mode.
3. The multi-key detection method of claim 1, wherein the method further comprises:
after the target key event is executed, a key row line mode is reinitialized to configure the plurality of key row lines to output a low level mode and the plurality of key row lines to be configured to a low level interrupt trigger mode.
4. A multi-key detection apparatus, for use in an electronic device, the electronic device including a key matrix formed by a plurality of key column lines and a plurality of key row lines, the plurality of key row lines configured to output a low level mode, the plurality of key column lines configured to output a low level interrupt trigger mode, the multi-key detection apparatus comprising:
the first acquisition unit is used for acquiring row line coordinates and column line coordinates of a plurality of keys when the plurality of keys in the electronic equipment are pressed;
a calculating unit, configured to calculate key values of the plurality of keys according to row line coordinates and column line coordinates of the plurality of keys;
the second obtaining unit is used for carrying out key mapping on the plurality of keys according to the key values of the plurality of keys to obtain target key events corresponding to the plurality of keys;
the execution unit is used for executing the target key event;
the first obtaining unit is specifically configured to:
when a plurality of keys in the electronic equipment are pressed, determining a target key column line outputting low level;
storing the key column line value corresponding to the target key column line in a preset array, and marking the number of key column lines in the target key column line;
traversing and detecting all keys corresponding to the target key column line, and determining the keys which are detected to be pressed down as the plurality of keys;
and acquiring row line coordinates and column line coordinates of the plurality of keys.
5. The multi-key detection apparatus according to claim 4, wherein the multi-key detection apparatus further comprises:
a configuration unit, configured to configure the plurality of key row lines to output a low level mode before a plurality of keys are pressed in the electronic device; and configuring the plurality of key column lines into a low-level interrupt trigger mode.
6. An electronic device, wherein the electronic device includes a key matrix formed by a plurality of key row lines and a plurality of key row lines, the plurality of key row lines are configured to output a low level mode, the plurality of key row lines are configured to output a low level interrupt trigger mode, and when a key in the electronic device is pressed, the corresponding key row lines output a low level, the electronic device further includes:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor as steps in the multi-key detection method of any one of claims 1 to 3.
7. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the multi-key detection method of any one of claims 1 to 3.
CN201910360925.XA 2019-04-30 2019-04-30 Multi-key detection method and device, electronic equipment and storage medium Active CN110109788B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910360925.XA CN110109788B (en) 2019-04-30 2019-04-30 Multi-key detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910360925.XA CN110109788B (en) 2019-04-30 2019-04-30 Multi-key detection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110109788A CN110109788A (en) 2019-08-09
CN110109788B true CN110109788B (en) 2023-11-10

Family

ID=67487739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910360925.XA Active CN110109788B (en) 2019-04-30 2019-04-30 Multi-key detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110109788B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111077401B (en) * 2020-01-15 2022-05-03 广州三晶电气股份有限公司 Keyboard testing method, device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010025777A (en) * 1999-09-01 2001-04-06 이형도 Method of processing multi-key in key inputting device
CN2454821Y (en) * 2000-06-19 2001-10-17 深圳华强通讯有限公司 Heat-key-mode text-data processing apparatus capable of supporting multi-key processing
JP2009004889A (en) * 2007-06-19 2009-01-08 Fujitsu Ltd Key control circuit, electronic apparatus, portable device, and key control method
CN101493728A (en) * 2008-01-24 2009-07-29 中兴通讯股份有限公司 Line control push-button detecting and recognizing device and method capable of identifying combined key
CN102088502A (en) * 2011-01-26 2011-06-08 惠州Tcl移动通信有限公司 Full-keyboard extended circuit for mobile phone and key scanning method of expanded circuit
CN104331170A (en) * 2014-10-30 2015-02-04 北京海兰盈华科技有限公司 Method and device for realizing combined key in matrix keyboard
CN106646212A (en) * 2016-12-13 2017-05-10 珠海市杰理科技股份有限公司 Multi-button detection device and detection method
CN107872230A (en) * 2017-08-25 2018-04-03 广州飞达音响股份有限公司 A kind of scanning detecting circuit and method of detectable multiple any combination buttons

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010025777A (en) * 1999-09-01 2001-04-06 이형도 Method of processing multi-key in key inputting device
CN2454821Y (en) * 2000-06-19 2001-10-17 深圳华强通讯有限公司 Heat-key-mode text-data processing apparatus capable of supporting multi-key processing
JP2009004889A (en) * 2007-06-19 2009-01-08 Fujitsu Ltd Key control circuit, electronic apparatus, portable device, and key control method
CN101493728A (en) * 2008-01-24 2009-07-29 中兴通讯股份有限公司 Line control push-button detecting and recognizing device and method capable of identifying combined key
CN102088502A (en) * 2011-01-26 2011-06-08 惠州Tcl移动通信有限公司 Full-keyboard extended circuit for mobile phone and key scanning method of expanded circuit
CN104331170A (en) * 2014-10-30 2015-02-04 北京海兰盈华科技有限公司 Method and device for realizing combined key in matrix keyboard
CN106646212A (en) * 2016-12-13 2017-05-10 珠海市杰理科技股份有限公司 Multi-button detection device and detection method
CN107872230A (en) * 2017-08-25 2018-04-03 广州飞达音响股份有限公司 A kind of scanning detecting circuit and method of detectable multiple any combination buttons

Also Published As

Publication number Publication date
CN110109788A (en) 2019-08-09

Similar Documents

Publication Publication Date Title
CN107193664B (en) Message display method and device and mobile terminal
AU2018273505B2 (en) Method for capturing fingerprint and associated products
CN107172267B (en) Fingerprint identification control method and related product
CN108834132B (en) Data transmission method and equipment and related medium product
CN110879680B (en) Icon management method and electronic equipment
TW201516844A (en) Apparatus and method for selecting object
US10324134B2 (en) Method and device for ascertaining required charging time
JP6974620B2 (en) Notification message processing method and terminal
CN106934003B (en) File processing method and mobile terminal
CN110602766B (en) Personal hotspot identification method and method for determining association relationship between terminals
CN110109788B (en) Multi-key detection method and device, electronic equipment and storage medium
CN106293407B (en) Picture display method and terminal equipment
CN106547400B (en) Method, device and terminal for reporting information
CN106777383B (en) File sorting method and intelligent terminal
CN110908586A (en) Keyboard display method and device and terminal equipment
CN111966206B (en) Power saving control method and device for fingerprint sensor and mobile terminal
CN111314900B (en) Wireless connection method, wireless connection device and mobile terminal
CN109582240B (en) Data moving method and related equipment thereof
US20170366654A1 (en) Dialing Method for User Terminal and User Terminal
CN106657278B (en) Data transmission method and device and computer equipment
CN108322600B (en) Network access method and mobile terminal
CN108073508B (en) Compatibility detection method and device
CN112199049B (en) Fingerprint storage method, fingerprint storage device and terminal
CN112214699A (en) Page processing method and related device
CN111954193B (en) Bluetooth equipment connection detection method and device and mobile terminal

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
GR01 Patent grant
GR01 Patent grant