Catch press and hold state

This commit is contained in:
Peter Feerick
2021-09-11 18:43:13 +10:00
parent dc9d213fc5
commit f70f247302
+5 -3
View File
@@ -524,7 +524,7 @@ void touchPanelRead()
if (ft6x06_TS_DetectTouch(TOUCH_FT6236_I2C_ADDRESS)) { if (ft6x06_TS_DetectTouch(TOUCH_FT6236_I2C_ADDRESS)) {
handleTouch(); handleTouch();
if (touchState.event == TE_DOWN) if (touchState.event == TE_DOWN && downTime == 0)
downTime = now; downTime = now;
} }
else { else {
@@ -537,9 +537,11 @@ void touchPanelRead()
tapCount++; tapCount++;
touchState.tapCount = tapCount; touchState.tapCount = tapCount;
tapTime = now; tapTime = now;
} else {
touchState.tapCount = 0; //not a tap
} }
} downTime = 0;
else { } else {
touchState.x = LCD_WIDTH; touchState.x = LCD_WIDTH;
touchState.y = LCD_HEIGHT; touchState.y = LCD_HEIGHT;
touchState.event = TE_SLIDE_END; touchState.event = TE_SLIDE_END;