I have created a windows service in c#. How can I call a function whenever a key is pressed, and in this function get the value of the key. I need it for both key up and key down.
My goal is to send an email if a certain series of keys were pressed. For example if you press h-e-l-l-o, no matter where you type it even on the desktop, the program should send the email.
Also, it's ok for me to implement it in another way. I need a program that runs in the background and do something when a key is pressed.
How can I do such thing? An example would be helpful.