Sign in to follow this  
Followers 0
Adam1213

HID - USB Communication

7 posts in this topic

I am trying to use Autoit for usb communication with a HID (human interface device).

I have found an USB library which should be able to do the communication (the sample app provided worked). I am currently trying to use the dll that they provide to interface with ta device however I am still trying to work out how to make it work.

Share this post


Link to post
Share on other sites



I am trying to use Autoit for usb communication with a HID (human interface device).

I have found an USB library which should be able to do the communication (the sample app provided worked). I am currently trying to use the dll that they provide to interface with ta device however I am still trying to work out how to make it work.

Some lines of YOUR code should help the experts here to help you [hint]

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

I am still trying to open the usb port properly - currently I am getting an error that the function does not exist within the dll (despite it being documented as being a function within that dll...)...

;http://www.autoitscript.com/forum/index.php?showtopic=83147&hl=usb
;http://www.codeproject.com/KB/cs/USB_HID.aspx?fid=398968&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2706675

;http://www.alanmacek.com/usb/
$dll = DllOpen('UsbLibrary.dll') ; if autoit crashes the dll was not found  - file  available from http://www.codeproject.com/KB/cs/USB_HID.aspx

const $VENDOR_ID=0483
const $PRODUCT_ID=1311

;$struct_devinfo = DllStructCreate('int VendorId;int ProductId')

$result=DllCall ($dll, 'str', ' HIDDevice', 'int', $VENDOR_ID, 'int', '')
msgbox(0,'',$result&@CRLF&'error: '&@ERROR)
;$result=DllCall ($dll, 'str', 'set_VendorId', 'int', $VENDOR_ID)

#cs
static HIDDevice FindDevice(
   int nVid, 
   int nPid, 
   Type oType
)
#ce

DllClose($dll)

Some lines of YOUR code should help the experts here to help you [hint]

Regards, Rudi.

Share this post


Link to post
Share on other sites

Please help because I need this to write a script so I can tell when the Rock Band 2 controller buttons are pressed...

So what do you need help with? Is the "Rock Band 2 controller" recognised as a keyboard or game device?

Share this post


Link to post
Share on other sites

So what do you need help with? Is the "Rock Band 2 controller" recognised as a keyboard or game device?

Game controller. I basically need to be able to read the input from a HID.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Game controller. I basically need to be able to read the input from a HID.

Well since it is a game device I see 2 options:

  • Use the joystick funcs from my SDL udf. It could be a little flaky since only polling is available right now, I haven't got events working yet.
  • Or maybe you could make something out of THIS thread where Authenticity gets input from a HID device (I believe it was a remote acting as a keyboard)
Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0