Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emulate keyboard

How can I emulate keyboard in application running in background (hidden in tray). I want to press, hold, and relase keys on keyboard programatically. Also, I would like to move mouse around and be able to click.

like image 878
Jacek Koralik Avatar asked Jun 17 '11 09:06

Jacek Koralik


People also ask

What is keyboard emulation?

Keyboard Emulation. A keyboard emulator, also known as a virtual keyboard, is a software component that allows users to enter characters onto a computer display through other devices, such as touch screens or mice.


2 Answers

You can use SendInput API function

like image 148
Rajeev Avatar answered Oct 12 '22 12:10

Rajeev


You can also try the Windows.Forms.SendKeys API

Here is a How-To: How to: Simulate Mouse and Keyboard Events in Code

like image 44
ChrisG Avatar answered Oct 12 '22 13:10

ChrisG