read data from usb hid

Hi guys, We got a ptz control USB keyboard set of 3 pieces.
The problem is: the main pad works as intended, but the rest 2 pads are not working. It sends data, there is connection.
I need to connect to this USB device and send key combinations to a 3rd party software.

I tried the mbs plugins, it shows up as:
pid: 1131
vid: 7C0
name: AXIS T8311

pid: 1280
vid: 7C0
name: AXIS T8313

but i cannot connect to the device, i tried the mbs plugins, it says error 3 (access denied)
tried the hidapi example too, it quits with nil exception error

tldr: connect to usb device, get data, send key combinations to 3rd party software

nil exception error occurs cuz the memoryblock has an incorret size i guess, do i need to know it to read all the data from the device?

Hi Roland,

Although I have done some Xojo HID connection tests in the past I am not an expert. However, what you want to achieve seems strange to me. Do you want to send data to a keyboard device? Why would a keyboard accept data/be prepared to handle received data?


Hi, i want to recieve data from a device (Axis T8310) which cannot communicate with the ptz camera system. After i recieve the data ( device buttons pressed) i want to send keystrokes to a 3rd party program (ptz camera system).
But first of all i want to read raw data from the device.

if some other driver uses the device, you may not be able to access it at the same time.

and please use newer APIs for HID access:

its a plug and pray device, no drivers
That is the mbs plugin im trying to use.
I know the vendor ids (&h7C0) and product id-s (4 different). But when i open the usb device with mbs plugin, it says nil.

How is the device recognized by Windows? Is it seen as a game input device?

its a set, one of them is a game controller, i can calibrate it, the others are at the bottom generic hid devices, not calibratable.
The first (joy) is useable in a third party ptz camera system, but the last 2 are not useable.
I need to read all the data that coming from theese devices.
But a the moment i can’t even make a connection between the xojo app and the devices.

As what kind of device does Windows recognize it? As a game input device?

game input device and 2 generic hid devices

I can read the device informations with :

dim c as HIDAPIDeviceinfoMBS=HIDAPIDeviceMBS.Enumerate(&h07c0, &h1131) print "M info:" + c.ManufacturerString etc
But i can’t read theese informations with the following code:

dim d as HIDAPIDeviceMBS =, &h1131, "") print "M info" + d.ManufacturerString

The device is opened, but theese string are empty.

is there an example how to use the gameinputmanager?

i see the buttons of the device, but it does not respond when i press it’s buttons.

edit: i got it work with joystick and a circle gamepad, but the main keyboard (hub) is not working. Any idea?

I found the example in the xojo/example/games/ folder. I checked my keypad in it, it appears in the list twice, one set is full 0, the other is full 1. Does not respond on key press.

I got it work on OSX using gameinput examples, but after testing it on Win 7 64bit, Win 10 64bit, I got this message: “xy device not available”.