WO2021081817A1 - 触摸事件侦测方法、mcu、触控设备及存储介质 - Google Patents

触摸事件侦测方法、mcu、触控设备及存储介质 Download PDF

Info

Publication number
WO2021081817A1
WO2021081817A1 PCT/CN2019/114397 CN2019114397W WO2021081817A1 WO 2021081817 A1 WO2021081817 A1 WO 2021081817A1 CN 2019114397 W CN2019114397 W CN 2019114397W WO 2021081817 A1 WO2021081817 A1 WO 2021081817A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
touch
touch button
pressing operation
mcu
Prior art date
Application number
PCT/CN2019/114397
Other languages
English (en)
French (fr)
Inventor
朱明�
李庆斌
周伟
Original Assignee
深圳市汇顶科技股份有限公司
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 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to PCT/CN2019/114397 priority Critical patent/WO2021081817A1/zh
Priority to CN201980002387.5A priority patent/CN113168258B/zh
Publication of WO2021081817A1 publication Critical patent/WO2021081817A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means

Definitions

  • This application relates to the field of touch technology, and in particular to a touch event detection method, MCU, touch device and storage medium.
  • touch devices are frequently used in people's daily lives, such as gas stoves and touch lights. These touch devices include: Microcontroller Unit (MCU) and touch buttons, where there is a channel between the MCU and the touch buttons.
  • MCU Microcontroller Unit
  • touch buttons where there is a channel between the MCU and the touch buttons.
  • the MCU can collect the voltage on the channel and determine whether there is a pressing operation on the touch button based on the voltage. If there is a pressing operation, the MCU can also determine the pressing position on the touch button.
  • touch buttons that include multiple touch sub-keys, such as sliding touch buttons and circular touch buttons
  • the prior art determines the pressing position on the touch button in the following manner. It is assumed that the touch button includes N touch sub-keys, and N touch sub-keys.
  • the button is connected to the MCU through N channels. N is an integer greater than 2.
  • the MCU determines the position of the touch sub-button corresponding to the maximum voltage among the current voltages on the N channels, and secondly determines the two adjacent channels corresponding to the maximum voltage. In two channels, determine the larger of the voltage values in the two channels, and then calculate the position of the touch sub-key corresponding to the larger value and the position of the touch sub-key corresponding to the maximum voltage to obtain the touch button The pressing position.
  • the pressing position of the touch button obtained by the MCU has a large deviation from the actual pressing position, and the accuracy of the obtained pressing position is relatively high. low.
  • This application provides a touch event detection method, MCU, touch device and storage medium. To ensure the accuracy of the calculated pressing position.
  • this application provides a touch event detection method, which is applied to a microcontroller unit MCU.
  • the MCU is connected to touch buttons through N channels.
  • the touch buttons include: N touch sub-buttons, N channels and N touches.
  • the sub keys have a one-to-one correspondence, and N is an integer greater than 2.
  • the method includes: judging whether the touch key is currently pressed according to the current voltages on the N channels. If there is currently a pressing operation on the touch button, the largest voltage among the current voltages on the N channels is determined, and the first channel with the largest voltage is determined. If the first channel has two adjacent second and third channels, it will be based on the maximum voltage, the current voltage on the second channel, the current voltage on the third channel, and the first, second and third channels.
  • the positions of the touch buttons corresponding to the channels respectively determine the pressing position of the touch buttons.
  • the MCU takes into account the positions and voltages of the second and third channels when calculating the position of the touch button, even if the voltages of the second and third channels are relatively close, there will be no calculated touch There is a large deviation between the pressed position of the button and the actual pressed position to ensure the accuracy of the calculated pressed position.
  • determine the pressing position of the touch button according to the maximum voltage, the current voltage on the second channel, the current voltage on the third channel, and the positions of the touch sub-keys corresponding to the first channel, the second channel, and the third channel, respectively Including: calculate the sum of the maximum voltage, the current voltage on the second channel, and the current voltage on the third channel to get the sum of the current voltages on the first channel, the second channel, and the third channel. Calculate the ratio of the maximum voltage, the current voltage on the second channel, and the current voltage on the third channel to the sum of the voltages respectively to obtain the weights corresponding to the first channel, the second channel, and the third channel. According to the weights corresponding to the first channel, the second channel, and the third channel, the positions of the touch sub-keys corresponding to the first channel, the second channel, and the third channel are weighted and averaged to obtain the pressed position of the touch button.
  • the above method further includes: if there is no pressing operation on the touch button currently, determining whether there is a valid pressing operation before the touch button. If there is a valid pressing operation before the touch key is touched, it is determined whether the no-press count value of the touch key is greater than the click threshold.
  • the no-press count value is the number of no-presses counted between the valid pressing operation and the current pressing operation of the touch key. If the non-press count value is greater than the click threshold, it is determined that there is a click action on the touch button.
  • the effective pressing operation is a pressing operation for which an action on the touch button has not been determined according to the pressing operation, and the action includes any one of the following: single click, double click, long press, and sliding.
  • the above method further includes: if there is currently a pressing operation on the touch button, judging whether the no-press count value is greater than zero. If the non-press count value is greater than zero, it is determined that there is a double-click action on the touch button.
  • the above method further includes: if the no-press count value is equal to zero, determining the distance between the position of the current pressing operation of the touch key and the position of the effective pressing operation, and judging whether the distance exceeds the first distance threshold. If the distance does not exceed the first distance threshold, it is determined whether the pressing count value of the touch button is greater than the long pressing threshold.
  • the pressing count value is the number of pressings counted between the effective pressing operation and the current pressing operation of the touch button. If the pressing count value is greater than the long-press threshold, it is determined that there is a long-press action on the touch button.
  • the above method further includes: if the distance exceeds the first distance threshold, determining the sliding direction on the touch button according to the position of the current pressing operation of the touch button and the position of the effective pressing operation, and judging whether the distance in the sliding direction exceeds Sliding threshold. If the distance in the sliding direction exceeds the sliding threshold, it is determined that there is a sliding action in the sliding direction of the touch button.
  • the MCU can determine whether there is a current pressing operation on the touch button, whether there is a valid pressing operation before, the pressing count value and the non-pressing count value, and the distance between the position of the pressing operation and the position of the effective pressing operation, etc., to determine the touch button Actions such as single click, double click, slide or long press, etc., which enrich the functions of the MCU.
  • judging whether the touch button currently has a pressing operation based on the current voltages on the N channels including: if the current voltage of any one of the N channels meets a preset condition, determining that the touch button currently has a pressing operation; If the current voltages of all channels on the N channels do not meet the preset conditions, it is determined that there is no pressing operation on the touch button; where the current voltage of any channel meets the preset conditions including: the reference voltage of any channel and the current The voltage difference is greater than the preset threshold, and the reference voltage of any channel is the voltage on any channel when there is no pressing operation on the touch subkey corresponding to any channel.
  • This method can effectively determine whether there is a pressing operation on the touch button.
  • the present application provides an MCU.
  • the MCU is connected to touch buttons through N channels.
  • the touch buttons include: N touch sub buttons.
  • N channels correspond to N touch sub buttons one-to-one, and N is an integer greater than 2.
  • MCU includes:
  • the first judgment module is used for judging whether there is a pressing operation on the touch button according to the current voltages on the N channels.
  • the first determining module is configured to determine the maximum voltage among the current voltages on the N channels if there is currently a pressing operation on the touch button, and determine the first channel with the maximum voltage.
  • the second determination module is used for if the first channel has two adjacent second and third channels, according to the maximum voltage, the current voltage on the second channel, the current voltage on the third channel, and the first channel , The positions of the touch sub-keys corresponding to the second channel and the third channel, respectively, to determine the pressing position of the touch button.
  • the present application provides an MCU.
  • the MCU is connected to touch buttons through N channels.
  • the touch buttons include: N touch sub buttons.
  • the N channels correspond to the N touch sub buttons one-to-one, and N is an integer greater than 2.
  • the MCU is used to execute the touch event detection method as described in the first aspect or an optional manner of the first aspect.
  • this application provides a touch device, including: MCU and touch buttons.
  • the MCU is connected to the touch buttons through N channels.
  • the touch buttons include: N touch sub buttons, N channels and N touch sub buttons.
  • N is an integer greater than 2
  • the MCU is used to execute the touch event detection method as described in the first aspect or the optional manner of the first aspect.
  • the present application provides a readable storage medium including program instructions, when the program instructions run on a computer, the computer executes the touch event detection method as described in the first aspect or an optional manner of the first aspect .
  • the present application provides a computer program product, including program instructions, which are used to try the touch event detection method according to the first aspect or the optional method of the first aspect.
  • This application provides a touch event detection method, MCU, touch device and storage medium.
  • the MCU calculates the pressing position of the touch button, it also takes into account the positions of the second channel and the third channel and the current voltage, so even if the current voltage of the second channel and the third channel are relatively close, it will not There is a large deviation between the calculated pressing position of the touch button and the actual pressing position, so as to ensure the accuracy of the calculated pressing position.
  • the MCU can determine whether there is a current pressing operation on the touch button, whether there is a valid pressing operation before, the pressing count value and the non-pressing count value, and the distance between the position of the pressing operation and the position of the effective pressing operation, etc.
  • the actions on the touch buttons such as clicking, double-clicking, sliding, or long-pressing, etc., enrich the functions of the MCU.
  • Figure 1 is a schematic diagram of the connection between MCU and touch buttons
  • FIG. 2 is a schematic diagram of capacitance change when a finger is close to a circular touch button according to an embodiment of the application
  • FIG. 3 is a schematic diagram of voltages on various channels when no finger is close to the slider-type touch button according to an embodiment of the application;
  • FIG. 4 is a schematic diagram of voltages on various channels when a finger is close to a slider-type touch button according to an embodiment of the application;
  • FIG. 5 is a flowchart of a touch event detection method provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of a slider-type touch button provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of a circular touch button provided by an embodiment of the application.
  • FIG. 8 is a flowchart of a touch event detection method provided by another embodiment of the application.
  • FIG. 9 is a flowchart of a touch event detection method provided by still another embodiment of this application.
  • FIG. 10 is a schematic diagram of an MCU provided by an embodiment of this application.
  • the current touch devices include: MCU and touch buttons, among which there is a channel between the MCU and the touch buttons.
  • Figure 1 is a schematic diagram of the connection between MCU and touch buttons.
  • the current typical touch buttons include: button touch buttons, slider touch buttons, and circular touch buttons. Touch sensors are provided below these touch buttons. Therefore, the aforementioned touch buttons can also be referred to as touch sensing electrodes.
  • buttons 0, 1, and 2 are all button touch buttons
  • button 3 is a circular touch button
  • button 4 is a sliding bar touch button.
  • the slider touch button consists of 3 touch sub buttons
  • the circular touch button consists of 4 touch sub buttons.
  • Each touch button or touch sub button is connected to the MCU through a channel, for example: buttons 0, 1. , 2 are connected to the MCU through channels 0, 1, and 2, button 3 is connected to the MCU through channels 3, 4, 5, and 6, and button 4 is connected to the MCU through channels 7, 8, and 9.
  • the principle of the MCU to detect whether there is a finger press on the touch button can be:
  • the MCU can pass An analog-to-digital converter (ADC) collects the voltage on the channel corresponding to the touch subkey.
  • ADC analog-to-digital converter
  • the MCU can obtain the reference voltage Base of the channel corresponding to the touch subkey when there is no finger pressed on the touch subkey.
  • the reference voltage is 2048, which is the value after normalization processing according to the accuracy of the ADC.
  • the human body and the ground will form a capacitance, which is connected in series with the touch sub-key, which causes the capacitance of the touch sub-key to increase, which in turn leads to the touch at the same time
  • the voltage on the sub-key becomes smaller.
  • the voltage Vout collected by the MCU is about 1600, which is also a value after normalization processing according to the accuracy of the ADC.
  • the MCU determines that there is a pressing operation on the touch button
  • the MCU can also determine the pressing position on the touch button.
  • the position detection of the slider touch button and the circular touch button not only depends on the change of the capacitance value of the button closest to the finger (that is, the center button), but also depends on the adjacent channel of the channel. The capacitance value changes.
  • the capacitance value of the center button will change due to the influence of the electric field of the human body.
  • FIG. 2 is a schematic diagram of capacitance changes when a finger approaches a circular touch button according to an embodiment of the application.
  • the capacitance values of touch subkey A and touch subkey B in the circular touch button are both There has been a change, and the capacitance value of the touch sub-key A has a greater change than that of the touch sub-key B.
  • FIG. 2 is a schematic diagram of capacitance changes when a finger approaches a circular touch button according to an embodiment of the application.
  • the capacitance values of touch subkey A and touch subkey B in the circular touch button are both There has been a change, and the capacitance value of the touch sub-key A has a greater change than that of the touch sub-key B.
  • FIG. 3 is a schematic diagram of voltages on each channel when no finger is close to the slider-type touch button according to an embodiment of the application
  • FIG. 4 is a schematic diagram of voltages on each channel when the finger is close to the slider-type touch button according to an embodiment of the application.
  • the voltage schematic diagram combined with Figure 3 and Figure 4, shows that when there is no finger close to the slider touch button, the voltages on the channels CH1, CH2, CH3, and CH4 are all the same, and they are all reference voltages.
  • the voltage change of channel CH2 is the largest, and the voltage changes of channels CH1 and CH3 corresponding to the adjacent touch subkeys 1 and 3 are the second, and the distance from CH2 is the farthest The voltage change on CH4 is minimal.
  • the MCU determines the pressing position of the slider touch button or the circular touch button in the following manner: the MCU determines the position of the touch sub button corresponding to the maximum voltage among the current voltages on the N channels, and then Determine the two channels adjacent to the channel corresponding to the maximum voltage, determine the larger of the voltage values in the two channels, and then the position of the touch button corresponding to the larger value, and the touch button corresponding to the maximum voltage
  • the position of the button is calculated with the center of gravity to obtain the pressing position of the touch button.
  • the pressing position of the touch button obtained by the MCU has a large deviation from the actual pressing position, and the accuracy of the obtained pressing position is relatively high. low.
  • the present application provides a touch event detection method, MCU, touch device and storage medium.
  • Figure 5 is a flowchart of a touch event detection method provided by an embodiment of the application.
  • the method is applied to an MCU.
  • the MCU is connected to touch buttons through N channels.
  • the touch buttons include: N touch sub buttons, N channels and N There are one-to-one correspondence between the touch sub-keys, and N is an integer greater than 2.
  • the slider-type touch button in Figure 1 consists of 3 touch sub-keys, and the circular touch button consists of 4 touch sub-keys.
  • the method includes the following steps:
  • Step S501 The MCU judges whether there is a current pressing operation of the touch button according to the current voltages on the N channels.
  • Step S502 If there is currently a pressing operation on the touch button, the MCU determines the largest voltage among the current voltages on the N channels, and determines the first channel with the largest voltage.
  • Step S503 If the first channel has two adjacent second and third channels, the MCU will use the maximum voltage, the current voltage on the second channel, the current voltage on the third channel, and the first channel and the second channel according to the maximum voltage.
  • the position of the touch subkey corresponding to the channel and the third channel respectively determines the pressing position of the touch button.
  • the MCU can collect the voltage on the channel corresponding to the touch sub-key through the ADC, and the MCU can obtain the touch sub-key when no finger is pressed on the touch sub-key.
  • the reference voltage Base of the corresponding channel The MCU can also obtain the voltage Vout of the channel corresponding to the touch sub-key when a finger presses the touch sub-key.
  • FIG. 6 is a schematic diagram of a sliding bar touch button provided by an embodiment of the application.
  • the sliding bar touch button includes N touch sub buttons, and N is an integer greater than 2, assuming that N touch sub buttons
  • the index values of are respectively 0,1,2...N-1, and the index values of the corresponding channels are also 0,1,2...N-1, and suppose that the position of the touch subkey 0 among the N touch keys is 0,
  • the position of the touch sub-key N-1 is 255, and the size of the N touch sub-keys is the same or similar. Based on this, the relative distance between two adjacent touch sub-keys is 255/(N-1). It should be noted that the position representation of the N touch sub-keys is not limited to the above-mentioned manner.
  • the position of the touch sub-key 0 among the N touch keys is 0, and the position of the touch sub-key N-1 is 1000, and The N touch sub-keys are the same or similar in size. Based on this, the relative distance between two adjacent touch sub-keys is 1000/(N-1). This application does not impose restrictions on this. It is assumed that the MCU can determine the index value x of the first channel with the largest voltage.
  • MCU calculates the voltage data(x) on the first channel x, the voltage data(x-1) on the second channel x-1, and the voltage data(x+1) on the third channel x+1 The sum of x+1), the voltage on the first channel x, the second channel x-1 and the third channel x+1 are obtained and data(x-1)+data(x)+data(x+1), MCU Calculate the ratio of the maximum voltage, the current voltage on the second channel, and the current voltage on the third channel to the sum of the voltages to obtain the corresponding weights of the first channel, the second channel, and the third channel, respectively:
  • the MCU can determine the pressing position of the touch button through formula (1):
  • the above process is actually an arithmetic average algorithm adopted by the MCU to determine the pressing position of the touch button.
  • the MCU can also use geometric average algorithm or harmonic average algorithm for the current voltages on the first channel, second channel, and third channel to obtain the pressed position of the touch button. This application does not deal with how to determine the position of the touch button. limit.
  • the MCU can determine the pressing position of the touch button through formula (2):
  • the MCU may also use a geometric average algorithm or a harmonic average algorithm for the current voltages on the first channel and the third channel to obtain the pressed position of the touch button. This application does not limit how to determine the position of the touch button.
  • the MCU can determine the pressing position of the touch button by formula (3):
  • the MCU may also use a geometric average algorithm or a harmonic average algorithm for the current voltages on the first channel and the second channel to obtain the pressing position of the touch button. This application does not limit how to determine the position of the touch button.
  • FIG. 7 is a schematic diagram of a circular touch key provided by an embodiment of the application.
  • the circular touch key includes N touch subkeys, and N is an integer greater than 2, assuming the index of the N touch subkeys The values are 0,1,2...N-1, the index values of the corresponding channels are also 0,1,2...N-1, and assuming that the position of the touch subkey 0 in the N touch buttons is 0, the touch sub The position of the button N-1 is 255, and the size of the N touch sub-keys is the same or similar. Based on this, the relative distance between two adjacent touch sub-keys is 255/(N-1). It should be noted that the position representation of the N touch sub-keys is not limited to the above-mentioned manner.
  • the position of the touch sub-key 0 among the N touch keys is 0, and the position of the touch sub-key N-1 is 1000, and The N touch sub-keys are the same or similar in size. Based on this, the relative distance between two adjacent touch sub-keys is 1000/(N-1). This application does not impose restrictions on this. It is assumed that the MCU can determine the index value x of the first channel with the largest voltage.
  • the difference between the circular touch button and the slider touch button is that there are two adjacent channels for any channel. These two adjacent channels are called the second channel and the third channel, respectively.
  • the pressing position on the touch button is determined by the following method: MCU calculates the voltage data(x) on the first channel x, the voltage data(x-1) on the second channel x-1, and the third channel x+1 The sum of the voltage data(x+1) to obtain the voltage sum on the first channel x, the second channel x-1 and the third channel x+1 data(x-1)+data(x)+data(x+ 1) The MCU calculates the ratio of the maximum voltage, the current voltage on the second channel, and the current voltage on the third channel to the voltage sum to obtain the corresponding weights of the first channel, the second channel, and the third channel, respectively:
  • the MCU can determine the pressing position of the touch button by formula (4):
  • the above process is actually an arithmetic average algorithm adopted by the MCU to determine the pressing position of the touch button.
  • the MCU can also use geometric average algorithm or harmonic average algorithm for the current voltages on the first channel, second channel, and third channel to obtain the pressed position of the touch button. This application does not deal with how to determine the position of the touch button. limit.
  • the current voltage on the first, second, and third channels mentioned above can be the voltage directly collected by the ADC, in volts, or it can be a value normalized according to the accuracy of the ADC. The value has no unit.
  • the present application provides a touch event detection method, wherein, if there is currently a pressing operation on the touch button, the MCU determines the largest voltage among the current voltages on the N channels, and determines the first channel with the largest voltage; if The first channel has two adjacent second and third channels, and the MCU is based on the maximum voltage, the current voltage on the second channel, the current voltage on the third channel, and the first, second, and third channels.
  • the positions of the touch buttons corresponding to the channels respectively determine the pressing position of the touch buttons.
  • the MCU takes into account the positions and voltages of the second and third channels when calculating the position of the touch button, even if the voltages of the second and third channels are relatively close, there will be no calculated touch There is a large deviation between the pressed position of the button and the actual pressed position to ensure the accuracy of the calculated pressed position.
  • This application not only provides a technical solution for determining the pressing position of a touch button, but also provides a technical solution for how to recognize an action event on the touch button, as follows:
  • FIG. 8 is a flowchart of a touch event detection method provided by another embodiment of the application.
  • the method is applied to an MCU.
  • the MCU is connected to touch buttons through N channels.
  • the touch buttons include: N touch sub buttons, N channels and N touch sub-keys correspond one-to-one, and N is an integer greater than 2.
  • the slider-type touch button consists of 3 touch sub-keys
  • the circular touch button consists of 4 touch sub-keys.
  • the method includes the following steps:
  • Step S801 The MCU obtains the current voltages on the N channels.
  • the MCU can collect the respective voltages on the N channels through the ADC.
  • Step S802 The MCU judges whether there is a current pressing operation of the touch button according to the current voltages on the N channels. If there is currently no pressing operation on the touch button, step S803 is executed, and if there is currently a pressing operation on the touch button, step S806 is executed.
  • the MCU judges whether there is a pressing operation on the touch button according to the current voltages on the N channels. You can refer to the content in the previous embodiment, which will not be repeated here.
  • Step S803 The MCU determines whether there is a valid pressing operation before the button is touched, and if there is a valid pressing operation, step S804 is executed. If there is no valid pressing operation, continue to execute step S801.
  • the effective pressing operation is a pressing operation for which an action on the touch button has not been determined according to the pressing operation, and the action includes any one of the following: single click, double tap, long press, and sliding.
  • Step S804 The MCU judges whether the count value of no pressing of the touch button is greater than the single click threshold. If the no-press count value is greater than the single-click threshold, step S805 is executed; otherwise, step S801 is continued.
  • the no-press count value is the number of no-presses counted between the effective pressing operation and the current pressing operation of the touch button.
  • Step S805 The MCU determines that there is a click action on the touch button.
  • Step S806 The MCU judges whether the no-press count value is greater than zero. If the no-press count value is greater than zero, step S807 is executed; if the no-press count value is equal to zero, step S808 is executed.
  • Step S807 The MCU determines that there is a double-click action on the touch button.
  • Step S808 The MCU determines the distance between the position of the current pressing operation of the touch key and the position of the effective pressing operation.
  • the MCU can determine the location of the current pressing operation and the location of the effective pressing operation through the method for determining the pressing position provided in the above-mentioned embodiment. And according to the distance calculation formula to determine the distance between the two positions.
  • Step S809 The MCU judges whether the distance exceeds the first distance threshold. If the distance does not exceed the first distance threshold, step S810 is executed, and if the distance exceeds the first distance threshold, step S812 is executed.
  • the first distance threshold is usually the maximum error distance allowed for the long press operation.
  • Step S810 The MCU determines whether the count value of the touch key is greater than the long-press threshold, and if the count value exceeds the long-press threshold, step S811 is executed. Otherwise, proceed to step S801.
  • the pressing count value is the number of pressings counted between the effective pressing operation and the current pressing operation of the touch key.
  • Step S811 The MCU determines that there is a long press action on the touch button.
  • Step S812 The MCU determines the sliding direction on the touch button according to the position of the current pressing operation of the touch button and the position of the effective pressing operation.
  • the x-axis direction is to the right, and the y-axis direction is up.
  • the x-axis coordinate minus the effective
  • the x-axis coordinate of the position of the pressing operation is greater than 0
  • the sliding direction on the touch button is to the right.
  • the x-axis coordinate of the position of the current pressing operation of the touch button minus the x-axis coordinate of the position of the effective pressing operation is less than 0, it means the touch The direction of sliding on the button is to the left.
  • Step S813 The MCU judges whether the distance in the sliding direction exceeds the sliding threshold. If the distance exceeds the sliding threshold, step S814 is executed. Otherwise, proceed to step S801.
  • the sliding threshold is greater than the aforementioned first distance threshold.
  • Step S814 The MCU determines that there is a sliding action in the sliding direction of the touch button.
  • the MCU can set a variable click_coordinata (c_c for short), the click_coordinata is initially set to be invalid, and the click_coordinata can be used to determine whether there is a valid pressing operation before the button is touched.
  • the no-press count value can be represented by no_touch_cycle (n_t_c for short), and the initial value of the no_touch_cycle is 0.
  • the pressing count value can be represented by long_touch_cycle (l_t_c for short), and the initial value of the long_touch_cycle is 0.
  • FIG. 9 is a flowchart of a touch event detection method provided by still another embodiment of this application. As shown in FIG. 9, the method includes the following steps:
  • Step S901 The MCU obtains the current voltages on the N channels.
  • Step S902 The MCU judges whether there is a current pressing operation of the touch button according to the current voltages on the N channels. If there is currently no pressing operation on the touch button, step S903 is executed, and if there is currently a pressing operation on the touch button, step S907 is executed.
  • Step S903 The MCU judges whether c_c is valid, and if c_c is valid, step S904 is executed. Otherwise, proceed to step S901.
  • Step S904 Increase n_t_c by one.
  • Step S905 The MCU judges whether n_t_c is greater than the single-click threshold. If n_t_c is greater than the single-click threshold, step S906 is executed; otherwise, step S901 is continued.
  • Step S906 The MCU determines that there is a click action on the touch button.
  • Step S907 The MCU judges whether the no-press count value is greater than zero. If the no-press count value is greater than zero, step S908 is executed; if the no-press count value is equal to zero, step S909 is executed.
  • Step S908 The MCU determines that there is a double-click action on the touch button.
  • Step S909 The MCU sets c_c to be valid.
  • Step S910 The MCU determines the distance between the position of the current pressing operation of the touch key and the position of the effective pressing operation.
  • Step S911 The MCU determines whether the distance exceeds the first distance threshold. If the distance does not exceed the first distance threshold, step S912 is executed, and if the distance exceeds the first distance threshold, step S915 is executed.
  • the first distance threshold is usually the maximum error distance allowed for the long press operation.
  • Step S912 Increase l_t_c by one.
  • Step S913 The MCU determines whether the l_t_c of the touch button is greater than the long-press threshold, and if the l_t_c exceeds the long-press threshold, step S914 is executed. Otherwise, proceed to step S901.
  • Step S914 The MCU determines that there is a long press action on the touch button.
  • Step S915 The MCU determines the sliding direction on the touch button according to the position of the current pressing operation of the touch button and the position of the effective pressing operation.
  • Step S916 The MCU judges whether the distance in the sliding direction exceeds the sliding threshold. If the distance exceeds the sliding threshold, step S917 is executed. Otherwise, proceed to step S901.
  • Step S917 The MCU determines that there is a sliding action in the sliding direction of the touch button.
  • FIG. 8 and FIG. 9 are also applicable to push-button keys.
  • the actions on the push-button keys are usually single click, double tap or long press, and there is no sliding action.
  • the actions on the push-button keys are usually single click, double tap or long press, and there is no sliding action.
  • this application provides a touch event detection method.
  • the MCU can detect whether there is a current pressing operation on the touch button, whether there is a valid pressing operation before, the pressing count value and the non-pressing count value, and the location of the pressing operation and the effective pressing operation.
  • the distance between the positions, etc. can determine the action on the touch button, such as clicking, double-clicking, sliding or long-pressing, etc., thereby enriching the functions of the MCU.
  • FIG. 10 is a schematic diagram of an MCU provided by an embodiment of the application.
  • the MCU is connected to touch buttons through N channels.
  • the touch buttons include: N touch sub buttons, and N channels correspond to N touch sub buttons one-to-one, and N It is an integer greater than 2, as shown in Figure 10, the MCU includes:
  • the first judgment module 1001 is used for judging whether there is a pressing operation on the touch button according to the current voltages on the N channels.
  • the first determining module 1002 is configured to determine the maximum voltage among the current voltages on the N channels if there is currently a pressing operation on the touch button, and determine the first channel with the maximum voltage.
  • the second determining module 1003 is used for if the first channel has two adjacent second and third channels, according to the maximum voltage, the current voltage on the second channel, the current voltage on the third channel, and the first channel.
  • the position of the touch subkey corresponding to the channel, the second channel and the third channel respectively determines the pressing position of the touch button.
  • the second determining module 1003 is specifically configured to: calculate the sum of the maximum voltage, the current voltage on the second channel, and the current voltage on the third channel to obtain the current on the first channel, the second channel, and the third channel. Voltage and. Calculate the ratio of the maximum voltage, the current voltage on the second channel, and the current voltage on the third channel to the sum of the voltages respectively to obtain the weights corresponding to the first channel, the second channel, and the third channel. According to the weights corresponding to the first channel, the second channel, and the third channel, the positions of the touch sub-keys corresponding to the first channel, the second channel, and the third channel are weighted and averaged to obtain the pressed position of the touch button.
  • the MCU further includes: a second judging module 1004, which is used to judge whether there is a valid pressing operation before the touch button if there is currently no pressing operation on the touch button.
  • the effective pressing operation means that the touch button has not been determined according to the pressing operation.
  • the pressing operation of the action on the button, the action includes any one of the following: single click, double click, long press, and slide.
  • the third determining module 1005 is used for determining whether the no-press count value of the touch button is greater than the click threshold if there is a valid pressing operation before the button is touched, and the no-press count value is between the valid pressing operation and the current pressing operation of the touch button The counted number of no presses.
  • the third determining module 1006 is configured to determine that there is a click action on the touch button if the count value of no presses is greater than the click threshold.
  • the MCU further includes: a fourth judgment module 1007, configured to judge whether the no-press count value is greater than zero if there is currently a pressing operation on the touch button.
  • the fourth determining module 1008 is configured to determine that there is a double-click action on the touch button if the count value of no pressing is greater than zero.
  • the MCU further includes: a fifth judgment module 1009, configured to determine the distance between the position of the current pressing operation of the touch button and the position of the effective pressing operation if the count value of no pressing is equal to zero, and judge whether the distance exceeds the first A distance threshold.
  • a fifth judgment module 1009 configured to determine the distance between the position of the current pressing operation of the touch button and the position of the effective pressing operation if the count value of no pressing is equal to zero, and judge whether the distance exceeds the first A distance threshold.
  • the sixth judging module 1010 is used for judging whether the pressing count value of the touch button is greater than the long press threshold if the distance does not exceed the first distance threshold.
  • the pressing count value is calculated from the effective pressing operation to the current pressing operation of the touch button The number of presses.
  • the fifth determining module 1011 is configured to determine that there is a long-press action on the touch button if the pressing count value is greater than the long-press threshold.
  • the MCU further includes: a seventh judgment module 1012, configured to determine the sliding direction on the touch button according to the position of the current pressing operation of the touch button and the position of the effective pressing operation if the distance exceeds the first distance threshold, and judge Whether the distance in the sliding direction exceeds the sliding threshold.
  • a seventh judgment module 1012 configured to determine the sliding direction on the touch button according to the position of the current pressing operation of the touch button and the position of the effective pressing operation if the distance exceeds the first distance threshold, and judge Whether the distance in the sliding direction exceeds the sliding threshold.
  • the sixth determining module 1013 is configured to determine that there is a sliding action in the sliding direction of the touch button if the distance in the sliding direction exceeds the sliding threshold.
  • the first judgment module 1001 is specifically configured to: if the current voltage of any one of the N channels meets a preset condition, determine that the touch button currently has a pressing operation; if the current voltage of all channels on the N channels If none of the preset conditions are met, it is determined that there is no pressing operation on the touch button; where the current voltage of any channel satisfies the preset conditions including: the difference between the reference voltage of any channel and the current voltage is greater than the preset threshold, and either The reference voltage of a channel is the voltage on any channel when there is no pressing operation on the touch subkey corresponding to any channel.
  • the present application also provides an MCU, which is used to execute the above-mentioned touch event detection method.
  • MCU which is used to execute the above-mentioned touch event detection method.
  • the present application also provides an MCU, which is used to execute the above-mentioned touch event detection method.
  • MCU which is used to execute the above-mentioned touch event detection method.
  • This application also provides a touch device, including: MCU and touch buttons.
  • the MCU is connected to the touch buttons through N channels.
  • the touch buttons include: N touch sub buttons, and the N channels correspond to the N touch sub buttons one-to-one.
  • N is an integer greater than 2.
  • the above-mentioned MCU is used to execute the above-mentioned touch event detection method, and its content and effects can be referred to the method embodiment part, which will not be repeated here.
  • the present application also provides a readable storage medium, including program instructions, when the program instructions run on a computer, the computer executes the touch event detection method as described above.
  • program instructions when the program instructions run on a computer, the computer executes the touch event detection method as described above.
  • the content and effect please refer to the method embodiment section. No longer.
  • the present application also provides a computer program product, including program instructions, which are used to execute the touch event detection method as described above.
  • program instructions which are used to execute the touch event detection method as described above.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Position Input By Displaying (AREA)
  • Electronic Switches (AREA)

Abstract

一种触摸事件侦测方法、MCU、触控设备及存储介质。其中MCU通过N个通道与触摸按键连接,触摸按键包括:N个触摸子按键,该方法包括:根据N个通道上的当前电压,判断触摸按键当前是否存在按压操作(S501)。若触摸按键当前存在按压操作,则确定N个通道上的当前电压中的最大电压,并确定具有最大电压的第一通道(S502)。若第一通道具有两个与其相邻的第二通道和第三通道,则根据最大电压、第二通道上的当前电压、第三通道上的当前电压以及第一通道、第二通道和第三通道分别对应的触摸子按键的位置,确定触摸按键的按压位置(S503)。以确保计算得到的按压位置的准确度。

Description

触摸事件侦测方法、MCU、触控设备及存储介质 技术领域
本申请涉及触控技术领域,尤其涉及一种触摸事件侦测方法、MCU、触控设备及存储介质。
背景技术
目前触控设备在人们的日常生活中被频繁使用,如燃气灶、触控灯等。这些触控设备中包括:微控制单元(Microcontroller Unit,MCU)和触摸按键,其中MCU与触摸按键之间存在通道。
MCU可以采集通道上的电压,并根据电压确定触摸按键上是否存在按压操作,如果存在按压操作,MCU还可以确定触摸按键上的按压位置。针对滑条式触摸按键、圆形式触摸按键等包括多个触摸子按键的触摸按键,现有技术通过如下方式确定触摸按键上的按压位置,假设触摸按键包括N个触摸子按键,N个触摸子按键通过N个通道连接至MCU,N为大于2的整数,首先MCU确定N个通道上的当前电压中的最大电压对应的触摸子按键的位置,其次确定与最大电压对应的通道相邻的两个通道,在两个通道中确定电压值中的较大者,再对该较大值对应的触摸子按键的位置,以及,最大电压对应的触摸子按键的位置进行重心计算,以得到触摸按键的按压位置。
然而,当上述两个通道的电压值中的较小者与较大值比较接近时,MCU得到的触摸按键的按压位置与实际按压位置存在较大的偏差,从而得到的按压位置的准确度较低。
发明内容
本申请提供一种触摸事件侦测方法、MCU、触控设备及存储介质。以确保计算得到的按压位置的准确度。
第一方面,本申请提供一种触摸事件侦测方法,方法应用于微控制单元MCU,MCU通过N个通道与触摸按键连接,触摸按键包括:N个触摸子按键,N个通道与N个触摸子按键一一对应,N为大于2的整数,方法包括: 根据N个通道上的当前电压,判断触摸按键当前是否存在按压操作。若触摸按键当前存在按压操作,则确定N个通道上的当前电压中的最大电压,并确定具有最大电压的第一通道。若第一通道具有两个与其相邻的第二通道和第三通道,则根据最大电压、第二通道上的当前电压、第三通道上的当前电压以及第一通道、第二通道和第三通道分别对应的触摸子按键的位置,确定触摸按键的按压位置。
由于MCU在计算触摸按键的按压位置时,同时将第二通道、第三通道的位置和电压考虑在内,因此即使第二通道和第三通道的电压比较接近,也不会存在计算得到的触摸按键的按压位置与实际按压位置存在较大的偏差,以确保计算得到的按压位置的准确度。
可选的,根据最大电压、第二通道上的当前电压、第三通道上的当前电压以及第一通道、第二通道和第三通道分别对应的触摸子按键的位置,确定触摸按键的按压位置,包括:计算最大电压、第二通道上的当前电压、第三通道上的当前电压之和,得到第一通道、第二通道和第三通道上的当前电压和。分别计算最大电压、第二通道上的当前电压、第三通道上的当前电压与电压和的比值,以得到第一通道、第二通道、第三通道对应的权重。根据第一通道、第二通道、第三通道对应的权重,对第一通道、第二通道和第三通道分别对应的触摸子按键的位置进行加权平均,以得到触摸按键的按压位置。
可选的,上述方法还包括:若触摸按键当前不存在按压操作,则判断触摸按键之前是否存在有效按压操作。若触摸按键之前存在有效按压操作,则判断触摸按键的无按压计数值是否大于单击阈值,无按压计数值是在有效按压操作至触摸按键的当前按压操作之间所统计的无按压次数。若无按压计数值大于单击阈值,则确定触摸按键存在单击动作。其中,有效按压操作是还未根据该按压操作确定触摸按键上的动作的按压操作,动作包括以下任一项:单击、双击、长按、滑动。
可选的,上述方法还包括:若触摸按键当前存在按压操作,则判断无按压计数值是否大于零。若无按压计数值大于零,则确定触摸按键存在双击动作。
可选的,上述方法还包括:若无按压计数值等于零,则确定触摸按键的当前按压操作所在位置与有效按压操作所在位置之间的距离,并判断距离是 否超过第一距离阈值。若距离未超过第一距离阈值,则判断触摸按键的按压计数值是否大于长按阈值,按压计数值是在有效按压操作至触摸按键的当前按压操作之间所统计的按压次数。若按压计数值大于长按阈值,则确定触摸按键存在长按动作。
可选的,上述方法还包括:若距离超过第一距离阈值,则根据触摸按键的当前按压操作所在位置与有效按压操作所在位置确定触摸按键上的滑动方向,并判断滑动方向上的距离是否超过滑动阈值。若滑动方向上的距离超过滑动阈值,则确定触摸按键存在滑动方向上的滑动动作。
即MCU可以根据触摸按键上当前是否存在按压操作、之前是否存在有效按压操作、按压计数值和无按压计数值以及按压操作所在位置与有效按压操作所在位置之间的距离等,可以确定触摸按键上的动作,如单击、双击、滑动或者长按等,从而丰富了MCU的功能。
可选的,根据N个通道上的当前电压,判断触摸按键当前是否存在按压操作,包括:若N个通道上的任一个通道的当前电压满足预设条件,则确定触摸按键当前存在按压操作;若N个通道上的所有通道的当前电压均不满足预设条件,则确定触摸按键当前不存在按压操作;其中,任一个通道的当前电压满足预设条件包括:任一个通道的基准电压与当前电压的差值大于预设阈值,任一个通道的基准电压为当任一个通道对应的触摸子按键上不存在按压操作时,任一个通道上的电压。通过该方法可以有效的判断触摸按键上是否存在按压操作。
下面将介绍MCU、触控设备、可读存储介质以及计算机程序产品,其效果可参考上述方法部分的效果,下面对此不再赘述。
第二方面,本申请提供一种MCU,MCU通过N个通道与触摸按键连接,触摸按键包括:N个触摸子按键,N个通道与N个触摸子按键一一对应,N为大于2的整数,MCU包括:
第一判断模块,用于根据N个通道上的当前电压,判断触摸按键当前是否存在按压操作。
第一确定模块,用于若触摸按键当前存在按压操作,则确定N个通道上的当前电压中的最大电压,并确定具有最大电压的第一通道。
第二确定模块,用于若第一通道具有两个与其相邻的第二通道和第三通 道,则根据最大电压、第二通道上的当前电压、第三通道上的当前电压以及第一通道、第二通道和第三通道分别对应的触摸子按键的位置,确定触摸按键的按压位置。
第三方面,本申请提供一种MCU,MCU通过N个通道与触摸按键连接,触摸按键包括:N个触摸子按键,N个通道与N个触摸子按键一一对应,N为大于2的整数,MCU用于执行如第一方面或第一方面的可选方式所述的触摸事件侦测方法。
第四方面,本申请提供一种触控设备,包括:MCU和触摸按键,MCU通过N个通道与触摸按键连接,触摸按键包括:N个触摸子按键,N个通道与N个触摸子按键一一对应,N为大于2的整数,MCU用于执行如第一方面或第一方面的可选方式所述的触摸事件侦测方法。
第五方面,本申请提供一种可读存储介质,包括程序指令,当程序指令在计算机上运行时,使得计算机执行如第一方面或第一方面的可选方式所述的触摸事件侦测方法。
第六方面,本申请提供一种计算机程序产品,包括程序指令,该程序指令用于试下如第一方面或第一方面的可选方式所述的触摸事件侦测方法。
本申请提供一种触摸事件侦测方法、MCU、触控设备及存储介质。一方面,由于MCU在计算触摸按键的按压位置时,同时将第二通道、第三通道的位置和当前电压考虑在内,因此即使第二通道和第三通道的当前电压比较接近,也不会存在计算得到的触摸按键的按压位置与实际按压位置存在较大的偏差,以确保计算得到的按压位置的准确度。另一方面,MCU可以根据触摸按键上当前是否存在按压操作、之前是否存在有效按压操作、按压计数值和无按压计数值以及按压操作所在位置与有效按压操作所在位置之间的距离等,可以确定触摸按键上的动作,如单击、双击、滑动或者长按等,从而丰富了MCU的功能。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在 不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为MCU和触摸按键的连接示意图;
图2为本申请一实施例提供的当手指靠近圆形式触摸按键时的电容变化示意图;
图3为本申请一实施例提供的当无手指靠近滑条式触摸按键时各个通道上的电压示意图;
图4为本申请一实施例提供的当手指靠近滑条式触摸按键时各个通道上的电压示意图;
图5为本申请一实施例提供的触摸事件侦测方法的流程图;
图6为本申请一实施例提供的滑条式触摸按键的示意图;
图7为本申请一实施例提供的圆形式触摸按键的示意图;
图8为本申请另一实施例提供的触摸事件侦测方法的流程图;
图9为本申请再一实施例提供的触摸事件侦测方法的流程图;
图10为本申请一实施例提供的一种MCU的示意图。
具体实施方式
目前触控设备中包括:MCU和触摸按键,其中MCU与触摸按键之间存在通道。图1为MCU和触摸按键的连接示意图,如图1所示,目前存在的典型触摸按键包括:按键式触摸按键、滑条式触摸按键和圆形式触摸按键,这些触摸按键下方均设置有触摸传感器,因此上述的触摸按键也可以被称为触摸感应电极,如图1中的按键0、1、2均为按键式触摸按键,按键3为圆形式触摸按键,按键4为滑条式触摸按键。其中,滑条式触摸按键由3个触摸子按键构成,圆形式触摸按键由4个触摸子按键构成,每个按键式触摸按键或者触摸子按键通过一个通道与MCU连接,例如:按键0、1、2分别通过通道0、1、2与MCU连接,按键3分别通过通道3、4、5、6与MCU连接,按键4分别通过通道7、8、9与MCU连接。
针对滑条式触摸按键、圆形式触摸按键等包括多个触摸子按键的情况,MCU检测触摸按键上是否存在手指按压情况的原理可以是:针对触摸按键中的任一个触摸子按键,MCU可以通过模数转换器(Analog-to-Digital Converter,ADC)采集该触摸子按键对应的通道上的电压。其中MCU可以获取当无手 指按压在触摸子按键上时,触摸子按键对应的通道的基准电压Base,如基准电压为2048,该2048是根据ADC的精度归一化处理之后的数值。当有手指按压在该触摸子按键上时,人体与地会行成一个电容,这个电容与该触摸子按键串连在一起,从而导致触摸子按键的电容变大,进而导致相同时间内该触摸子按键上的电压变小,比如MCU采集到的电压Vout为1600左右,该1600同样是根据ADC的精度归一化处理之后的数值。MCU通过计算Delta=Base–Vout来确定是否有手指按压该触摸子按键上,例如:当Delta值大于200时认为有手指按压该触摸子按键。基于此,可以确定该触摸子按键所在的触摸按键上存在按压操作。
进一步地,当MCU确定触摸按键上存在按压操作,MCU还可以确定触摸按键上的按压位置。不同于按键式触摸检测,针对滑条式触摸按键和圆形式触摸按键的位置检测,不仅依赖于距离手指最近的按键(即中心按键)的电容值变化,还依赖于该通道的相邻通道的电容值变化。当手指逐渐接近触摸按键时,由于人体电场的影响会使中心按键的电容值发生变化,但由于滑条式触摸按键和圆形式触摸按键中触摸子按键排布紧凑,它们之间具有一定的耦合性,因此手指靠近中心按键时,中心按键的相邻按键的电容值也存在一定的变化。例如:图2为本申请一实施例提供的当手指靠近圆形式触摸按键时的电容变化示意图,如图2所示,圆形式触摸按键中的触摸子按键A和触摸子按键B的电容值都发生了变化,触摸子按键A相较于触摸子按键B的电容值变化较大。图3为本申请一实施例提供的当无手指靠近滑条式触摸按键时各个通道上的电压示意图,图4为本申请一实施例提供的当手指靠近滑条式触摸按键时各个通道上的电压示意图,结合图3和图4所示,当无手指靠近滑条式触摸按键时,通道CH1、CH2、CH3、CH4上的电压均相同,均为基准电压。当有手指靠近滑条式触摸按键中的触摸子按键2时,通道CH2的电压变化最大,与之相邻的触摸子按键1、3对应的通道CH1、CH3电压变化次之,距离CH2最远的CH4上的电压变化最小。
如上所述,现有技术中,MCU通过如下方式确定滑条式触摸按键或者圆形式触摸按键的按压位置:MCU确定N个通道上的当前电压中的最大电压对应的触摸子按键的位置,其次确定与最大电压对应的通道相邻的两个通道,在两个通道中确定电压值中的较大者,再对该较大值对应的触摸子按键的位 置,以及,最大电压对应的触摸子按键的位置进行重心计算,以得到触摸按键的按压位置。然而,当上述两个通道的电压值中的较小者与较大值比较接近时,MCU得到的触摸按键的按压位置与实际按压位置存在较大的偏差,从而得到的按压位置的准确度较低。
为了解决上述技术问题,本申请提供一种触摸事件侦测方法、MCU、触控设备及存储介质。
图5为本申请一实施例提供的触摸事件侦测方法的流程图,该方法应用于MCU,MCU通过N个通道与触摸按键连接,触摸按键包括:N个触摸子按键,N个通道与N个触摸子按键一一对应,N为大于2的整数,如图1中的滑条式触摸按键由3个触摸子按键构成,圆形式触摸按键由4个触摸子按键构成,相应的,如图5所示,该方法包括如下步骤:
步骤S501:MCU根据N个通道上的当前电压,判断触摸按键当前是否存在按压操作。
步骤S502:若触摸按键当前存在按压操作,则MCU确定N个通道上的当前电压中的最大电压,并确定具有最大电压的第一通道。
步骤S503:若第一通道具有两个与其相邻的第二通道和第三通道,则MCU根据最大电压、第二通道上的当前电压、第三通道上的当前电压以及第一通道、第二通道和第三通道分别对应的触摸子按键的位置,确定触摸按键的按压位置。
如上所述,针对触摸按键中的任一个触摸子按键,MCU可以通过ADC采集该触摸子按键对应的通道上的电压,MCU可以获取当无手指按压在该触摸子按键上时,该触摸子按键对应的通道的基准电压Base。MCU还可以获取当有手指按压在该触摸子按键上时,该触摸子按键对应的通道的电压Vout。MCU通过计算Delta=Base–Vout来确定是否有手指按压该触摸子按键上,例如:当Delta值大于预设阈值200时认为有手指按压该触摸子按键,即上述触摸按键上存在按压操作。
下面分别以滑条式触摸按键、圆形式触摸按键为例,对上述的触摸事件侦测方法进行详细说明:
图6为本申请一实施例提供的滑条式触摸按键的示意图,如图6所示,该滑条式触摸按键包括N个触摸子按键,N为大于2的整数,假设N个触摸 子按键的索引值分别为0,1,2……N-1,对应通道的索引值也为0,1,2……N-1,并假设N个触摸按键中触摸子按键0的位置为0,触摸子按键N-1的位置为255,且N个触摸子按键大小相同或相近,基于此,相邻两个触摸子按键的相对距离为255/(N-1)。需要说明的是,N个触摸子按键的位置表示方式不限于上述方式,比如:还可以假设N个触摸按键中触摸子按键0的位置为0,触摸子按键N-1的位置为1000,且N个触摸子按键大小相同或相近,基于此,相邻两个触摸子按键的相对距离为1000/(N-1)。本申请对此不做限制。假设MCU可以确定具有最大电压的第一通道的索引值x。
1、若0<x<N-1,即表示该第一通道存在两个相邻的通道,将这两个相邻的通道分别称为第二通道和第三通道,这种情况,通过如下方式确定触摸按键上的按压位置:MCU计算第一通道x上的电压data(x)、第二通道x-1上的电压data(x-1)、第三通道x+1上的电压data(x+1)之和,得到第一通道x、第二通道x-1和第三通道x+1上的电压和data(x-1)+data(x)+data(x+1),MCU分别计算最大电压、第二通道上的当前电压、第三通道上的当前电压与电压和的比值,以得到第一通道、第二通道、第三通道对应的权重,分别为:
Figure PCTCN2019114397-appb-000001
Figure PCTCN2019114397-appb-000002
Figure PCTCN2019114397-appb-000003
最后MCU通过公式(1)可以确定触摸按键的按压位置:
Figure PCTCN2019114397-appb-000004
即上述过程实际上是MCU采取的算数平均算法,来确定触摸按键的按压位置。此外,MCU还可以对第一通道、第二通道和第三通道上的当前电压采用几何平均算法或者调和平均算法等,以得到触摸按键的按压位置,本申请对如何确定触摸按键的位置不做限制。
2、若x=0,即表示该第一通道仅存在一个与其相邻的第三通道,这种情况,MCU通过公式(2)可以确定触摸按键的按压位置:
Figure PCTCN2019114397-appb-000005
此外,MCU还可以对第一通道、第三通道上的当前电压采用几何平均算法或者调和平均算法等,以得到触摸按键的按压位置,本申请对如何确定触摸按键的位置不做限制。
3、若x=N-1,即表示该第一通道仅存在一个与其相邻的第二通道,这种情况,MCU通过公式(3)可以确定触摸按键的按压位置:
Figure PCTCN2019114397-appb-000006
此外,MCU还可以对第一通道、第二通道上的当前电压采用几何平均算法或者调和平均算法等,以得到触摸按键的按压位置,本申请对如何确定触摸按键的位置不做限制。
图7为本申请一实施例提供的圆形式触摸按键的示意图,如图7所示,该圆形式触摸按键包括N个触摸子按键,N为大于2的整数,假设N个触摸子按键的索引值分别为0,1,2……N-1,对应通道的索引值也为0,1,2……N-1,并假设N个触摸按键中触摸子按键0的位置为0,触摸子按键N-1的位置为255,且N个触摸子按键大小相同或相近,基于此,相邻两个触摸子按键的相对距离为255/(N-1)。需要说明的是,N个触摸子按键的位置表示方式不限于上述方式,比如:还可以假设N个触摸按键中触摸子按键0的位置为0,触摸子按键N-1的位置为1000,且N个触摸子按键大小相同或相近,基于此,相邻两个触摸子按键的相对距离为1000/(N-1)。本申请对此不做限制。假设MCU可以确定具有最大电压的第一通道的索引值x。
圆形式触摸按键与滑条式触摸按键不同之处在于,对于任一个通道其均存在两个相邻的通道,将这两个相邻的通道分别称为第二通道和第三通道,这种情况,通过如下方式确定触摸按键上的按压位置:MCU计算第一通道x上的电压data(x)、第二通道x-1上的电压data(x-1)、第三通道x+1上的电压data(x+1)之和,得到第一通道x、第二通道x-1和第三通道x+1上的电压和data(x-1)+data(x)+data(x+1),MCU分别计算最大电压、第二通道上的当前电压、第三通道上的当前电压与电压和的比值,以得到第一通道、第二通道、第三通道对应的权重,分别为:
Figure PCTCN2019114397-appb-000007
Figure PCTCN2019114397-appb-000008
Figure PCTCN2019114397-appb-000009
最后MCU通过公式(4)可以确定触摸按键的按压位置:
Figure PCTCN2019114397-appb-000010
即上述过程实际上是MCU采取的算数平均算法,来确定触摸按键的按压位置。此外,MCU还可以对第一通道、第二通道和第三通道上的当前电压采用几何平均算法或者调和平均算法等,以得到触摸按键的按压位置,本申请对如何确定触摸按键的位置不做限制。
需要说明的是,上述第一通道、第二通道和第三通道上的当前电压可以是ADC直接采集到的电压,单位是伏特V,也可以是根据ADC的精度归一化处理之后的数值,该数值没有单位。
综上,本申请提供一种触摸事件侦测方法,其中,若触摸按键当前存在按压操作,则MCU确定N个通道上的当前电压中的最大电压,并确定具有最大电压的第一通道;若第一通道具有两个与其相邻的第二通道和第三通道,则MCU根据最大电压、第二通道上的当前电压、第三通道上的当前电压以及第一通道、第二通道和第三通道分别对应的触摸子按键的位置,确定触摸按键的按压位置。由于MCU在计算触摸按键的按压位置时,同时将第二通道、第三通道的位置和电压考虑在内,因此即使第二通道和第三通道的电压比较接近,也不会存在计算得到的触摸按键的按压位置与实际按压位置存在较大的偏差,以确保计算得到的按压位置的准确度。
本申请不仅提供了确定触摸按键的按压位置的技术方案,还提供了如何识别触摸按键上的动作事件的技术方案,具体如下:
图8为本申请另一实施例提供的触摸事件侦测方法的流程图,该方法应用于MCU,MCU通过N个通道与触摸按键连接,触摸按键包括:N个触摸子按键,N个通道与N个触摸子按键一一对应,N为大于2的整数,如图1中的滑条式触摸按键由3个触摸子按键构成,圆形式触摸按键由4个触摸子 按键构成,相应的,如图8所示,该方法包括如下步骤:
步骤S801:MCU获取N个通道上的当前电压。
其中,MCU可以通过ADC采集N个通道上各自的电压。
步骤S802:MCU根据N个通道上的当前电压判断触摸按键当前是否存在按压操作。若触摸按键当前不存在按压操作,则执行步骤S803,若触摸按键当前存在按压操作,则执行步骤S806。
MCU根据N个通道上的当前电压判断触摸按键当前是否存在按压操作,可参考上一实施例中的内容,对此不再赘述。
步骤S803:MCU判断触摸按键之前是否存在有效按压操作,若存在有效按压操作,则执行步骤S804。若不存在有效按压操作,则继续执行步骤S801。
该有效按压操作是还未根据该按压操作确定所述触摸按键上的动作的按压操作,该动作包括以下任一项:单击、双击、长按、滑动。
步骤S804:MCU判断触摸按键的无按压计数值是否大于单击阈值。若无按压计数值大于单击阈值,则执行步骤S805,否则,继续执行步骤S801。
其中,无按压计数值是在有效按压操作至触摸按键的当前按压操作之间所统计的无按压次数。
步骤S805:MCU确定触摸按键存在单击动作。
步骤S806:MCU判断无按压计数值是否大于零。若无按压计数值大于零,则执行步骤S807;若无按压计数值等于零,则执行步骤S808。
步骤S807:MCU确定触摸按键存在双击动作。
步骤S808:MCU确定触摸按键的当前按压操作所在位置与有效按压操作所在位置之间的距离。
其中,MCU可以通过上述实施例提供的按压位置的确定方法,确定当前按压操作所在位置与有效按压操作所在位置。并根据距离计算公式确定两个位置之间的距离。
步骤S809:MCU判断距离是否超过第一距离阈值。若该距离未超过第一距离阈值,则执行步骤S810,若该距离超过第一距离阈值,则执行步骤S812。
其中,该第一距离阈值通常长按操作被允许的最大误差距离。
步骤S810:MCU判断触摸按键的按压计数值是否大于长按阈值,若该按压计数值超过长按阈值,则执行步骤S811。否则,则继续执行步骤S801。
按压计数值是在有效按压操作至触摸按键的当前按压操作之间所统计的按压次数。
步骤S811:MCU确定触摸按键存在长按动作。
步骤S812:MCU根据触摸按键的当前按压操作所在位置与有效按压操作所在位置确定触摸按键上的滑动方向。
假设滑条式触摸按键水平放置,以触摸按键的中心点为原点,x轴方向向右,y轴方向向上,这种情况下,当触摸按键的当前按压操作所在位置的x轴坐标减去有效按压操作所在位置x轴坐标大于0时,表示触摸按键上的滑动方向向右,触摸按键的当前按压操作所在位置的x轴坐标减去有效按压操作所在位置的x轴坐标小于0时,表示触摸按键上的滑动方向向左。
步骤S813:MCU判断滑动方向上的距离是否超过滑动阈值。若该距离超过了滑动阈值,则执行步骤S814。否则,则继续执行步骤S801。
其中,该滑动阈值大于上述的第一距离阈值。
步骤S814:MCU确定触摸按键存在滑动方向上的滑动动作。
需要说明的是,MCU可以设置一个变量click_coordinata(简称c_c),该click_coordinata被初始设置为无效,该click_coordinata可以用于判断触摸按键之前是否存在有效按压操作。
无按压计数值可以用no_touch_cycle(简称n_t_c)表示,该no_touch_cycle的初始值为0。
按压计数值可以用long_touch_cycle(简称l_t_c)表示,该long_touch_cycle的初始值为0。
基于此,上述的触摸事件侦测方法如下:图9为本申请再一实施例提供的触摸事件侦测方法的流程图,如图9所示,该方法包括如下步骤:
步骤S901:MCU获取N个通道上的当前电压。
步骤S902:MCU根据N个通道上的当前电压判断触摸按键当前是否存在按压操作。若触摸按键当前不存在按压操作,则执行步骤S903,若触摸按键当前存在按压操作,则执行步骤S907。
步骤S903:MCU判断c_c是否有效,若c_c有效,则执行步骤S904。否则,则继续执行步骤S901。
步骤S904:令n_t_c加一。
步骤S905:MCU判断n_t_c是否大于单击阈值。若n_t_c大于单击阈值,则执行步骤S906,否则,继续执行步骤S901。
步骤S906:MCU确定触摸按键存在单击动作。
步骤S907:MCU判断无按压计数值是否大于零。若无按压计数值大于零,则执行步骤S908;若无按压计数值等于零,则执行步骤S909。
步骤S908:MCU确定触摸按键存在双击动作。
步骤S909:MCU设置c_c为有效。
步骤S910:MCU确定触摸按键的当前按压操作所在位置与有效按压操作所在位置之间的距离。
步骤S911:MCU判断距离是否超过第一距离阈值。若该距离未超过第一距离阈值,则执行步骤S912,若该距离超过第一距离阈值,则执行步骤S915。
其中,该第一距离阈值通常长按操作被允许的最大误差距离。
步骤S912:令l_t_c加一。
步骤S913:MCU判断触摸按键的l_t_c是否大于长按阈值,若该l_t_c超过长按阈值,则执行步骤S914。否则,则继续执行步骤S901。
步骤S914:MCU确定触摸按键存在长按动作。
步骤S915:MCU根据触摸按键的当前按压操作所在位置与有效按压操作所在位置确定触摸按键上的滑动方向。
步骤S916:MCU判断滑动方向上的距离是否超过滑动阈值。若该距离超过了滑动阈值,则执行步骤S917。否则,则继续执行步骤S901。
步骤S917:MCU确定触摸按键存在滑动方向上的滑动动作。
需要说明的是,图8和图9对应实施例还适用于按键式按键,不同的是,按键式按键上的动作通常为单击、双击或者长按,不存在滑动动作。其原理可参考图8和图9对应实施例,本申请对此不再赘述。
综上,本申请提供一种触摸事件侦测方法,MCU可以根据触摸按键上当前是否存在按压操作、之前是否存在有效按压操作、按压计数值和无按压计数值以及按压操作所在位置与有效按压操作所在位置之间的距离等,可以确定触摸按键上的动作,如单击、双击、滑动或者长按等,从而丰富了MCU的功能。
图10为本申请一实施例提供的一种MCU的示意图,MCU通过N个通 道与触摸按键连接,触摸按键包括:N个触摸子按键,N个通道与N个触摸子按键一一对应,N为大于2的整数,如图10所示,MCU包括:
第一判断模块1001,用于根据N个通道上的当前电压,判断触摸按键当前是否存在按压操作。
第一确定模块1002,用于若触摸按键当前存在按压操作,则确定N个通道上的当前电压中的最大电压,并确定具有最大电压的第一通道。
第二确定模块1003,用于若第一通道具有两个与其相邻的第二通道和第三通道,则根据最大电压、第二通道上的当前电压、第三通道上的当前电压以及第一通道、第二通道和第三通道分别对应的触摸子按键的位置,确定触摸按键的按压位置。
可选的,第二确定模块1003具体用于:计算最大电压、第二通道上的当前电压、第三通道上的当前电压之和,得到第一通道、第二通道和第三通道上的当前电压和。分别计算最大电压、第二通道上的当前电压、第三通道上的当前电压与电压和的比值,以得到第一通道、第二通道、第三通道对应的权重。根据第一通道、第二通道、第三通道对应的权重,对第一通道、第二通道和第三通道分别对应的触摸子按键的位置进行加权平均,以得到触摸按键的按压位置。
可选的,MCU还包括:第二判断模块1004,用于若触摸按键当前不存在按压操作,则判断触摸按键之前是否存在有效按压操作,有效按压操作是还未根据该按压操作确定该触摸按键上的动作的按压操作,该动作包括以下任一项:单击、双击、长按、滑动。
第三判断模块1005,用于若触摸按键之前存在有效按压操作,则判断触摸按键的无按压计数值是否大于单击阈值,无按压计数值是在有效按压操作至触摸按键的当前按压操作之间所统计的无按压次数。
第三确定模块1006,用于若无按压计数值大于单击阈值,则确定触摸按键存在单击动作。
可选的,MCU还包括:第四判断模块1007,用于若触摸按键当前存在按压操作,则判断无按压计数值是否大于零。
第四确定模块1008,用于若无按压计数值大于零,则确定触摸按键存在双击动作。
可选的,MCU还包括:第五判断模块1009,用于若无按压计数值等于零,则确定触摸按键的当前按压操作所在位置与有效按压操作所在位置之间的距离,并判断距离是否超过第一距离阈值。
第六判断模块1010,用于若距离未超过第一距离阈值,则判断触摸按键的按压计数值是否大于长按阈值,按压计数值是在有效按压操作至触摸按键的当前按压操作之间所统计的按压次数。
第五确定模块1011,用于若按压计数值大于长按阈值,则确定触摸按键存在长按动作。
可选的,MCU还包括:第七判断模块1012,用于若距离超过第一距离阈值,则根据触摸按键的当前按压操作所在位置与有效按压操作所在位置确定触摸按键上的滑动方向,并判断滑动方向上的距离是否超过滑动阈值。
第六确定模块1013,用于若滑动方向上的距离超过滑动阈值,则确定触摸按键存在滑动方向上的滑动动作。
可选的,第一判断模块1001具体用于:若N个通道上的任一个通道的当前电压满足预设条件,则确定触摸按键当前存在按压操作;若N个通道上的所有通道的当前电压均不满足预设条件,则确定触摸按键当前不存在按压操作;其中,任一个通道的当前电压满足预设条件包括:任一个通道的基准电压与当前电压的差值大于预设阈值,任一个通道的基准电压为当任一个通道对应的触摸子按键上不存在按压操作时,任一个通道上的电压。
本申请还提供一种MCU,该MCU用于执行上述的触摸事件侦测方法,其内容和效果可参考方法实施例部分,对此不再赘述。
本申请还提供一种MCU,该MCU用于执行上述的触摸事件侦测方法,其内容和效果可参考方法实施例部分,对此不再赘述。
本申请还提供一种触控设备,包括:MCU和触摸按键,MCU通过N个通道与触摸按键连接,触摸按键包括:N个触摸子按键,N个通道与N个触摸子按键一一对应,N为大于2的整数。上述MCU用于执行上述的触摸事件侦测方法,其内容和效果可参考方法实施例部分,对此不再赘述。
本申请还提供一种可读存储介质,包括程序指令,当该程序指令在计算机上运行时,使得计算机执行如上述的触摸事件侦测方法,其内容和效果可参考方法实施例部分,对此不再赘述。
本申请还提供一种计算机程序产品,包括程序指令,该程序指令用于执行如上述的触摸事件侦测方法,其内容和效果可参考方法实施例部分,对此不再赘述。

Claims (17)

  1. 一种触摸事件侦测方法,其特征在于,所述方法应用于微控制单元MCU,所述MCU通过N个通道与触摸按键连接,所述触摸按键包括:N个触摸子按键,所述N个通道与所述N个触摸子按键一一对应,N为大于2的整数,所述方法包括:
    根据所述N个通道上的当前电压,判断所述触摸按键当前是否存在按压操作;
    若所述触摸按键当前存在按压操作,则确定所述N个通道上的当前电压中的最大电压,并确定具有所述最大电压的第一通道;
    若所述第一通道具有两个与其相邻的第二通道和第三通道,则根据所述最大电压、所述第二通道上的当前电压、所述第三通道上的当前电压以及所述第一通道、所述第二通道和所述第三通道分别对应的触摸子按键的位置,确定所述触摸按键的按压位置。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述最大电压、所述第二通道上的当前电压、所述第三通道上的当前电压以及所述第一通道、所述第二通道和所述第三通道分别对应的触摸子按键的位置,确定所述触摸按键的按压位置,包括:
    计算所述最大电压、所述第二通道上的当前电压、所述第三通道上的当前电压之和,得到所述第一通道、所述第二通道和所述第三通道上的当前电压和;
    分别计算所述最大电压、所述第二通道上的当前电压、所述第三通道上的当前电压与所述电压和的比值,以得到所述第一通道、所述第二通道、所述第三通道对应的权重;
    根据所述第一通道、所述第二通道、所述第三通道对应的权重,对所述第一通道、所述第二通道和所述第三通道分别对应的触摸子按键的位置进行加权平均,以得到所述触摸按键的按压位置。
  3. 根据权利要求1或2所述的方法,其特征在于,还包括:
    若所述触摸按键当前不存在按压操作,则判断所述触摸按键之前是否存在有效按压操作;
    若所述触摸按键之前存在有效按压操作,则判断所述触摸按键的无按压 计数值是否大于单击阈值,所述无按压计数值是在所述有效按压操作至所述触摸按键的当前按压操作之间所统计的无按压次数;
    若所述无按压计数值大于所述单击阈值,则确定所述触摸按键存在单击动作;
    其中,所述有效按压操作是还未根据该按压操作确定所述触摸按键上的动作的按压操作,所述动作包括以下任一项:单击、双击、长按、滑动。
  4. 根据权利要求3所述的方法,其特征在于,还包括:
    若所述触摸按键当前存在按压操作,则判断所述无按压计数值是否大于零;
    若所述无按压计数值大于零,则确定所述触摸按键存在双击动作。
  5. 根据权利要求4所述的方法,其特征在于,还包括:
    若所述无按压计数值等于零,则确定所述触摸按键的当前按压操作所在位置与所述有效按压操作所在位置之间的距离,并判断所述距离是否超过第一距离阈值;
    若所述距离未超过所述第一距离阈值,则判断所述触摸按键的按压计数值是否大于长按阈值,所述按压计数值是在所述有效按压操作至所述触摸按键的当前按压操作之间所统计的按压次数;
    若所述按压计数值大于所述长按阈值,则确定所述触摸按键存在长按动作。
  6. 根据权利要求5所述的方法,其特征在于,还包括:
    若所述距离超过所述第一距离阈值,则根据所述触摸按键的当前按压操作所在位置与所述有效按压操作所在位置确定所述触摸按键上的滑动方向,并判断所述滑动方向上的所述距离是否超过滑动阈值;
    若所述滑动方向上的所述距离超过所述滑动阈值,则确定所述触摸按键存在所述滑动方向上的滑动动作。
  7. 根据权利要求1或2所述的方法,其特征在于,所述根据所述N个通道上的当前电压,判断所述触摸按键当前是否存在按压操作,包括:
    若所述N个通道上的任一个通道的当前电压满足预设条件,则确定所述触摸按键当前存在按压操作;
    若所述N个通道上的所有通道的当前电压均不满足预设条件,则确定所 述触摸按键当前不存在按压操作;
    其中,所述任一个通道的当前电压满足预设条件包括:所述任一个通道的基准电压与当前电压的差值大于预设阈值,所述任一个通道的基准电压为当所述任一个通道对应的触摸子按键上不存在按压操作时,所述任一个通道上的电压。
  8. 一种MCU,其特征在于,所述MCU通过N个通道与触摸按键连接,所述触摸按键包括:N个触摸子按键,所述N个通道与所述N个触摸子按键一一对应,N为大于2的整数,所述MCU包括:
    第一判断模块,用于根据所述N个通道上的当前电压,判断所述触摸按键当前是否存在按压操作;
    第一确定模块,用于若所述触摸按键当前存在按压操作,则确定所述N个通道上的当前电压中的最大电压,并确定具有所述最大电压的第一通道;
    第二确定模块,用于若所述第一通道具有两个与其相邻的第二通道和第三通道,则根据所述最大电压、所述第二通道上的当前电压、所述第三通道上的当前电压以及所述第一通道、所述第二通道和所述第三通道分别对应的触摸子按键的位置,确定所述触摸按键的按压位置。
  9. 根据权利要求8所述的MCU,其特征在于,所述第二确定模块具体用于:
    计算所述最大电压、所述第二通道上的当前电压、所述第三通道上的当前电压之和,得到所述第一通道、所述第二通道和所述第三通道上的当前电压和;
    分别计算所述最大电压、所述第二通道上的当前电压、所述第三通道上的当前电压与所述电压和的比值,以得到所述第一通道、所述第二通道、所述第三通道对应的权重;
    根据所述第一通道、所述第二通道、所述第三通道对应的权重,对所述第一通道、所述第二通道和所述第三通道分别对应的触摸子按键的位置进行加权平均,以得到所述触摸按键的按压位置。
  10. 根据权利要求8或9所述的MCU,其特征在于,还包括:
    第二判断模块,用于若所述触摸按键当前不存在按压操作,则判断所述触摸按键之前是否存在有效按压操作;
    第三判断模块,用于若所述触摸按键之前存在有效按压操作,则判断所述触摸按键的无按压计数值是否大于单击阈值,所述无按压计数值是在所述有效按压操作至所述触摸按键的当前按压操作之间所统计的无按压次数;
    第三确定模块,用于若所述无按压计数值大于所述单击阈值,则确定所述触摸按键存在单击动作;
    其中,所述有效按压操作是还未根据该按压操作确定所述触摸按键上的动作的按压操作,所述动作包括以下任一项:单击、双击、长按、滑动。
  11. 根据权利要求10所述的MCU,其特征在于,还包括:
    第四判断模块,用于若所述触摸按键当前存在按压操作,则判断所述无按压计数值是否大于零;
    第四确定模块,用于若所述无按压计数值大于零,则确定所述触摸按键存在双击动作。
  12. 根据权利要求11所述的MCU,其特征在于,还包括:
    第五判断模块,用于若所述无按压计数值等于零,则确定所述触摸按键的当前按压操作所在位置与所述有效按压操作所在位置之间的距离,并判断所述距离是否超过第一距离阈值;
    第六判断模块,用于若所述距离未超过所述第一距离阈值,则判断所述触摸按键的按压计数值是否大于长按阈值,所述按压计数值是在所述有效按压操作至所述触摸按键的当前按压操作之间所统计的按压次数;
    第五确定模块,用于若所述按压计数值大于所述长按阈值,则确定所述触摸按键存在长按动作。
  13. 根据权利要求12所述的MCU,其特征在于,还包括:
    第七判断模块,用于若所述距离超过所述第一距离阈值,则根据所述触摸按键的当前按压操作所在位置与所述有效按压操作所在位置确定所述触摸按键上的滑动方向,并判断所述滑动方向上的所述距离是否超过滑动阈值;
    第六确定模块,用于若所述滑动方向上的所述距离超过所述滑动阈值,则确定所述触摸按键存在所述滑动方向上的滑动动作。
  14. 根据权利要求8或9所述的MCU,其特征在于,所述第一判断模块具体用于:
    若所述N个通道上的任一个通道的当前电压满足预设条件,则确定所述 触摸按键当前存在按压操作;
    若所述N个通道上的所有通道的当前电压均不满足预设条件,则确定所述触摸按键当前不存在按压操作;
    其中,所述任一个通道的当前电压满足预设条件包括:所述任一个通道的基准电压与当前电压的差值大于预设阈值,所述任一个通道的基准电压为当所述任一个通道对应的触摸子按键上不存在按压操作时,所述任一个通道上的电压。
  15. 一种MCU,其特征在于,所述MCU通过N个通道与触摸按键连接,所述触摸按键包括:N个触摸子按键,所述N个通道与所述N个触摸子按键一一对应,N为大于2的整数,所述MCU用于执行如权利要求1-7任一项所述的触摸事件侦测方法。
  16. 一种触控设备,其特征在于,包括:MCU和触摸按键,所述MCU通过N个通道与触摸按键连接,所述触摸按键包括:N个触摸子按键,所述N个通道与所述N个触摸子按键一一对应,N为大于2的整数,所述MCU用于执行如权利要求1-7任一项所述的触摸事件侦测方法。
  17. 一种可读存储介质,其特征在于,包括程序指令,当所述程序指令在计算机上运行时,使得所述计算机执行如权利要求1-7任一项所述的触摸事件侦测方法。
