Keyboard or mouse fake

I'm trying to figure out how to fake, not simulate, keyboard and mouse input. By this, I mean that the system goes through the process as if the actual event, for example, a mouse click, but actually does not execute the event, for example, clicking the mouse.

Or, if you want the system to think that your mouse has moved, although this has not happened. Sorting of "virtual" movement that does not actually occur / does not affect the mouse.

Is it possible to redefine simulated mouse clicks and events so that they do not actually click while the system thinks they have?

+4
source share
2 answers

Here is a good project that wraps the keyboard and mouse. Below is the link file mouse input simulator for reference. To see the work of a lower level, go to the WindowsInput.Native namespace in this project.

+1
source

Thanks guys for your help. Finally, I was able to achieve what I wanted by answering lrb.

I used this library to fake input and in a grandiose scheme of things that I tried to do with the mouse but didn’t actually execute the user's mouse if the application was running when the user used the mouse. That is why I wanted to "fake" the mouse, rather than move the actual mouse. Thanks again for everything that was awesome.

Icemanind I'm still curious about your idea of ​​subscribing to an event, not an event handler. Would this allow me to trigger something like a mouse click without clicking on it correctly?

0
source

All Articles