So I want to make my program automatically simulate a key press after a timer stops. I have the timer and every setup already I just need to somehow simulate a key press. After a download message pops up on a web browser in the application I just want the program to simulate as "ESC" key press to exit out of the download message popup. How would I simulate the key press?
I would use the SendKeys class, documented here.
To send an 'Esc' keypush, for example, you would write:
SendKeys.Send("{ESC}");
I would use the Windows Input Simulator as it is more reliable than Sendkeys
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With