How to check a USB device

Blitz3D Forums/Blitz3D Programming/How to check a USB device

Stollentroll(Posted 2014) [#1]
Hi everyone,

I have a Griffin AirClick USB device. (http://griffintechnology.com/support/airclick-usb --- It's a radio controlled remote control with five buttons.) I'd like to check the status of this device (if a button is pressed) with Blitz3D.
I don't want to distinguish between the different buttons, I would just need to know if any button at all was pressed.

Alas, I have no clue at all what I have to do to access the device. To make things more difficult the manufacturer has discontinued the service for Win7. But Windows tells me that the device was successfully recognized and installed - thus it should be working.

Any suggestions?

Best regards,

Stollentroll


_PJ_(Posted 2014) [#2]
How Blitz 3D detects the device is ultimately dependent on how Windows considers the device.

I'm assuming this is a controller / Joypad like device such as those used by games consoles in which case, Windows should recognise the device as a "game controller" and therefore Blitaz3D can take inputs through DirectInput - This is done by the use of the various commands that are named suggestively for Joysticks/Joypads such as

JoyButton() JoyX() JoyY() JoyU() etc. functions will be used

In this particular case, to simply see if ANY button has been [pressed, use the GetJoy() command. Alternatively, WaitJoy() will pause the program UNTIL a button is pressed and return that particular Button.


Rroff(Posted 2014) [#3]
From a really quick look it "looks" like it works by inserting a key press into the OS as if you'd pressed multimedia keys on a keyboard - you might be able to pick them up via scancodes 162, 164, 174, 176, 178 or similar maybe.


Axel Wheeler(Posted 2014) [#4]
It isn't really a game controller, although if it appears as such in device manager then you'll have to experiment with all of Blitz3D's joy commands. Try the GetJoy() command and see if anything comes up. Also the JoyType() command used with various port numbers might tell you something. You might want to check JoyHit() and JoyHat() as well.

Rroff's suggestion is good too.

If neither of these solutions work, well, nothing is impossible but it may be much more challenging especially because documentation on it is so sparse. Some Windows dll might have to be accessed directly.