Shimmy Weitzhandler
Shimmy Weitzhandler

Reputation: 104741

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.

Upvotes: 3

Views: 1076

Answers (2)

SynerCoder
SynerCoder

Reputation: 12776

From MSDN:

XAML Values

oneOrMoreModifierKeys One or more modifier keys, defined by the ModifierKeys enumeration, delimited with a "+" character.

So my guess is

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

Upvotes: 2

paxdiablo
paxdiablo

Reputation: 881653

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.

Upvotes: 5

Related Questions