|
From: Xiaofan C. <xia...@gm...> - 2010-04-19 23:53:19
|
On Tue, Apr 20, 2010 at 6:26 AM, Xiaofan Chen <xia...@gm...> wrote: > On Tue, Apr 20, 2010 at 6:12 AM, Jason Kotzin <jas...@gm...> wrote: >> Yes, I do receive something that says, attempting to open r/w access, did >> not work, assuming HID keyboard or mouse. >> However, isn't that the same thing that xusb is doing? I see control >> transfer in there that send and receive data. > > I believe you can do control transfer with the HID device, even with the > system keyboard and mouse (but not interrupt transfer), that is > what xusb is doing. I made a mistake here. Yes it can do control transfer, but only for the feature report. > Firstly please update to the latest version by using git. > > To help us (and you), please post the HID report descriptor. And please > post your test program and the debug message. > > When you do the following, the report ID is 0. Is that the case? Is your > keyboard a USB composite device? > libusb_control_transfer(handle, > LIBUSB_ENDPOINT_OUT|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, > HID_SET_REPORT, (HID_REPORT_TYPE_OUTPUT <<8)|0x00, 0 , output_report, 06,1000)); > Ah, that is an output report. So maybe this is not possible. You can use feature report (Control-IN and Control-Out) for the system keyboard/mouse. But for output report, that is problematic. For Input report, you can use Raw Input. http://www.lvr.com/hidfaq.htm 1) Why do I receive "Access denied" when attempting to access my HID? Windows 2000 and later have exclusive read/write access to HIDs that are configured as a system keyboards or mice. An application can obtain a handle to a system keyboard or mouse by not requesting READ or WRITE access with CreateFile. Applications can then use HidD_SetFeature and HidD_GetFeature (if the device supports Feature reports). 2) How can applications receive Input reports from a system mouse or keyboard? The Windows raw input API enables applications to read Input reports when communicating with system mice and keyboards. -- Xiaofan http://mcuee.blogspot.com |