-
Notifications
You must be signed in to change notification settings - Fork 118
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
Monitoring USB ports #251
Comments
Looks like RegisterDeviceNotification is the way to go about it: https://docs.microsoft.com/en-us/windows/win32/devio/registering-for-device-notification However, this requires intercepting the message loop for a @cbracken, any thoughts on this? |
Oh -- wondering if |
Flutter 2.10 includes stable Windows support. @timsneath Does this have a positive effect on monitoring USB ports on Windows? |
Not particularly: the same notes above apply, since this is really about integrating with the operating system through calling Win32 APIs rather than anything in the UI itself. One minor update is that we now have an experimental runner written in Dart: https://pub.dev/packages/win32_runner This is not supported or maintained by the team as a whole, and it has some sizeable caveats (e.g. it supports packages but not plugins) but it provides another path to writing the message handler above. |
@timsneath I didn't know the Dart runner yet. Thanks for your work and the tip. |
@timsneath Can we use this function to hook message in flutter? I have tried this with WH_KEYBOARD_LL but it doesn't work |
Would https://api.flutter.dev/flutter/dart-ffi/NativeCallable/NativeCallable.listener.html help with any of this? @yanshouwang here you mention something about creating a message-only window in dart. Can you share more details about that? |
Here is the code I use to listen drives state, win32_util |
Thank you very much! I'll take a look. |
What's the latest update on this ? |
Hi Tim,
For a Flutter app for the Windows Desktop, I'm looking for a way to monitor changes to the USB ports. FYI, the Flutter app should respond to plugging in or unplugging a USB joystick/gamepad.
Does the
win32
package provide a suitable feature that I have overlooked?The text was updated successfully, but these errors were encountered: