1

I want do define more advanced keyboard shortcuts like Ctrl+^, Ctrl+M. I have seen them in Visual Studio 2015 and thought, they would be great for my own applications, but I couldn't find a way to define such keyboard shortcuts in WPF and C#. I only know how to define "normal" shortcuts like Ctrl+S:

InputGestures.Add( new KeyGesture( Key.S , ModifierKeys.Control ));

How can I create more advanced shortcuts like in Visual studio?

  • Possible duplicate of [multi key gesture in wpf](http://stackoverflow.com/questions/2181991/multi-key-gesture-in-wpf) – mihai Jul 22 '16 at 12:45
  • Please take a look at this: http://stackoverflow.com/questions/2181991/multi-key-gesture-in-wpf and that: http://stackoverflow.com/questions/28483141/multiples-keys-in-keybinding . It should answer your needs :) – mihai Jul 22 '16 at 12:46
  • I will try the code later and tell you if it worked – Alexander Holzinger Jul 22 '16 at 13:19
  • Depending on what you need, you may not have to do complex gestures like that. If one gesture does a certain event, like opening a menu item or another window, then you can just handle the gesture from the newly focused control. – Meloviz Jul 22 '16 at 13:47

1 Answers1

-1

To create complicated shortcuts you should add some logic to your application. Like handle "Ctrl+^" and then wait for "Ctrl+M".

I know nothing about some existing feature that would allow you to implement complicated shortcut sequences in one line of code.