Possible Duplicate:
How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5?
I'd like to have multiple global hotkeys in my new app (to control the app from anywhere in windows), and all of the given sources/solutions I found on the web seem to provide with a sort of a limping solution (either solutions only for one g.hotkey, or solutions that while running create annoying mouse delays on the screen).
Does anyone here know of a resource that can help me achive this, that I can learn from? Anything?
Thanks ! :)
The nicest solution I've found is http://bloggablea.wordpress.com/2007/05/01/global-hotkeys-with-net/
Hotkey hk = new Hotkey();
hk.KeyCode = Keys.1;
hk.Windows = true;
hk.Pressed += delegate { Console.WriteLine("Windows+1 pressed!"); };
hk.Register(myForm);
Note how you can set different lambdas to different hotkeys
http://www.codeproject.com/KB/cs/CSLLKeyboardHook.aspx
If you're not using .net 3.5.
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