WO2019007394A1 - 按键消抖方法及装置、包含机械键的设备、存储介质 - Google Patents
按键消抖方法及装置、包含机械键的设备、存储介质 Download PDFInfo
- Publication number
- WO2019007394A1 WO2019007394A1 PCT/CN2018/094647 CN2018094647W WO2019007394A1 WO 2019007394 A1 WO2019007394 A1 WO 2019007394A1 CN 2018094647 W CN2018094647 W CN 2018094647W WO 2019007394 A1 WO2019007394 A1 WO 2019007394A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- button
- timing
- mechanical key
- circuit
- key
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K17/00—Electronic switching or gating, i.e. not by contact-making and –breaking
- H03K17/22—Modifications for ensuring a predetermined initial state when the supply voltage has been applied
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K2217/00—Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00
- H03K2217/94—Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00 characterised by the way in which the control signal is generated
- H03K2217/9401—Calibration techniques
Definitions
- the present disclosure relates to the field of communications technologies, and in particular, to a button debounce method and apparatus, a device including a mechanical key, and a storage medium.
- Mechanical keys are widely used in various control devices. Since the key signals indicating that the mechanical keys are pressed are mechanically triggered, the key signals are always burred due to mechanical vibration of the keys.
- One way to deal with the glitch appearing in the button signal is to judge the state of the button, delay the time after the judgment button is pressed, and judge the state of the button again, if the button is still pressed, The button responds.
- the above processing method has the following disadvantages: First, since the state of the key is judged again after the delay is required, the key response cannot be immediately performed; second, the state of the two keys needs to be judged, and the complexity is increased; The state of the key may still be unstable, resulting in a false positive.
- the present disclosure provides a button debounce method, including the steps of: detecting a button signal generated by a circuit in which a mechanical key is located; when detecting the button signal, the timer is reset and starting timing; determining whether the timer time of the timer is reached a preset time threshold; and if the time of the timer reaches a preset time threshold, preparing to detect the next key signal generated by the circuit in which the mechanical key is located.
- the present disclosure provides a button debounce device, comprising: a detection module configured to detect a button signal generated by a circuit in which the mechanical key is located; and a timing module configured to reset and start timing when the detection module detects the button signal;
- the determining module is configured to determine whether the timing of the timing module reaches a preset time threshold, wherein if the timing of the timing module reaches a preset time threshold, the detecting module is prepared to detect the circuit generated by the mechanical key Next button signal.
- the present disclosure also provides an apparatus including a mechanical key including a mechanical key, a timer, a memory, and a processor, the mechanical key being disposed in the circuit, and the circuit in which the mechanical key is located is configured to be pressed according to the mechanical key
- the lower state generates a button signal that is configured to reset and begin timing when a circuit in which the mechanical key is detected generates a button signal
- the memory being configured to store a program
- the processor executing the program to execute The button debounce method provided by the present disclosure.
- the present disclosure also provides a computer readable storage medium storing a computer executable program that is executed by a computer to implement the button debounce method provided by the present disclosure.
- FIG. 1 is a schematic flow chart of a button debounce method according to an embodiment of the present disclosure
- FIG. 2 is a schematic flow chart of a button response according to an embodiment of the present disclosure
- FIG. 3 is a block diagram of an apparatus to which a button debounce method of an embodiment of the present disclosure is applied;
- FIG. 4 is a block diagram of a button debounce device of an embodiment of the present disclosure.
- module may be implemented by hardware, software, or a combination thereof, which may include, for example, a processor, an integrated circuit, or the like.
- FIG. 1 is a flow chart showing a button debounce method of an embodiment of the present disclosure. As shown in FIG. 1, the button debounce method may include the following steps 110 to 140.
- Step 110 Detect a button signal generated by a circuit in which the mechanical key is located.
- the circuit in which the mechanical key is triggered generates a key signal.
- the key signal may be either a high level or a low level as needed, but the disclosure is not limited thereto.
- the following is an example in which the key signal generated by the circuit in which the mechanical key is pressed and the mechanical key is triggered is high.
- the button response may be performed according to the button signal immediately after detecting the button signal, that is, the corresponding operation is performed.
- Step 120 when the button signal is detected, the timer is reset and timing is started.
- the timer is reset to 0 and timing is started.
- Step 130 Determine whether the time counted by the timer reaches a preset time threshold.
- step 140 is entered, and if the timer time of the timer does not reach the preset time threshold, then step 130 is continued.
- the time threshold is a maximum time of the timer, which may be preset as a minimum time interval for detecting two consecutive key signals. Those skilled in the art can understand the time threshold as the minimum time interval during which the user presses the mechanical key twice. If the timer time of the timer reaches a preset time threshold, it indicates that the high level generated by the circuit where the mechanical key is located is largely a button signal generated by the circuit in which the user presses the mechanical key to trigger the mechanical key. Thus, proceeding to step 140, if the timing of the timer has not reached the preset time threshold, then the high level that the circuit in which the mechanical key is located will be largely a glitch signal, so step 130 is continued.
- the high level generated by the circuit where the mechanical key is located after the button signal and before the timer time of the timer reaches the preset time threshold is regarded as a glitch signal.
- the timer when the timer time of the timer reaches a preset time threshold, the timer can stop timing.
- the time threshold may be set to 20 milliseconds, and the time threshold may be set to other values, which is not specifically limited herein.
- Step 140 preparing to detect the next key signal generated by the circuit in which the mechanical key is located.
- the timing of the timer reaches a preset time threshold, it indicates that the high level generated by the circuit where the mechanical key is located is largely generated by the circuit in which the user presses the mechanical key to trigger the mechanical key.
- the button signal therefore, can be prepared to detect the next button signal generated by the circuit in which the mechanical key is located.
- button debounce method of the embodiment of the present disclosure may be executed cyclically, that is, after step 140, may return to step 110.
- a rising edge from a low level to a high level generated by a circuit in which the mechanical key is located may be detected as a key signal generated by a circuit in which the mechanical key is located.
- FIG. 2 shows a flow chart of a button response of an embodiment of the present disclosure.
- the button debounce method of the embodiment of the present disclosure may further include: Step 150, after detecting the button signal, immediately perform a button response according to the button signal.
- step 150 may be performed concurrently with step 120.
- FIG. 3 shows a block diagram of an apparatus including mechanical keys applying a key debounce method of an embodiment of the present disclosure.
- a device including a mechanical key to which a button debounce method of an embodiment of the present disclosure is applied may include a mechanical key, a timer, a memory, and a processor.
- the mechanical key is disposed in the circuit, and the circuit in which the mechanical key is located is configured to generate a key signal in accordance with a state in which the mechanical key is pressed.
- the timer is configured to reset and begin timing when it is detected that the circuit in which the mechanical key is located generates a key signal.
- the memory is configured to store a program that implements the button debounce method of an embodiment of the present disclosure.
- the processor executes a program stored by the memory to perform a button debounce method of an embodiment of the present disclosure.
- the device including the mechanical key to which the button debounce method of the embodiment of the present disclosure is applied may include a field programmable gate array, a single chip microcomputer, a terminal, or the like.
- the terminal may include, for example, a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a personal digital assistant (PDA), a portable media player (PMP), a navigation device, a wearable device, a smart hand.
- PDA personal digital assistant
- PMP portable media player
- Mobile terminals such as rings, pedometers, and the like, and fixed terminals such as digital TVs, desktop computers, and the like.
- the button debounce method of the embodiment of the present disclosure and the device including the mechanical key of the button debounce method of the embodiment of the present disclosure detect a button signal, and when the button signal is detected, reset the timer and start timing, when When the timer time reaches the preset time threshold, it is ready to detect the next key signal, and the signal similar to the key signal generated by the circuit where the mechanical key is located in the period when the timer starts to reach the preset time threshold. It is regarded as a glitch signal. Therefore, it does not detect and respond to the glitch signal, effectively avoiding the influence of the glitch signal and functioning as a button debounce.
- FIG. 4 shows a block diagram of a button debounce device of an embodiment of the present disclosure.
- the button debounce device of the embodiment of the present disclosure may include a detection module 410, a timing module 420, and a determination module 430.
- the detection module 410 is configured to detect a key signal generated by a circuit in which the mechanical key is located.
- the circuit that triggers the mechanical key when the user presses the mechanical key and the pressing operation is an effective operation, the circuit that triggers the mechanical key generates a key signal, and the detecting module 410 is configured to detect the key signal.
- the key signal may be a high level or a low level as needed, but the present disclosure is not limited thereto.
- the following is an example in which the key signal generated by the circuit in which the mechanical key is pressed and the mechanical key is triggered is high.
- the timing module 420 is configured to reset and begin timing when the detection module 410 detects the key signal.
- the timing module 420 resets to zero and begins timing.
- the determining module 430 is configured to determine whether the timing time of the timing module 420 reaches a preset time threshold.
- timing of the timing module 420 reaches a preset time threshold, it indicates that the high level generated by the circuit where the mechanical key is located is largely a button generated by the circuit in which the user presses the mechanical key to trigger the mechanical key. The signal, therefore, detection module 420 can begin detecting the next key signal generated by the circuit in which the mechanical key is located. If the timing of the timing module 420 does not reach the preset time threshold, it indicates that the high level that the circuit where the mechanical key is located will be a glitch signal, and therefore, the glitch signal will not be detected and responded.
- the time threshold is a maximum timing of the timing module 420, which may be preset to detect a minimum time interval of two consecutive key signals. Those skilled in the art can understand the time threshold as the minimum time interval during which the user presses the mechanical key twice.
- the high level generated by the circuit where the mechanical key is located after the button signal and before the timer time of the timer reaches the preset time threshold is regarded as a glitch signal.
- the timing module 420 may stop timing when the timing time of the timing module 420 reaches a preset time threshold.
- the time threshold may be set to 20 milliseconds, and the time threshold may be set to other values, which is not specifically limited herein.
- the button debounce device of the embodiment of the present disclosure may further include a button response module 440 configured to perform a button response according to the button signal immediately after detecting the button signal detected by the module 410. That is, the corresponding operation is performed.
- a button response module 440 configured to perform a button response according to the button signal immediately after detecting the button signal detected by the module 410. That is, the corresponding operation is performed.
- the detecting module 410 may detect a rising edge from a low level to a high level generated by a circuit in which the mechanical key is located as a key signal generated by a circuit in which the mechanical key is located.
- the button debounce device of the embodiment of the present disclosure can be applied to an FPGA, a single chip microcomputer, a terminal, or the like.
- the terminal may include a mobile terminal such as a mobile phone, a tablet, a notebook computer, a palmtop computer, a PDA, a PMP, a navigation device, a wearable device, a smart bracelet, a pedometer, and the like, and a fixed terminal such as a digital TV, a desktop computer, or the like.
- the detecting module 410 detects the button signal, and when the detecting module 410 detects the button signal, the timing module 420 resets and starts timing, and when the determining module 430 determines the timing of the timing module 420.
- the detecting module 420 may start detecting the next key signal, and the signal similar to the key signal generated by the circuit where the mechanical key is located in the time period when the timing module 420 starts to reach the preset time threshold. It is regarded as a glitch signal. Therefore, it does not detect and respond to the glitch signal, effectively avoiding the influence of the glitch signal and functioning as a button debounce.
- Embodiments of the present disclosure also provide a computer readable storage medium having stored therein a computer executable program that is executed by a computer to implement key cancellation of an embodiment of the present disclosure. Shake method.
- the computer readable storage medium may include volatile memory such as random access memory and nonvolatile memory such as read only memory, flash memory, or hard disk.
- the technical solutions of the foregoing embodiments may be implemented by software, hardware, or a combination of software and general hardware.
- the technical solution of the above embodiment may be provided in the form of a software product including computer executable instructions, and may be stored in a storage medium (such as a ROM/RAM, a magnetic disk, an optical disk), and a computer-enabled device (for example, a terminal, a server, or the like) executes computer-executable instructions in a software product to implement the technical solutions of the above embodiments.
Landscapes
- Telephone Function (AREA)
- Input From Keyboards Or The Like (AREA)
Abstract
按键消抖方法及装置、包含机械键的设备、及存储介质。所述按键消抖方法包括步骤:检测机械键所在的电路产生的按键信号(110);当检测到所述按键信号时,计时器复位并开始计时(120);判断计时器的计时时间是否达到预设的时间阈值(130);以及如果所述计时器的计时时间达到预设的时间阈值,准备检测机械键所在的电路产生的下一按键信号(140)。
Description
本公开涉及通信技术领域,尤其涉及按键消抖方法及装置、包含机械键的设备、存储介质。
机械键在各种控制设备中被广泛应用,由于表明机械键被按下的按键信号是通过机械方式触发而产生的,因此按键信号总是由于键的机械抖动而出现毛刺。
对按键信号中出现的毛刺的一种处理方法是:判断键的状态,在判断键被按下后,延时一段时间,再次判断键的状态,如果键仍然为被按下的状态,才进行按键响应。
但上述处理方法有下面不足:一、因为需要延时后再次判断键的状态,所以不能立即进行按键响应;二、需要判断两次键的状态,增加了复杂度;三、即使经过一段延时,键的状态仍然有可能不稳定,从而造成误判。
公开内容
本公开提供一种按键消抖方法,包括步骤:检测机械键所在的电路产生的按键信号;当检测到所述按键信号时,计时器复位并开始计时;判断所述计时器的计时时间是否达到预设的时间阈值;以及如果所述计时器的计时时间达到预设的时间阈值,准备检测机械键所在的电路产生的下一按键信号。
本公开提供一种按键消抖装置,包括:检测模块,配置为检测机械键所在的电路产生的按键信号;计时模块,配置为当检测模块检测到所述按键信号时,复位并开始计时;以及判断模块,配置为判断所述计时模块的计时时间是否达到预设的时间阈值,其中如果所述计 时模块的计时时间达到预设的时间阈值,所述检测模块准备检测机械键所在的电路产生的下一按键信号。
本公开还提供一种包含机械键的设备,包括机械键、计时器、存储器和处理器,所述机械键设置在电路中,并且所述机械键所在的电路配置为根据所述机械键被按下的状态产生按键信号,所述计时器配置为当检测到所述机械键所在的电路产生按键信号时复位并开始计时,所述存储器配置为存储程序,所述处理器执行所述程序以执行本公开所提供的按键消抖方法。
本公开还提供一种计算机可读存储介质,其存储有计算机可执行程序,所述计算机可执行程序被计算机执行,以实现本公开所提供的按键消抖方法。
图1为本公开的实施例的按键消抖方法的流程示意图;
图2为本公开的实施例的按键响应的流程示意图;
图3为应用本公开的实施例的按键消抖方法的设备的框图;
图4为本公开的实施例的按键消抖装置的框图。
以下将参照附图和具体实施例对本公开的技术方案进行详细描述。应当理解,具体实施例仅用以解释本公开,并不用于限定本公开。
后续的描述中使用的术语“模块”可以通过硬件、软件或其结合实现,所述硬件例如可以包括处理器、集成电路等。
图1示出了本公开的实施例的按键消抖方法的流程示意图。如图1所示,所述按键消抖方法可包括以下步骤110至140。
步骤110,检测机械键所在的电路产生的按键信号。
具体地,当用户按压机械键、且该按压操作为有效操作时,触发机械键所在的电路产生按键信号。
根据需要,按键信号可以是高电平,也可以是低电平,但是本 公开不限于此。以下以机械键被按下而触发机械键所在的电路产生的按键信号是高电平为例进行说明。
此外,根据需要,可以在检测到所述按键信号后立即根据所述按键信号进行按键响应,即执行对应的操作。
步骤120,当检测到所述按键信号时,计时器复位并开始计时。
具体地,当检测到机械键所在的电路产生高电平时,计时器复位为0并开始计时。
步骤130,判断所述计时器的计时时间是否达到预设的时间阈值。
如果所述计时器的计时时间达到预设的时间阈值,则进入步骤140,如果所述计时器的计时时间未达到预设的时间阈值,则继续步骤130。
具体地,所述时间阈值为所述计时器的最大计时时间,其可以预设为检测连续的两次按键信号的最小时间间隔。本领域技术人员可以将所述时间阈值理解为用户连续两次按下机械键的最小时间间隔。如果所述计时器的计时时间达到预设的时间阈值,则说明之后机械键所在的电路将产生的高电平很大程度上为用户按下机械键而触发机械键所在的电路产生的按键信号,因此进入步骤140,如果所述计时器的计时时间未达到预设的时间阈值,则说明之后机械键所在的电路将产生的高电平很大程度上是毛刺信号,因此继续步骤130。
本实施例中,机械键所在的电路在所述按键信号之后且在所述计时器的计时时间达到预设的时间阈值之前产生的高电平均被视为毛刺信号。
此外,本实施例中,当计时器的计时时间达到预设的时间阈值时,计时器可以停止计时。
作为示例,可以将所述时间阈值设置为20毫秒,也可以将所述时间阈值设为其他数值,在此不作具体限制。
步骤140,准备检测机械键所在的电路产生的下一按键信号。
具体地,如果所述计时器的计时时间达到预设的时间阈值,则说明之后机械键所在的电路将产生的高电平很大程度上为用户按下机械键而触发机械键所在的电路产生的按键信号,因此,可以准备检 测机械键所在的电路产生的下一按键信号。
需要说明的是,根据需要,本公开的实施例的按键消抖方法可以循环执行,即,在步骤140之后可返回至步骤110。
应该理解的是,本实施例中,例如,可以检测机械键所在的电路产生的从低电平到高电平的上升沿作为机械键所在的电路产生的按键信号。
图2示出了本公开的实施例的按键响应的流程示意图。
如图2所示,本公开的实施例的按键消抖方法还可包括:步骤150,在检测到所述按键信号后,立即根据所述按键信号进行按键响应。
应当理解的是,本实施例中,步骤150可与步骤120同时执行。
图3示出了应用本公开的实施例的按键消抖方法的包含机械键的设备的框图。
如图3所示,应用本公开的实施例的按键消抖方法的包含机械键的设备可包括机械键、计时器、存储器和处理器。
所述机械键设置在电路中,并且所述机械键所在的电路配置为根据所述机械键被按下的状态产生按键信号。
所述计时器配置为,当检测到所述机械键所在的电路产生按键信号时,复位并开始计时。
所述存储器配置为存储实现本公开的实施例的按键消抖方法的程序。
所述处理器执行所述存储器所存储的程序,以执行本公开的实施例的按键消抖方法。
应用本公开的实施例的按键消抖方法的包含机械键的设备可以包括现场可编程门阵列、单片机、终端等。所述终端可以包括诸如手机、平板电脑、笔记本电脑、掌上电脑、个人数字助理(Personal Digital Assistant,PDA)、便捷式媒体播放器(Portable Media Player,PMP)、导航装置、可穿戴设备、智能手环、计步器等的移动终端以及诸如数字TV、台式计算机等的固定终端。
本公开的实施例的按键消抖方法及应用本公开的实施例的按键 消抖方法的包含机械键的设备中,检测按键信号,并当检测到按键信号时使计时器复位并开始计时,当计时器的计时时间达到预设的时间阈值时,则准备检测下一按键信号,由于将计时器开始计时至达到预设的时间阈值的时段内机械键所在的电路所产生的类似按键信号的信号视为毛刺信号,因此,不对毛刺信号进行检测及响应,有效地避免了毛刺信号的影响,起到了按键消抖的作用。
图4示出了本公开的实施例的按键消抖装置的框图。如图4所示,本公开的实施例的按键消抖装置可包括检测模块410、计时模块420和判断模块430。
检测模块410配置为检测机械键所在的电路产生的按键信号。
具体地,当用户按压机械键、且该按压操作为有效操作时,触发机械键所在的电路产生按键信号,检测模块410配置为检测该按键信号。
根据需要,按键信号可以是高电平,也可以是低电平,但是本公开不限于此。以下以机械键被按下而触发机械键所在的电路产生的按键信号是高电平为例进行说明。
计时模块420配置为当检测模块410检测到所述按键信号时,复位并开始计时。
具体地,当检测模块410检测到机械键所在的电路产生高电平时,计时模块420复位为0并开始计时。
判断模块430配置为判断所述计时模块420的计时时间是否达到预设的时间阈值。
如果所述计时模块420的计时时间达到预设的时间阈值,则说明之后机械键所在的电路将产生的高电平很大程度上为用户按下机械键而触发机械键所在的电路产生的按键信号,因此,检测模块420可开始检测机械键所在的电路产生的下一按键信号。如果所述计时模块420的计时时间未达到预设的时间阈值,则说明之后机械键所在的电路将产生的高电平很大程度上是毛刺信号,因此,将不对毛刺信号进行检测及响应。
具体地,所述时间阈值为所述计时模块420的最大计时时间,其可以预设为检测连续的两次按键信号的最小时间间隔。本领域技术人员可以将所述时间阈值理解为用户连续两次按下机械键的最小时间间隔。
本实施例中,机械键所在的电路在所述按键信号之后且在所述计时器的计时时间达到预设的时间阈值之前产生的高电平均被视为毛刺信号。
此外,本实施例中,当计时模块420的计时时间达到预设的时间阈值时,计时模块420可以停止计时。
作为示例,可以将所述时间阈值设置为20毫秒,也可以将所述时间阈值设为其他数值,在此不作具体限制。
根据需要,如图2所示,本公开的实施例的按键消抖装置还可包括按键响应模块440,其配置为在检测模块410检测到的按键信号后立即根据所述按键信号进行按键响应,即执行对应的操作。
应该理解的是,本实施例中,例如,检测模块410可以检测机械键所在的电路产生的从低电平到高电平的上升沿作为机械键所在的电路产生的按键信号。
本公开的实施例的按键消抖装置可以应用于FPGA、单片机、终端等。所述终端可以包括诸如手机、平板电脑、笔记本电脑、掌上电脑、PDA、PMP、导航装置、可穿戴设备、智能手环、计步器等的移动终端以及诸如数字TV、台式计算机等的固定终端。
本公开的实施例提供的按键消抖装置中,检测模块410检测按键信号,并当检测模块410检测到按键信号时,计时模块420复位并开始计时,当判断模块430判断计时模块420的计时时间达到预设的时间阈值时,则检测模块420可开始检测下一按键信号,由于将计时模块420开始计时至达到预设的时间阈值的时段内机械键所在的电路所产生的类似按键信号的信号视为毛刺信号,因此,不对毛刺信号进行检测及响应,有效地避免了毛刺信号的影响,起到了按键消抖的作用。
本公开的实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机可执行程序,所述计算机可执行程序被计算机执行以实现本公开的实施例的按键消抖方法。所述计算机可读存储介质可以包括诸如随机存取存储器的易失性存储器以及诸如只读存储器、闪存、或硬盘的非易失性存储器。
需要说明的是,本公开中的术语“包括”、“包含”为非排他性的术语,从而包括一系列要素的方法、装置或设备不仅包括所列出的要素,而且还可包括没有明确列出的其他要素,例如还可包括这种方法、装置或设备所固有的要素。因此,在没有更多限制的情况下,由语句“包括……”限定的方法、装置或设备并不排除其还包括另外的要素。
本领域的技术人员应当清楚地了解,上述实施例的技术方案可借助软件、硬件、或者软件和通用硬件的结合来实现。例如,上述实施例的技术方案可以以软件产品的形式提供,该软件产品包括计算机可执行指令,并且可存储在存储介质(如ROM/RAM、磁碟、光盘)中,具有计算机功能的设备(例如终端、服务器等)执行软件产品中的计算机可执行指令来实现上述实施例的技术方案。
上面结合附图对本公开的实施例进行了描述,但是本公开并不局限于上述具体实施例,上述具体实施例仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本公开的启示下,在不脱离本公开的范围情况下,还可做出很多变型和修改,这些变型和修改均视为落入本公开的保护范围之内。
Claims (10)
- 一种按键消抖方法,包括步骤:检测机械键所在的电路产生的按键信号;当检测到所述按键信号时,计时器复位并开始计时;判断所述计时器的计时时间是否达到预设的时间阈值;以及如果所述计时器的计时时间达到预设的时间阈值,准备检测机械键所在的电路产生的下一按键信号。
- 根据权利要求1所述的按键消抖方法,还包括步骤:检测到所述按键信号后立即根据所述按键信号进行按键响应。
- 根据权利要求1所述的按键消抖方法,其中,所述计时器的计时时间达到预设的时间阈值时停止计时。
- 根据权利要求1至3中任一项所述的按键消抖方法,其中,所述时间阈值为检测连续的两次按键信号的最小时间间隔。
- 一种按键消抖装置,包括:检测模块,配置为检测机械键所在的电路产生的按键信号;计时模块,配置为当检测模块检测到所述按键信号时,复位并开始计时;以及判断模块,配置为判断所述计时模块的计时时间是否达到预设的时间阈值,其中如果所述计时模块的计时时间达到预设的时间阈值,所述检测模块准备检测机械键所在的电路产生的下一按键信号。
- 根据权利要求5所述的按键消抖装置,还包括:按键响应模块,配置为在所述检测模块检测到所述按键信号后立即根据所述按键信号进行按键响应。
- 根据权利要求5所述的按键消抖装置,其中,所述计时模块的计时时间达到预设的时间阈值时停止计时。
- 根据权利要求5至7中任一项所述的按键消抖装置,其中,所述时间阈值为检测连续的两次按键信号的最小时间间隔。
- 一种包含机械键的设备,包括机械键、计时器、存储器和处理器,其中,所述机械键设置在电路中,并且所述机械键所在的电路配置为根据所述机械键被按下的状态产生按键信号,所述计时器配置为当检测到所述机械键所在的电路产生按键信号时复位并开始计时,所述存储器配置为存储程序,所述处理器执行所述程序以执行根据权利要求1至4中任一项所述的按键消抖方法。
- 一种计算机可读存储介质,其存储有计算机可执行程序,所述计算机可执行程序被计算机执行,以实现根据权利要求1至4中任一项所述的按键消抖方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710551783.6 | 2017-07-07 | ||
CN201710551783.6A CN109217859A (zh) | 2017-07-07 | 2017-07-07 | 按键消抖方法、设备及存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019007394A1 true WO2019007394A1 (zh) | 2019-01-10 |
Family
ID=64950615
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/094647 WO2019007394A1 (zh) | 2017-07-07 | 2018-07-05 | 按键消抖方法及装置、包含机械键的设备、存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109217859A (zh) |
WO (1) | WO2019007394A1 (zh) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110048697B (zh) * | 2019-03-28 | 2023-08-01 | 深圳创维数字技术有限公司 | 一种滤除按键抖动的方法和相关设备 |
CN110957997A (zh) * | 2019-12-06 | 2020-04-03 | 江苏黑马高科股份有限公司 | 一种消除按键抖动的处理方法和电路 |
CN111221441B (zh) * | 2019-12-29 | 2023-05-05 | 歌尔科技有限公司 | 一种Touch按键的感应方法、系统及可穿戴设备 |
CN111340983B (zh) * | 2020-02-21 | 2022-02-11 | 德施曼机电(中国)有限公司 | 防特斯拉线圈开启的智能锁验证系统及方法 |
CN112737557B (zh) * | 2020-12-28 | 2023-09-29 | 歌尔科技有限公司 | 基于按键的交互方法、电子设备以及计算机可读存储介质 |
CN113765505A (zh) * | 2021-08-05 | 2021-12-07 | 天津市山石机器人有限责任公司 | 带反馈校正的按键信号消抖方法、装置、设备及存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101741394A (zh) * | 2009-11-03 | 2010-06-16 | 北京中星微电子有限公司 | 检测按键输入的方法和装置 |
CN102508552A (zh) * | 2011-10-31 | 2012-06-20 | 深圳市大富科技股份有限公司 | 一种消除按键抖动的方法、装置及键盘 |
CN105266606A (zh) * | 2014-07-04 | 2016-01-27 | 佛山市顺德区美的电热电器制造有限公司 | 电烹饪器及其的控制方法、控制装置 |
CN106325107A (zh) * | 2015-06-17 | 2017-01-11 | 佛山市顺德区美的电热电器制造有限公司 | 电烹饪器的控制装置及用于电烹饪器的按键处理方法 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5457455A (en) * | 1992-09-22 | 1995-10-10 | Rockwell International Corporation | Real time keyboard scanner |
CN101526872B (zh) * | 2008-03-05 | 2013-01-09 | 上海普芯达电子有限公司 | 电容式感应屏按钮状态的监测方法和电容式感应系统 |
CN106855784A (zh) * | 2016-12-16 | 2017-06-16 | 广东欧珀移动通信有限公司 | 防止触摸按键误触发的方法、装置及终端 |
-
2017
- 2017-07-07 CN CN201710551783.6A patent/CN109217859A/zh active Pending
-
2018
- 2018-07-05 WO PCT/CN2018/094647 patent/WO2019007394A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101741394A (zh) * | 2009-11-03 | 2010-06-16 | 北京中星微电子有限公司 | 检测按键输入的方法和装置 |
CN102508552A (zh) * | 2011-10-31 | 2012-06-20 | 深圳市大富科技股份有限公司 | 一种消除按键抖动的方法、装置及键盘 |
CN105266606A (zh) * | 2014-07-04 | 2016-01-27 | 佛山市顺德区美的电热电器制造有限公司 | 电烹饪器及其的控制方法、控制装置 |
CN106325107A (zh) * | 2015-06-17 | 2017-01-11 | 佛山市顺德区美的电热电器制造有限公司 | 电烹饪器的控制装置及用于电烹饪器的按键处理方法 |
Also Published As
Publication number | Publication date |
---|---|
CN109217859A (zh) | 2019-01-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019007394A1 (zh) | 按键消抖方法及装置、包含机械键的设备、存储介质 | |
WO2016112699A1 (zh) | 切换显示模式的方法及装置 | |
CN107223254B (zh) | 用于隐藏设置处理的方法、用户装置和存储介质 | |
WO2019134527A1 (zh) | 人机交互方法、装置、介质及移动终端 | |
TW201606657A (zh) | 電子裝置及指紋辨識裝置控制方法 | |
US10824891B2 (en) | Recognizing biological feature | |
WO2017161817A1 (zh) | 一种终端的控制方法及装置 | |
WO2017032067A1 (zh) | 一种通话录音方法及用户终端 | |
US20160381233A1 (en) | Mobile Terminal Talk Mode Switching Method, Device and Storage Medium | |
WO2017166629A1 (zh) | 启动应用程序的方法和终端设备 | |
US10146372B2 (en) | Method for controlling blank screen gesture processing and terminal | |
WO2017032026A1 (zh) | 一种浏览网页的显示对象控制方法及用户终端 | |
WO2017161824A1 (zh) | 一种终端的控制方法及装置 | |
WO2016197638A2 (zh) | 一种实现截屏的方法、装置和终端 | |
WO2017161814A1 (zh) | 一种终端的控制方法及装置 | |
CN106603801B (zh) | 一种通话录音方法及装置 | |
WO2018019049A1 (zh) | 情景模式切换方法及装置 | |
CN106531168B (zh) | 一种语音识别方法及装置 | |
WO2022142620A1 (zh) | 一种识别二维码的方法与设备 | |
US20170277419A1 (en) | Method and Electronic Device for Replying to a Message | |
US10129382B2 (en) | Electronic device and method for controlling electronic device using headset | |
WO2017166640A1 (zh) | 一种应用调用方法和终端 | |
WO2019080738A1 (zh) | 游戏应用程序控制方法及设备 | |
US11175821B2 (en) | Pressure touch method and terminal | |
WO2017161812A1 (zh) | 一种消息回复方法和终端 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18828362 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18828362 Country of ref document: EP Kind code of ref document: A1 |