PCT/CN2019/114397 2019-10-30 2019-10-30 触摸事件侦测方法、mcu、触控设备及存储介质 WO2021081817A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/114397 WO2021081817A1 (zh) 2019-10-30 2019-10-30 触摸事件侦测方法、mcu、触控设备及存储介质
CN201980002387.5A CN113168258B (zh) 2019-10-30 2019-10-30 触摸事件侦测方法、mcu、触控设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/114397 WO2021081817A1 (zh) 2019-10-30 2019-10-30 触摸事件侦测方法、mcu、触控设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021081817A1 true WO2021081817A1 (zh) 2021-05-06

Family

ID=75715690

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/114397 WO2021081817A1 (zh) 2019-10-30 2019-10-30 触摸事件侦测方法、mcu、触控设备及存储介质

Country Status (2)

Country Link
CN (1) CN113168258B (zh)
WO (1) WO2021081817A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113437960A (zh) * 2021-08-13 2021-09-24 四川中微芯成科技有限公司 一种电容式触摸按键实现环形触摸的方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201163764Y (zh) * 2008-01-31 2008-12-10 杭州利尔达科技有限公司 基于mcu的电容感应式触摸按键
CN101853102A (zh) * 2010-06-01 2010-10-06 深圳市汇顶科技有限公司 一种触控设备配置参数的自动生成方法、系统
CN102162184A (zh) * 2011-04-19 2011-08-24 海尔集团公司 一种洗衣机触摸控制方法
US20160170532A1 (en) * 2014-12-15 2016-06-16 Nxp B.V. User interface unit, electronic device and manufacturing method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102495681B (zh) * 2011-11-23 2014-07-09 江苏惠通集团有限责任公司 具有触摸按键的控制设备
CN103607187B (zh) * 2013-11-12 2017-02-15 青岛歌尔声学科技有限公司 一种检测电容触摸按键是否被触发的方法和装置
CN107193479B (zh) * 2017-05-26 2018-07-10 网易(杭州)网络有限公司 信息处理方法、装置、电子设备及存储介质
CN107294522B (zh) * 2017-07-05 2020-09-01 Oppo广东移动通信有限公司 基于触摸按键的响应方法、装置、存储介质及电子设备
CN109039320A (zh) * 2018-08-15 2018-12-18 深圳市麦道微电子技术有限公司 一种可以满足复杂工况的高可靠的电容式触摸按键

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201163764Y (zh) * 2008-01-31 2008-12-10 杭州利尔达科技有限公司 基于mcu的电容感应式触摸按键
CN101853102A (zh) * 2010-06-01 2010-10-06 深圳市汇顶科技有限公司 一种触控设备配置参数的自动生成方法、系统
CN102162184A (zh) * 2011-04-19 2011-08-24 海尔集团公司 一种洗衣机触摸控制方法
US20160170532A1 (en) * 2014-12-15 2016-06-16 Nxp B.V. User interface unit, electronic device and manufacturing method

