This commit is contained in:
Jonas Bark
2025-12-19 21:06:13 +01:00
parent 406ccfa2ce
commit 39b49bb9de
4 changed files with 14 additions and 7 deletions

View File

@@ -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**:

View File

@@ -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,

View File

@@ -116,6 +116,7 @@ class _ButtonEditPageState extends State<ButtonEditPage> {
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()),

View File

@@ -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")