andyvorld / LGSTrayBattery

A tray app used to track battery levels of wireless Logitech mouse.
GNU General Public License v3.0
391 stars 33 forks source link

Automatically re-select device on disconnect/connect #21

Open Xalaxis opened 3 years ago

Xalaxis commented 3 years ago

I've noticed that when I attach my G703 wireless as a wired device, LTB detects the device in wired mode but doesn't 'switch' to it, instead requiring manual selection. I think if no other devices are available, the only available one should automatically be selected to fix this issue.

andyvorld commented 3 years ago

I have tried to implement this feature, but currently I don't know if its going to be a degredation or an improvement. Due to the library I was using/way I wrote my code, there does not seem to be a on connect/disconnect hook without excessive polling.

As of v1.0.9, when the last used device is not found on a scan, it automatically switches to the first item in the list, double clicking the icon should force a rescan and battery refresh.

Xalaxis commented 3 years ago

This has fixed the issue of not reselecting the only device available, thanks!

Do you think it would be too much polling to rescan for devices every minute or so? I understand not wanting to do it continuously but it would be nice if it picked it up eventually in the background without needing to double click or right click refresh.

Xalaxis commented 2 years ago

Just updating that I'm still having the issue of having to manually "Rescan Devices" when I switch from wireless to wired mode and vice versa.

hiuwo commented 1 year ago

I still have this issue as of two 2023 Jun 12 withn v2.1.3 and 502 x plus (wireless)