Multiple KeyBinding as Visual Studio in WPF

I tried to read a lot of posts in StackOverflow about how to implement KeyBinding, e.g. Visual Studio Ctrl + Shift + A or Ctrl + K, Ctrl + C , but no luck

I found this blog article about multiple key bindings, but it makes several gestures like Ctrl + A, B

Is it possible to make Keybinding similar (VS Studio) through XAML Syantax.

+4
source share
2 answers

A sequence key combination like VS is not part of WPF and most other user interfaces. The reason is that such combos are welcomed by text editors of the Jurassic era and survive only in a few modern contexts, where users of this era still survive and even flourish .; -)

You should be able to provide your own control mechanisms for this in a fairly simple way:

  • Create a mechanism to analyze and present these combos.
  • Provide key processing logic that recognizes the start of a sequence and enters composite key mode.
  • Provide a link to the user in combined mode
  • Adapt key management in combined mode

Ideally, you will link the combo team so that there is no difference between singles and combos.

+3
source
<KeyBinding x:Name="mykeybinding" Gesture="CTRL+E" Key="P" Command="commandname"/> 

It seems to work fine for me, you need to press ctrl + E + P to execute the command.

Based on http://msdn.microsoft.com/en-in/library/system.windows.input.keybinding.aspx

0
source

All Articles