How I can add an additional condition for a certain keyboard key, to a WPF MouseLeftButtonDown
event-handler?
For example Ctrl + key
private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
...
}
private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
if(Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) {
MessageBox.Show("Control key is down");
} else {
MessageBox.Show("Control key is up");
}
}