Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Detect USB connections/input devices. #476

Open
luluco250 opened this issue Sep 15, 2023 · 0 comments
Open

[FR] Detect USB connections/input devices. #476

luluco250 opened this issue Sep 15, 2023 · 0 comments
Labels
feature request Proposal for new features

Comments

@luluco250
Copy link

Is your feature request related to a problem? Please describe.
When using a gamepad via USB, like a Gamesir X2, it's convenient to lock the device orientation to landscape, something that would be nice to automate. You could also wire it up to open a game UI app or disable battery optimization.

I have not found any simple way to detect USB device connection, there may be some obscure Android event or such that would allow for it, but nothing simple like detecting bluetooth devices.

Describe the solution you'd like
An event/condition to detect USB device connections, alongside product and vendor IDs if possible (not sure how much Android exposes USB info from the Linux kernel).

Describe alternatives you've considered [optional]
If detecting USB devices in general proves difficult/not allowed by Android, then perhaps registering an InputDeviceListener would suffice for this specific use case (provided we can detect what kind of input device it is to make the rule more useful).

Additional context
These devices appear to connect like any other USB gamepad on Android and a notification appears showing that the OS is "charging them" (though it doesn't appear to affect battery life significantly). Some also feature passthrough charging.

Here's what one of these devices looks like (click to expand):
@luluco250 luluco250 added the feature request Proposal for new features label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Proposal for new features
Projects
None yet
Development

No branches or pull requests

1 participant