views:

83

answers:

3

A friend of mine has difficulties in using both hands in the keyboard. He always use his left hand only. He asked me to write a C# program to send key combinations to the system so that it override the default shortcut keys.

For example he wants to replace LWin + D with Ctrl + L so that when he presses Ctrl + L it'll show his desktop.

How can I do this?

A: 

Have you considered a custom hardware solution instead? You may be able to find a keyboard and driver that are more suitable to his abilities.

No Refunds No Returns
+1  A: 

You can use the RegisterHotKey API function.

See here for instructions on using it with C#.

Alon
A: 

I know it doesn't answer the question specifically for C#, but using AutoHotKey would actually be easier for this. Plus it allows for simpler customization since it can be just a script if it's installed on his machine. Otherwise it can be compiled and taken to other machines.

So the line would be like the following:

^l::SendInput #d
Agent_9191