[python-win32] Use python to read data from mouse but not move cursor

Tim Roberts timr at probo.com
Wed Dec 26 18:48:18 CET 2012


wang yong wrote:
>
> I am new to Python. I am trying to use win32api to read out mouse
> movement from an additional mouse attached to my compputer. But, I do
> not want this mouse to move my cursor. So, do you guys have any
> suggestions or codes for this task! Really appreciate it! Thanks for
> the help.

That's not possible.  All HID devices (mice and keyboards) feed into the
system's central input process.  They will all affect the cursor.  Think
about it for a moment -- how would you tell the system which mouse
device you wanted?

Theoretically, you could replace the system's mouse driver with one of
your own using something like libusb, but that's a heck of a lot of
work.  You'd have to understand how USB requests work, and how the USB
Human Interface Device Class works.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list