Also Published As

Publication number Publication date
CN113168258A (zh) 2021-07-23
CN113168258B (zh) 2022-09-20

Similar Documents

Publication Publication Date Title
JP3175947U (ja) ハンドジェスチャー又は図形で操作するタッチコントロールロック回路構造
TWI605359B (zh) 觸控板之手勢辨識方法與手勢辨識裝置
US8102376B2 (en) Method for object detection on a capacitive touchpad
US8013842B2 (en) Method for gesture detection on a capacitive touchpad
US7701447B2 (en) Method for multiple objects detection on a capacitive touchpad
JP4073449B2 (ja) タッチパネルのハンドジェスチャー検出方法
US8743061B2 (en) Touch sensing method and electronic device
US7804490B2 (en) Method for multiple gesture detection and verification on a touchpad
WO2021083334A1 (zh) 电子设备及其控制方法
CN103605465A (zh) 一种控制手持设备的方法及手持设备
US7982717B2 (en) Method for gesture detection on a touchpad
US7710404B2 (en) Method for gesture detection on a touchpad
WO2021081738A1 (zh) 滑动信号的识别方法、mcu、触控设备及存储介质
WO2021081817A1 (zh) 触摸事件侦测方法、mcu、触控设备及存储介质
TW201608487A (zh) 防誤觸方法
CN104076962A (zh) 一种触摸输入装置的状态控制方法及装置
WO2014075540A1 (zh) 触摸屏滚屏控制系统及方法
CN102214028B (zh) 触控板的手势识别方法与手势识别装置
US20200050314A1 (en) Touch sensing method, electronic device and non-transitory computer readable recording medium device
JP4695451B2 (ja) 静電容量式タッチパネルの物品検出方法
JP4098314B2 (ja) 静電容量式タッチパネルの複数物品検出方法
TW201704955A (zh) 觸控式電子裝置及其控制方法
TW201931071A (zh) 輸入感測系統、輸入感測裝置及其操作方法
JP4073450B2 (ja) タッチパネルのハンドジェスチャー検出方法
TWI823221B (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: 19950716

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: 19950716

Country of ref document: EP

Kind code of ref document: A1