I’m planning to save keyboard shortcut in database. When User pressed the shortcut key, specific window should open.
A function same like Visual Studio Keyboard shortcut assign window,

Here which key combination should I store in database?
I’m listening to following method to hook the key press
protected override void OnKeyUp(KeyEventArgs e)
{
// Here I'm gonna hook the keypress
}
If the user pressed, CTRL + W ( any Key combination with Control Key )
e.KeyboardDevice.Modifiers is Control and e.Key is W
If user pressed, ALT + W ( Any key combination with Alter Key )
e.KeyboardDevice.Modifiers is Alt and e.Key is System and e.SystemKey is W
If user pressed, CTRL + Shift + W its giving key combonation in two sequent OnKeyUp events
There is no common pattern.
Which combination I should Hook ? Which combination I should store in database ?
Look at the KeyGesture class. You can save and parse gestures from strings and also easily compare them in your
OnKeyUpmethod like this: