[python-win32] Help on using win32api.SendMessage to send keystrokes

Daniel F nanotube at gmail.com
Tue Apr 5 19:14:07 CEST 2005

> >and
> >how i would hook those keypresses/mouse moves, and how i would inject
> >a keypress/mousemove for an application that is using directinput? Is
> >that even possible?
> No.  In order to do what you ask, you would need to write and install a
> set of kernel filter drivers to inject the events, and you really don't
> want to do that.  The API is not enough.
How about getkeyboardstate/setkeyboardstate functions, put together
with attachthreadinput? would that be on the keyboard driver level,
above directinput? or still below it, and thus bypassed?

If the answer to the above is negative, then how about writing a
wrapper for the original dinput.dll (basically, make another
dinput.dll, that takes messages from the keyboard driver, does
whatever with them, before passing them on to the "actual"
dinput.dll)? could that work? and how difficult would it be to carry

Also... why don't i really want to do the kernel filter drivers? They
certainly sound like i dont want to do them :) but i wonder why. Too
involved and painful? Chance to screw up the whole system?

Daniel, not liking to give up...

More information about the Python-win32 mailing list