Creating KeyBinding in WPF with more than one modifier key

前端 未结 5 1453
南旧
南旧 2020-12-08 17:51

The way I created KeyBinding was something like:


         


        
5条回答
  •  孤城傲影
    2020-12-08 18:38

    I know the question is for XAML, but here's a sample if you want to do it in code (multiple ModifierKeys can be specified via logical OR):

    new KeyBinding( SaveCommand, Key.S, ModifierKeys.Control | ModifierKeys.Shift )
    

提交回复
热议问题