Creating KeyBinding in WPF with more than one modifier key

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

The way I created KeyBinding was something like:


         


        
5条回答
  •  一生所求
    2020-12-08 18:40

    It might be too late but here is the simplest and shortest solution.

    private void Window_KeyDown(object sender, KeyEventArgs e)
    {
        if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.S)
        {
             // Call your method here
        }
    }
    
    
    

提交回复
热议问题