Search code examples
.netwpfkey-bindings

Is there a xamly way to set multiple Modifiers for a KeyBinding?


I tried:

<KeyBinding Key="S" Modifiers="Control, Shift"/>

And

<KeyBinding Key="S" Modifiers="Control|Shift"/>

But it doesn't work.


Solution

  • You can use:

    <KeyBinding Modifiers="Ctrl+Shift" Key="S" Command="{Whatever}" />
    

    A gesture should also work:

    <KeyBinding Gesture="Ctrl+Shift+S" Command="{Whatever}" />
    

    See here for more details.