Multiple keys with WPF KeyDown event
问题 I'm working with WPF KeyDown event (KeyEventArgs from Windows.Input). I need to recognize when user pressed F1 alone and Ctrl+F1. private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key==Key.F1 && Keyboard.IsKeyDown(Key.LeftCtrl)) { MessageBox.Show("ctrlF1"); } if (e.Key == Key.F1 && !Keyboard.IsKeyDown(Key.LeftCtrl)) { MessageBox.Show("F1"); } } My problem is that when I press Ctrl+F1 plain F1 messagebox would fire too. I tried to add e.Handled to Ctrl+F1 case, but it doesn't