Skip to content

Commit 0df84db

Browse files
committed
Touch: Fix tap detection for P8b variant
1 parent 48123d9 commit 0df84db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/touchhandler/TouchHandler.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ bool TouchHandler::GetNewTouchInfo() {
7878
#elif defined(DRIVER_TOUCH_GESTURE)
7979
if (info.gesture != Pinetime::Drivers::Cst816S::Gestures::None) {
8080
gesture = ConvertGesture(info.gesture);
81+
// A new variant configuration behaves in a way such that it generates a gesture event at the start of a physical gesture,
82+
// but does not set the info.touching flag at all. Since gestures are handled separately, special behaviour is only needed
83+
// for the tap event. For the original P8b, which always sets info.touching = true, this operation is idempotent.
84+
if (gesture == TouchEvents::Tap) {
85+
info.touching = true;
86+
}
8187
}
8288
#elif defined(DRIVER_TOUCH_DYNAMIC)
8389
if (info.gesture != Pinetime::Drivers::Cst816S::Gestures::None) {

0 commit comments

Comments
 (0)