Let a tap survive a centimetre of finger drift and log every refused tap (0.2.28)
The touch guard dropped a tap as soon as the finger drifted more than 18 px (under 3 mm) from its very first contact point, on both boards and regardless of the page-swipe setting; LVGL itself never cancelled these clicks (no scrollable ancestors, gestures do not suppress clicks). A finger that flattens or rolls while pressing was enough, and the tap vanished without a trace in the log. The limit is now about one centimetre per board (TOUCH_MOVE_LIMIT_PX: Guition 67 px, CYD 56 px), measured from a reference that settles over the first four samples; only the contact that started the touch is followed, so a second finger no longer counts as movement; the minimum contact time is per board too (TOUCH_MIN_PRESS_MS: 60 ms resistive, 20 ms capacitive). Every refused tap is logged on INFO with its reason (moved, too short, already used, bounce). Firmware 0.2.23 for CYD and Guition. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
# Guition ESP32-S3-4848S040 / 4-inch EU wallbox, 480x480 IPS + GT911.
|
||||
# Use guition-device.yaml; see docs/GUITION.md. CYD hardware is a separate profile.
|
||||
substitutions:
|
||||
SCREEN_FIRMWARE_VERSION: "0.2.22"
|
||||
SCREEN_FIRMWARE_VERSION: "0.2.23"
|
||||
# A tap survives a finger that drifts up to this far (480 px over 72 mm: 1 cm); further is a swipe.
|
||||
TOUCH_MOVE_LIMIT_PX: "67"
|
||||
# Shortest contact that counts as a tap; a resistive panel bounces, a capacitive one does not.
|
||||
TOUCH_MIN_PRESS_MS: "20"
|
||||
DYNAMIC_TILES: "true"
|
||||
DASHBOARD_INBOX_INTERNAL: "false"
|
||||
DEVICE_NAME: "guition-new"
|
||||
@@ -591,6 +595,7 @@ esphome:
|
||||
priority: -100
|
||||
then:
|
||||
- lambda: |-
|
||||
cyd::touch_guard.configure(${TOUCH_MOVE_LIMIT_PX}, ${TOUCH_MIN_PRESS_MS});
|
||||
id(last_touch_ms) = millis();
|
||||
id(display_dimmed) = false;
|
||||
lv_obj_set_style_pad_row(id(vacuum_actions), 4, 0);
|
||||
@@ -1801,13 +1806,14 @@ touchscreen:
|
||||
- lambda: |-
|
||||
id(last_touch_ms) = millis();
|
||||
id(touch_down) = true;
|
||||
cyd::touch_guard.begin(millis(), touch.x, touch.y);
|
||||
cyd::touch_guard.begin(millis(), touch.x, touch.y, touch.id);
|
||||
ESP_LOGI("touch", "GT911 press x=%u y=%u test=%d", touch.x, touch.y, id(calibration_active));
|
||||
on_update:
|
||||
- lambda: |-
|
||||
id(last_touch_ms) = millis();
|
||||
// Only the contact that started the touch counts; the guard ignores other ids.
|
||||
for (const auto &point : touches) {
|
||||
cyd::touch_guard.update(point.x, point.y);
|
||||
cyd::touch_guard.update(point.x, point.y, point.id);
|
||||
}
|
||||
on_release:
|
||||
- lambda: |-
|
||||
|
||||
Reference in New Issue
Block a user