triazotan
triazotan

Reputation: 2232

Any other method to simulate user mouse input than WinAPI?

I know there's been some questions around this topic, but the ones I'd like to ask are somewhat more specific:

Does there exist any other method of simulating mouse movement than throwing WinAPI calls all over the place? If yes, is it any good compared to wrapping these calls in my own class?

For the record: by "mouse movement", i mean all the click and repositioning, preferably, but not absolutely necessary, with visible animation of cursor moving between positions.

Upvotes: 3

Views: 760

Answers (2)

Back in DOS programming I had dynamically grabbed the interrupt which you can't do the same way under protected mode but I am pretty sure that DirectInput also has some functions somewhere that would be different than the Win32 way

There are alternative libraries for input handling which I would think the SDL has and possibly GLFW but it may be a stretch to go adding those to a project for mouse handling.

Correction: SDL uses DirectInput on windows. I don't know how much more agreeable you find .NET than win32 but there is one other way too. I was sure I had a bookmark somewhere to a library that would fit perfectly =/ where is it...

.NET way, not bad if you're already using .NET especially: MSDN Reference Page

As far as clicking goes for that solution, just send a message to your main loop or where you are already detecting clicks instead of setting mouse click. Though I'm sure there are other libraries with the function out there.

UPDATE: Check out http://wiki.osdev.org/Mouse_Input for some information on more direct usage and driver writing. This and, as it turns out, use of INT 33h is also possible under windows (and other more dev-friendly OSes) with some effort!

Upvotes: 1

Pedery
Pedery

Reputation: 3636

If you can live with only simulating clicking on the various controls, try manually triggering the controls' Click event, or, for buttons you can use Control.PerformClick().

Upvotes: 0

Related Questions