libhid on Linux lazarus / 62-General ---------------------------------------------------------------------- MarkMLl · 2019-02-14 10:15 I've written a graphical program for setting up a Logitech G600 mouse which I'll publish as soon as I'm able. It had minimal reliance on USB device parsing etc. so I transcribed some of the libusb/libhid stuff to reduce library dependencies. Looking at the APIs in more detail, it looks as though there's some nasties in data structures etc., particularly on x86_64, which makes it worth using the precompiled library when possible. I know that libusb's done, but does anybody know of a transcription of libhid to Pascal? MarkMLl ---------------------------------------------------------------------- Kays · 2019-02-15 13:56 This forum has a search function. The results don't satisfy you, do they? ---------------------------------------------------------------------- MarkMLl · 2019-02-15 14:38 I wasn't aware of it. The reason I wasn't aware of it was that for the last 15 years or so I've used the Pascal and Lazarus mailing lists rather than the foramina, on the basis that the people who frequented them were in the habit of answering a simple question with a simple "yes" or "no" >:-) Thanks for the URL which I'll follow up presently. In practice it appears to be a fairly simple job for h2pas, but I'm sure that I've got some of the details wrong. MarkMLl ---------------------------------------------------------------------- DonAlfredo · 2019-02-15 14:55 Perhaps this will help you. https://github.com/LongDirtyAnimAlf/FPC-USB-HID ---------------------------------------------------------------------- MarkMLl · 2019-02-15 16:27 Thanks for that as well. I admit to being slightly mortified as to these references now appearing, the only one I'd found before was brief mention by Henry Vermaak in the mailing list dating back to 2010. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2019-02-19 10:04 To wrap this one up: a transcript of the "official" libhidapi using h2pas was pretty simple, also https://github.com/prof7bit/HIDAPI.pas seems to be functionally equivalent. https://github.com/LongDirtyAnimAlf/FPC-USB-HID is basically a JEDI interface and as such is too far removed from the standard interfaces for what I wanted. The libhidapi interface can be implemented on Linux either by talking to the kernel's HID interface or by using libusb. The significance of this distinction is that in the former case the kernel may apply "quirks" to recognised devices that- as a particular example- return a broken descriptor, while in the latter case I believe that quirks aren't applied. I wish I'd appreciated that detail a year ago when a colleague had me waste a vast amount of time investigating why his Elecom trackballs weren't working properly (eventually fixed by a kernel patch).