Open henryso opened 1 year ago
@henryso Thanks for opening an issue! I haven't yet tried with that combination of versions. If possible, an example would be useful (and if you wanted to make a PR, less work for me on #66 :smile:). One thing that would be useful to verify as well is whether this also happens with the current examples in the stick repo (on the old pasts version). What Linux distribution are you on?
@AldaronLau Yes, it behaves the same with the example at https://docs.rs/stick/0.13.0/stick/index.html, only using stick 0.13 instead of 0.12. I am using Gentoo Linux, kernel version 6.1.19 (a little old, yes). I don't have a fix, so I can't offer a PR, at least not yet. I'm currently working around it by ignoring any duplicate controllers (with the same id()
) received within 50ms.
@henryso Sorry, I should have been clearer. I meant a PR for the example using a newer pasts version (as I don't think it would trivial with the current stick version - but, eventually, I'll change the API to make it easier). I'll look into the bug when I can.
Because of the way pasts 0.14.3 works, I had to implement a custom Notify
for my collection of Controller
which returns an extended event with some way of identifying the Controller
along with the Event
. Additionally, I had to add some extra code which removes the Controller
from the collection when Event::Disconnect
is returned or that Controller
will essentially return Event::Disconnect
forever. As this adds a lot of baggage to the code, I don't think it's great for a short-form example.
I am running under Linux, and if I plug in a controller while my program is running,
Listener
returns theController
twice. If the controller is plugged in before the program starts, I only get theController
once. There appears to be nothing in the structure returned that will allow me to de-duplicate theController
instances. Both of them fire the same events, and I only have one such controller plugged in so, both structures represent the same exact device.I am using
stick
0.13.0 withpasts
0.14.3.