How I can add additional condition of certain keyboard key, say, Ctrl-key state to WPF MouseLeftButtonDown event-handler?
private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
...
}
How I can add additional condition of certain keyboard key, say, Ctrl-key state to WPF MouseLeftButtonDown event-handler?
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");
}
}