From cbef8fc044fba34734496fe7e85f2ccefa6b9e32 Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Wed, 1 Oct 2025 20:23:02 +0200 Subject: [PATCH] fix #82 --- CHANGELOG.md | 3 ++- lib/bluetooth/devices/base_device.dart | 5 ++--- lib/utils/actions/android.dart | 6 +++++- pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b8cb34..41714e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ -### 2.6.1 (2025-10-01) +### 2.6.2 (2025-10-01) - fix a few issues with the new touch placement feature - add a workaround for Zwift Click V2 which resets the device when button events are no longer sent +- fix issue on Android where only a "touch down" was sent, but no "touch up" ### 2.6.0 (2025-09-30) - refactor touch placements: show touches on screen, fix misplaced coordinates - should fix #64 diff --git a/lib/bluetooth/devices/base_device.dart b/lib/bluetooth/devices/base_device.dart index d86384a..4a3fc40 100644 --- a/lib/bluetooth/devices/base_device.dart +++ b/lib/bluetooth/devices/base_device.dart @@ -303,10 +303,9 @@ abstract class BaseDevice { _longPressTimer = Timer.periodic(const Duration(milliseconds: 350), (timer) async { _performActions(buttonsClicked, true); }); - } else if (isLongPress) { - // Update currently pressed buttons - _previouslyPressedButtons = buttonsClicked.toSet(); } + // Update currently pressed buttons + _previouslyPressedButtons = buttonsClicked.toSet(); return _performActions(buttonsClicked, false); } diff --git a/lib/utils/actions/android.dart b/lib/utils/actions/android.dart index 45a4b6b..f8df7ad 100644 --- a/lib/utils/actions/android.dart +++ b/lib/utils/actions/android.dart @@ -44,7 +44,11 @@ class AndroidActions extends BaseActions { final point = supportedApp!.resolveTouchPosition(action: button, windowInfo: windowInfo); if (point != Offset.zero) { accessibilityHandler.performTouch(point.dx, point.dy, isKeyDown: isKeyDown, isKeyUp: isKeyUp); - return "Touch performed at: ${point.dx.toInt()}, ${point.dy.toInt()}"; + return "Touch performed at: ${point.dx.toInt()}, ${point.dy.toInt()} -> ${isKeyDown + ? "down" + : isKeyUp + ? "up" + : "click"}"; } return "No touch performed"; } diff --git a/pubspec.yaml b/pubspec.yaml index c4ce25b..43d5f35 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: swift_control description: "SwiftControl - Control your virtual riding" publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 2.6.1+7 +version: 2.6.2+8 environment: sdk: ^3.7.0