diff --git a/CHANGELOG.md b/CHANGELOG.md index f2434b2..3aa6b2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 3.5.1 (unreleased) +**Fixes:** +- Update Rouvy keymap to support virtual shifting in their latest version + ### 3.5.0 (16-11-2025) **New Features:** - Dark mode support diff --git a/lib/utils/keymap/apps/rouvy.dart b/lib/utils/keymap/apps/rouvy.dart index b3616f6..e20a29c 100644 --- a/lib/utils/keymap/apps/rouvy.dart +++ b/lib/utils/keymap/apps/rouvy.dart @@ -1,4 +1,7 @@ +import 'dart:io'; + import 'package:dartx/dartx.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; import 'package:swift_control/utils/keymap/apps/supported_app.dart'; @@ -13,21 +16,23 @@ class Rouvy extends SupportedApp { name: 'Rouvy', packageName: "eu.virtualtraining.rouvy.android", compatibleTargets: Target.values, - supportsZwiftEmulation: true, + supportsZwiftEmulation: !kIsWeb && Platform.isAndroid, keymap: Keymap( keyPairs: [ // https://support.rouvy.com/hc/de/articles/32452137189393-Virtuelles-Schalten#h_01K5GMVG4KVYZ0Y6W7RBRZC9MA KeyPair( buttons: ControllerButton.values.filter((e) => e.action == InGameAction.shiftDown).toList(), inGameAction: InGameAction.shiftDown, - physicalKey: PhysicalKeyboardKey.numpadSubtract, - logicalKey: LogicalKeyboardKey.numpadSubtract, + physicalKey: null, + logicalKey: null, + touchPosition: Offset(94, 80), ), KeyPair( buttons: ControllerButton.values.filter((e) => e.action == InGameAction.shiftUp).toList(), inGameAction: InGameAction.shiftUp, - physicalKey: PhysicalKeyboardKey.numpadAdd, - logicalKey: LogicalKeyboardKey.numpadAdd, + physicalKey: null, + logicalKey: null, + touchPosition: Offset(94, 72), ), // like escape KeyPair( diff --git a/lib/utils/requirements/multi.dart b/lib/utils/requirements/multi.dart index 5f1c54f..a73ef59 100644 --- a/lib/utils/requirements/multi.dart +++ b/lib/utils/requirements/multi.dart @@ -7,6 +7,7 @@ import 'package:keypress_simulator/keypress_simulator.dart'; import 'package:swift_control/main.dart'; import 'package:swift_control/utils/keymap/apps/custom_app.dart'; import 'package:swift_control/utils/keymap/apps/my_whoosh.dart'; +import 'package:swift_control/utils/keymap/apps/rouvy.dart'; import 'package:swift_control/utils/keymap/apps/supported_app.dart'; import 'package:swift_control/utils/keymap/apps/zwift.dart'; import 'package:swift_control/utils/requirements/platform.dart'; @@ -229,7 +230,25 @@ class TargetRequirement extends PlatformRequirement { return DropdownMenuEntry( value: app, label: app.name, - labelWidget: app is Zwift && !(Platform.isWindows || Platform.isAndroid) + labelWidget: app is Rouvy + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(app.name), + Row( + children: [ + Expanded( + child: Text( + 'Make sure you\'ve enabled the "On-screen virtual shifting" in the Rouvy settings.', + style: TextStyle(fontSize: 12, color: Colors.grey), + ), + ), + Icon(Icons.warning_amber), + ], + ), + ], + ) + : app is Zwift && !(Platform.isWindows || Platform.isAndroid) ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/apps/zwift_tile.dart b/lib/widgets/apps/zwift_tile.dart index f3e4cff..c94bf63 100644 --- a/lib/widgets/apps/zwift_tile.dart +++ b/lib/widgets/apps/zwift_tile.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:swift_control/bluetooth/devices/zwift/zwift_emulator.dart'; import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/keymap/apps/rouvy.dart'; import 'package:swift_control/utils/keymap/apps/zwift.dart'; import 'package:swift_control/widgets/small_progress_indicator.dart'; @@ -41,11 +40,7 @@ class _ZwiftTileState extends State { if (!settings.getZwiftEmulatorEnabled()) Expanded( child: Text( - 'Disabled. ${settings.getTrainerApp() is Zwift - ? 'Virtual shifting and on screen navigation will not work.' - : settings.getTrainerApp() is Rouvy - ? 'Virtual shifting will not work.' - : ''}', + 'Disabled. ${settings.getTrainerApp() is Zwift ? 'Virtual shifting and on screen navigation will not work.' : ''}', ), ) else ...[