Page 1 of 1

Direct support for USB HID devices

Posted: Sat Sep 05, 2009 11:21 pm
by laserjones
It would be great if PureBasic offered functions to access USB HID (Human Interface Devices) directly. HID drivers are included with Windows and other operating systems (they are used by mouse and keyboard, for example), but they are non-trivial to use and they are not cross-platform.

So if PureBasic offered a command layer (preferably platform-independent) that made accessing such devices easy, that would really boost the range of possible applications, especially for people who build their own USB devices (which is rather easy with modern microcontrollers such as PIC).

Adding the serial port library to PureBasic was a step in the right direction, but the serial port is being increasingly replaced by USB ...

Re: Direct support for USB HID devices

Posted: Sun Sep 06, 2009 2:06 am
by UserOfPure
Did you mean for webcams and stuff? There's examples here on how to access webcams, so maybe that code will point you in the right direction?

Posted: Sun Sep 06, 2009 4:53 pm
by laserjones
I would be surprised if webcams use the HID class, most of them come with their own drivers, I think (correct me if I'm wrong). HID is a generic USB access method that does not require special device drivers, because everything is included with the operating system. But it is not easy to use the HID DLLs (and, of course, tehy are Windows only), so it would be great if PureBasic could encapsulate HID access in a set of easy-to-use commands.

For me it is mainly interesting to use HID for self-built devices based on PIC microcontrollers. I found a way to access them using a third-party library (mcHID.dll), but this is not an elegant solution, and not platform-independent.

Re: Direct support for USB HID devices

Posted: Thu Aug 25, 2011 7:41 pm
by DoubleDutch
I agree, support for USB HID would be good.

Re: Direct support for USB HID devices

Posted: Thu Aug 25, 2011 9:25 pm
by dhouston

Re: Direct support for USB HID devices

Posted: Thu Aug 25, 2011 9:41 pm
by xorc1zt
On Windows you can use DirectInput from DirectX or RawInput from Windows APIs.

raw http://msdn.microsoft.com/en-us/library ... 85%29.aspx
direct http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Re: Direct support for USB HID devices

Posted: Wed Oct 05, 2011 5:39 pm
by User_Russian
I agree, support for USB HID would be good.
There is a library, PureBasic for Windows
http://www.purebasic.fr/english/viewtop ... 14&t=41729

Re: Direct support for USB HID devices

Posted: Tue Nov 06, 2012 4:45 pm
by Golfy
I've just found this post, so I'll deleted my last request about USB description... :)
It would be smart to have Unix/Windows/Mac same function's ;)

And as I can see, this post has been viewed a lot of time :wink:

Re: Direct support for USB HID devices

Posted: Sat Nov 24, 2018 4:06 pm
by Golfy
Is this request completed ? no way to know where it is ? it's 6 years ago...

Re: Direct support for USB HID devices

Posted: Sat Nov 24, 2018 10:10 pm
by RSBasic
If a wish is too old, then Fred doesn't look in because it is time consuming to check very old threads.
It makes more sense to recreate the wish later after many years.

+1 for USB HID devices support.

Re: Direct support for USB HID devices

Posted: Sat Nov 24, 2018 11:01 pm
by User_Russian
There is a cross-platform library HIDAPI. https://github.com/signal11/hidapi
Perhaps it can be used with PB.

Re: Direct support for USB HID devices

Posted: Thu Dec 06, 2018 2:58 am
by Lunasole
+1, that might be actual addition to PB in a "hardware" direction. All those widely-popular webcameras, gamepads or becoming popular fingerprint scanners, other scanners, etc, or even stuff like robots/drones, looks nice to access them directly out-of-the-box.