mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
ets_fps: filter unexpected double-click event
Some of the user's sliding may be mistaken for double-clicking event. filtering out the min double-click interval tim to reducing the probability of unexpected double-click. Change-Id: I0b1a43d3ed7aac601865127076f5b2c51f6eb3d4 Signed-off-by: wuwl10 <wuwl10@motorola.com> Reviewed-on: https://gerrit.mot.com/1735804 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key (cherry picked from commit 60cdf2a116c3e7cc321eab8038065efc98e3a3fc) Reviewed-on: https://gerrit.mot.com/1737936
This commit is contained in:
parent
a4cac1b469
commit
3b8344ecee
1 changed files with 3 additions and 2 deletions
|
|
@ -213,7 +213,7 @@ static unsigned int prev_keycode;
|
|||
#define SINGLECLICK_INTERVAL 150
|
||||
#define SINGLECLICK_INTERVAL_MIN 5
|
||||
#define DOUBLECLICK_INTERVAL 300
|
||||
|
||||
#define DOUBLECLICK_INTERVAL_MIN 70
|
||||
|
||||
#define KEYEVENT_CLICK KEY_FPS_TAP /* 0x232 */
|
||||
#define KEYEVENT_CLICK_ACTION KEY_PRESS_RELEASE
|
||||
|
|
@ -438,7 +438,8 @@ void translated_command_converter(char cmd, struct etspi_data *etspi)
|
|||
#endif
|
||||
#if ENABLE_TRANSLATED_DOUBLE_CLICK
|
||||
if (g_SingleClick >= 2) {
|
||||
if ((g_SingleClickJiffies - g_DoubleClickJiffies) < (HZ * DOUBLECLICK_INTERVAL / 1000)) {
|
||||
if (((g_SingleClickJiffies - g_DoubleClickJiffies) < (HZ * DOUBLECLICK_INTERVAL / 1000))
|
||||
&& ((g_SingleClickJiffies - g_DoubleClickJiffies) >= (HZ * DOUBLECLICK_INTERVAL_MIN / 1000))) {
|
||||
/* Double click event */
|
||||
send_key_event(etspi, KEYEVENT_DOUBLECLICK, KEYEVENT_DOUBLECLICK_ACTION);
|
||||
g_SingleClick = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue