Wednesday, January 26, 2011

C#.NET Combinational mouse and Keyboard shortcuts

Often it is required to implement combinational keyboard shortcut like shift+left Click or Shift+Right Click but we cannot implement them so easily in provided mouse and keyboard events like (mousedown, click, keydown, keypress or keyup) because in all these events one of the event information either Key events or mouse events are missing. So to implement such shortcut we can use Microsoft.VisualBasic.Device.KeyBoard class.

The same is discussed with example by me at eggheadcafe's FAQ section
http://www.eggheadcafe.com/sample-code/csharp.NET/d5c0ae86-2bd8-4abf-9c88-335779499169/net-keydown-events-like-shiftclick-or-altclick.aspx