|
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 |
|
From: Stephan M. <ste...@we...> - 2006-06-17 16:25:35
Attachments:
cuecat.iss
|
> There aren't any alternatives to using a specific device driver? There are alternatives, but none of them is easier than installing a custom device driver. > Unfortunately that approach just isn't user friendly enough for my needs. You could automate the installation process by writing an installer. I did the same some months ago by writing an installer for the CueCat device (http://en.wikipedia.org/wiki/Cuecat) which is some kind of HID keyboard. I attached the installer script I wrote. It's pretty simple and easy to modify. Stephan > > > > > _______________________________________________ > Libusb-win32-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 |
|
From: Bob S. <m24...@ho...> - 2006-06-18 11:46:03
|
That method is still going to be problematic. The idea I had for libusb-win32 was to use it as an alternative input method for a Quake engine port. The reason is that GDI input, Windows XP rawinput, and DirectInput have a few issues: - Windows XP rawinput only works with Windows XP, and 2000 is a target platform. - DirectInput will enumerate more than 1 mouse only under Windows 98SE or ME. - GDI input can't register separate mouse inputs. - Some gaming mice report extra information not properly handled. - Different model mice only report certain buttons to different API. (As in some only report all buttons to DirectInput, some only report to GDI, some only to rawinput) Thus libusb-win32 looked like a possible alternative. Unfortunately, considering the drop-in nature of the engine itself, the user base probably wouldn't be too comfortable with installing specific device drivers. |
|
From: Bob S. <m24...@ho...> - 2006-06-16 16:58:55
|
There aren't any alternatives to using a specific device driver? Unfortunately that approach just isn't user friendly enough for my needs. |