diff --git a/CHANGELOG.md b/CHANGELOG.md index 326ea34..4b4e66e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ BikeControl now offers a free trial period of 5 days for all features, so you can test everything before deciding to purchase a license. Please contact the support if you experience any issues! **Features**: +- support for SRAM AXS/eTap + - only single or double click is supported (no individual button mapping possible, yet) - use your phone/tablet for steering by attaching your device on your handlebar! **Fixes**: diff --git a/lib/bluetooth/devices/sram/sram_axs.dart b/lib/bluetooth/devices/sram/sram_axs.dart index a0b998d..f691767 100644 --- a/lib/bluetooth/devices/sram/sram_axs.dart +++ b/lib/bluetooth/devices/sram/sram_axs.dart @@ -10,7 +10,7 @@ import 'package:universal_ble/universal_ble.dart'; import '../bluetooth_device.dart'; class SramAxs extends BluetoothDevice { - SramAxs(super.scanResult) : super(availableButtons: []); + SramAxs(super.scanResult) : super(availableButtons: [], isBeta: true); Timer? _singleClickTimer; int _tapCount = 0; @@ -35,16 +35,20 @@ class SramAxs extends BluetoothDevice { ); await UniversalBle.subscribeNotifications(device.deviceId, service.uuid, characteristic.uuid); + + // add both buttons + _singleClickButton(); + _doubleClickButton(); } ControllerButton _singleClickButton() => getOrAddButton( - 'SRAM Action (Single Click)', - () => const ControllerButton('SRAM Action (Single Click)', action: InGameAction.shiftUp), + 'SRAM Tap', + () => const ControllerButton('SRAM Tap', action: InGameAction.shiftUp), ); ControllerButton _doubleClickButton() => getOrAddButton( - 'SRAM Action (Double Click)', - () => const ControllerButton('SRAM Action (Double Click)', action: InGameAction.shiftDown), + 'SRAM Double Tap', + () => const ControllerButton('SRAM Double Tap', action: InGameAction.shiftDown), ); void _emitClick(ControllerButton button) { @@ -131,7 +135,7 @@ class SramAxs extends BluetoothDevice { ), onPressed: () { final values = [ - for (var v = 150; v <= 800; v += 50) v, + for (var v = 150; v <= 600; v += 50) v, ]; showDropdown( context: context, diff --git a/lib/pages/button_edit.dart b/lib/pages/button_edit.dart index 227ff6a..4a5ebf4 100644 --- a/lib/pages/button_edit.dart +++ b/lib/pages/button_edit.dart @@ -116,6 +116,7 @@ class _ButtonEditPageState extends State { width: _keyPair.buttons.first.color != null ? baseHeight : null, height: _keyPair.buttons.first.color != null ? baseHeight : null, padding: EdgeInsets.all(_bumped ? 0 : 6.0), + constraints: BoxConstraints(maxWidth: 120), child: ButtonWidget(button: _keyPair.buttons.first), ), Expanded(child: SizedBox()), diff --git a/lib/utils/keymap/keymap.dart b/lib/utils/keymap/keymap.dart index edb3c60..77a2742 100644 --- a/lib/utils/keymap/keymap.dart +++ b/lib/utils/keymap/keymap.dart @@ -208,7 +208,7 @@ class KeyPair { if (baseKey.trim().isEmpty) { return 'Space'; } - return baseKey; + return baseKey + (inGameAction != null ? ' (${inGameAction!.title})' : ''); } // Format modifiers + key (e.g., "Ctrl+Alt+R")