Generic Mouse Click Event/Key Press

  • Thread starter Thread starter Kevin Z Grey
  • Start date Start date
K

Kevin Z Grey

Heya,

I have the need to send a Mouse Click programatically
based on the coordinates and a Key Press to whatever
control currently has the focus. I need it to be
completely passive, in that it does not call OnClick with
the specific control, but rather simulates a user tapping
or entering text.

Is it possible to do this from C#?

Thanks in Advance.

~~K
 
You want to send a click event at the current mouse position? So this is on
a device that has a mouse? Maybe you could give us some more details on
what you really want to do; then we may have a suggestion as to how to do it
(maybe this is not the right way).

You can send mouse events with mouse_event() (you'd have to P/Invoke it).

Paul T.
 
I'm basically attempting to automate some of my testing
and what I need to do is generate a click event at certain
coordinates and let the OS/App determine which control
will eventually receive it.

It would essentially let me create a "macro" in the old
school sense where you could record actions, then play
them back later.

Thanks for the help.

~~K
 
You can try mouse_event().

Paul T.

Kevin Z Grey said:
I'm basically attempting to automate some of my testing
and what I need to do is generate a click event at certain
coordinates and let the OS/App determine which control
will eventually receive it.

It would essentially let me create a "macro" in the old
school sense where you could record actions, then play
them back later.

Thanks for the help.

~~K
 
Back
Top