Commit Graph

29 Commits

Author SHA1 Message Date
Jonas Acker
26c82aac90 fix(accessibility): don't lose key events to the overlay engine
flutter_overlay_window starts a second Flutter engine when the activity
attaches, which registers this plugin again. Its handlers replaced the app
engine's in the static Observable, so every key the accessibility service
forwarded went to an engine nobody listens on: HID keyboards, remotes and
gamepads did nothing while the service swallowed their keys. Keep one
receiver per engine and send events to all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:35:05 +02:00
Jonas Bark
4346c83bc1 fix potential crash 2026-02-07 09:56:35 +01:00
Jonas Bark
13bd08d909 Android: simulate additional actions for local connection method (Left, Down, Right, Up, Down, Select, Back, Home, Recent Apps), allowing you to navigate in the trainer app, if supported 2026-01-17 13:52:27 +01:00
copilot-swe-agent[bot]
607fd7c77a Add Android global actions support
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2026-01-17 12:06:48 +00:00
Jonas Bark
6f3142c913 fix detection for hardware buttons when BikeControl is in foreground, change notification icon 2026-01-16 12:38:10 +01:00
Jonas Bark
31b6fba94d fix implementation 2026-01-12 18:42:54 +01:00
copilot-swe-agent[bot]
a3470bfc2c Address code review feedback: memory leak and thread safety
- Store keymap update subscription to allow cancellation on re-init
- Fix List<String?> to List<String> in setHandledKeys signature
- Use ConcurrentHashMap.newKeySet() for thread-safe handledKeys access
- Clear and update the set instead of replacing it

Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2026-01-12 16:52:22 +00:00
copilot-swe-agent[bot]
9a0bbd2b96 Change approach: Use keymap-based filtering for HID key events
- Add setHandledKeys API to pass list of keys with keymaps to Android side
- Android AccessibilityService checks if key is in handled keys set before swallowing
- Dart side updates handled keys list whenever keymap changes
- Remove hardcoded media/volume key filtering
- This allows keyboards to work for typing while still capturing mapped keys

Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2026-01-12 16:49:19 +00:00
copilot-swe-agent[bot]
82998d3ec2 Fix Android accessibility service to only intercept media/volume keys
- Add isMediaOrVolumeKey() helper to filter key events by key code
- Only swallow media and volume keys (play/pause, next, volume up/down, etc.)
- Let all other keys (typing keys, navigation, etc.) pass through to the system
- This fixes Bluetooth keyboard interference when BikeControl is running

Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2026-01-12 16:36:18 +00:00
Jonas Bark
43507febf9 fix hid device functionality when accessibility service is active 2025-12-05 19:48:34 +01:00
Jonas Bark
7b1a96b5a0 status widget for accessibility service 2025-11-23 20:57:52 +00:00
Jonas Bark
281f7e0fb6 detect media key source - don't handle it when coming from phone #110 2025-11-08 22:31:12 +01:00
Jonas Bark
d4a102e2f2 allow to ignore HID device input 2025-11-04 10:05:52 +01:00
Jonas Bark
9aa902bc22 support HID key events on Android #110 2025-11-04 09:53:52 +01:00
Jonas Bark
28073ab6ef Android: fix touches for very old Android versions 2025-10-19 08:55:15 +02:00
Jonas Bark
2fd14c5ddf fix delayed clicks in some apps 2025-10-02 21:05:15 +02:00
Jonas Bark
0fb1bad7ba fix crashes on some Android devices 2025-09-27 12:18:50 +02:00
Jonas Bark
d1b176b68b allow long touches / keyboard presses (fixes #61) 2025-09-08 14:01:28 +02:00
copilot-swe-agent[bot]
9608829d1a Refactor action method parameters from isPressed/isRepeated to isKeyDown/isKeyUp
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2025-09-07 10:18:20 +00:00
Jonas Bark
458c5f5286 Android: better approximation of button placement for freeform windows 2025-04-07 15:21:45 +02:00
Jonas Bark
07ff604042 Zwift Ride: add buttonPowerDown to shift gears
Zwift Play: Fix buttonShift assignment
Android: fix Media next button
2025-03-31 20:20:47 +02:00
Jonas Bark
86b6345d89 try to resolve https://github.com/jonasbark/swiftcontrol/issues/3#issuecomment-2763361122 2025-03-29 14:37:07 +01:00
Jonas Bark
296543f95e resolve https://github.com/jonasbark/swiftcontrol/issues/2 2025-03-29 12:53:27 +01:00
Jonas Bark
50fda1d9eb control media (Android only for now), add menu 2025-03-28 15:24:25 +01:00
Jonas Bark
5ed4865562 fix android window foreground issue 2025-03-27 19:57:34 +01:00
Jonas Bark
9c46cf67ca Android works 2025-03-27 18:17:25 +01:00
Jonas Bark
73bf894cd0 foreground notification on Android 2025-03-27 17:44:27 +01:00
Jonas Bark
c46253a77f accessibility implementation #2 2025-03-27 16:38:01 +01:00
Jonas Bark
e60c6a4707 accessibility implementation #1 2025-03-27 16:15:53 +01:00