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