Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check from a program in background if key or combination was pressed?

Tags:

c#

winforms

I have an app which will type text on mouse point; even if that means switching window focus to some other program, such as notepad.

I'm trying to be able to press some key combination to start/stop typing.

How should I do this?

like image 650
HelpNeeder Avatar asked Jan 06 '12 19:01

HelpNeeder


1 Answers

you must use Keyboard hooks, you can find many examples by googling it.

here is an example from codeproject.com:

keyboardhook.aspx

like image 167
Ashkan Mobayen Khiabani Avatar answered Oct 19 '22 02:10

Ashkan Mobayen Khiabani