Closed kepi closed 1 year ago
Thanks for pointing that out. You are correct that the method I was using opened the first usb device it found. I thought this won't be a problem because I assumed that Huion devices wouldn't share product IDs. I couldn't test that assumption because I use an XP-Pen tablet but by the looks of it, your patch should fix it. I'll test it and I will try to push the update tomorrow
Hello,
first of all, huge thanks for this project. I was afraid I'll be without keypad, but you stepped in into Huion incompetency and fixed their mess :)
Anyway, I'm probably lucky and my system is always special. No easy ways for me. Looks like I'm not able to have it working, because I don't have single
256c:006d
USB device, but two. One for tablet, one for KD100 (at least that is my understanding). And KD100 is unfortunately second, not first.I wrote you many paragraphs of excuses about why I'm not able to submit PR because I didn't write any C in about 10 years etc... But when trying to research correct approach and give you some references, I ended up trying it and... voilá, "PR" is here.
Please take it more like proof of concept or working example. I didn't even try to get grasp of your coding style, sort definitions or something like that, I just get examples from documentation, sone SO and glued it together. Feel free to just take an idea and fix it in whatever way you find best, no harmed feelings.
As for the fix itself: From what little I understand,
libusb_open_device_with_vid_pid
opens first vendorId:productId pair, no matter if it is one you need. Looks like we have to use more chatty way:Btw. this fix takes totally naive approach, which just assumes that KD100 is device without product description. Which is true in my case, but I'm really not sure if it is universal truth.
Anyway, just finished first drawing with this approach and it is working :)