(* This is a USB (and in particular HID) exerciser derived from this author's *)
(* lg600 program which has- or at least should have- the sole functionality of *)
(* setting up a Logitech G600 gamer's mouse. While the lg600 program put a *)
(* lot of effort into parsing information in the /sys tree it made very few *)
(* demands on the USB APIs and as such had no dependency on the development *)
(* versions of libusb or libhid, however once one starts looking at more *)
(* general functionality one gets very much bogged down in alignment and *)
(* anomalous structure size issues (specifically, at the binary API between *)
(* libhid and the kernel) with the result that using precompiled system *)
(* libraries is pretty much unavoidable. MarkMLl, 2019-01-11 *)
(* NOTE: a lot of the structure of this program is derived from LG600, where it *)
(* probably made more sense. Sorry. *)
(* ASSUME THIS IS PERMANENTLY BROKEN, IT'S HERE ENTIRELY TO PREVENT ME FROM *)
(* TRYING TO TACK MORE AND MORE INAPPROPRIATE FUNCTIONALITY INTO THE LG600 *)
(* MOUSE PROGRAM. *)
...
(* Minimal testing of the above has been applied, and in practical terms even *)
(* during initial development I'm pretty sure that much of what I've done here *)
(* needs to be ripped out and replaced. One of the problems is that libhid *)
(* exists in two forms (one using the kernel's HID support, the other using *)
(* libusb) and both implementations are useful, and I suspect that the only way *)
(* to sort out the naming conflicts will be to rely on dynamic linkage of the *)
(* appropriate .so files: see what I did for the K8055 test program. *)
(* Discussion in the forum directed me to https://github.com/prof7bit/HIDAPI.pas *)
(* which is an interface to hidapi-libusb, but by then I'd just about done my *)
(* own transcript. Also https://github.com/LongDirtyAnimAlf/FPC-USB-HID but *)
(* this is a JEDI interface and as such is not what I was looking for. *)