PORTS Forum

Ports and Interfaces => USB => Topic started by: clement2011 on May 16, 2012, 04:37:09 am

Title: about rawinput
Post by: clement2011 on May 16, 2012, 04:37:09 am
I tried to write a rawinput windows form to show the usb device raw data.
The problem I meet is I can not make sure how to set up the RAWINPUTDEVICE when  calling RegisterRawInputDevices
the codes is as following:
Code: [Select]
RAWINPUTDEVICE[] rp= new RAWINPUTDEVICE[1];
 rp[0].usUsagePage  = 0x01;
 rp[0].usUsage      = 0x06;
 rp[0].dwFlags      = RIDEV_INPUTSINK;
 rp[0].hwndTarget   = hwnd;
RegisterRawInputDevices( rp, (uint)rp.Length, (uint)Marshal.SizeOf( rp[0] ))
The problem is if I i can not make sure the device is mouse or keyboard, how to set up each parameter
of RAWINPUTDEVICE, and can rawinput can get other device except mouse, keyboard and joystick,
Thanks.

Title: Re: about rawinput
Post by: Jan Axelson on May 16, 2012, 11:36:17 am
See:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms645597%28v=vs.85%29.aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/ms645581%28v=vs.85%29.aspx

Jan
Title: Re: about rawinput
Post by: clement2011 on May 16, 2012, 10:49:40 pm
Thanks a lot