| 
      
      
      From: Stephan M. <ste...@we...> - 2006-06-16 08:06:01
      
     | 
| > I'm trying to use libusb to retrieve mouse input, and I've noticed that = when=20 > using a loop containing usb=5Finterrupt=5Fread in the form of a separate thr= ead,=20 > WM=5FTIMER, or brute force iterations, that the loop runs at 40Hz (40 mous= e=20 > inputs per second). The only exception is when I use the asynchronous re= ad=20 > API calls and use about 8 contexts, then getting a rate of about 90-110=20 > inputs per second. I noticed by using that hack of a method that the OS=20 > cursor was getting erratic, which suggests the OS is still fighting over= the=20 > inputs for the device. >=20 > The questions I have are... > 1. What's causing this 40Hz frequency instead of the expected 125Hz=3F That's because two driver are simultaniously reading from the mouse, Windows' hid driver and libusb's (filter) driver. > 2. Is it possible to get libusb-win32 to have exclusive access over the=20 > device=3F Yes that's possible by installing libusb as a device driver for the mouse instead of using the filter. Please note that after installing the device driver your mouse won't work as a 'normal' mouse any more because Windows will be unable to read from it. So I would recommend connecting a second mouse to the system if you don't want to control Windows using the keyboard. To install the device driver follow these steps: 1. uninstall the filter driver 2. get the libusb-win32-device-bin-xxxx.tar.gz package 3. launch the inf-wizard.exe tool (from the /bin folder) and create an=20 .inf file for your mouse 4. go to the c:\windows\inf folder and open input.inf with Notepad 5. add some meaningless comments to the top of the file and save it These modifications will break the hid driver's digital signature. This is necessary to install libusb's kernel driver because it's 'unsigned'. 6. open the Device Manager, locate your mouse, and update its driver by pointing Windows to the .inf file you created in step 3. 7. unplug und replug the mouse 8. go to the Device Manager and verify that the mouse shows up under the 'Libusb-win32 Devices' section Hope this helps, Stephan >=20 >=20 >=20 >=20 > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F > Libusb-win32-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= Erweitern Sie FreeMail zu einem noch leistungsst=E4rkeren E-Mail-Postfach! =09 Mehr Infos unter http://freemail.web.de/home/landingpad/=3Fmc=3D021131 |