I have the following code:
public void tbSpeed_KeyDown(object sender, KeyRoutedEventArgs e)
{
e.Handled = !((e.Key >= 48 && e.Key <= 57) || (e.Key >= 96 && e.Key <= 105) || (e.Key == 109) || (e.Key == 189));
}
Is there any way to detect if any modifier key like shift is being pressed ?
HasFlag
method -CoreWindow.GetForCurrentThread().GetKeyState(VirtualKey.Shift).HasFlag( CoreVirtualKeyStates.Down )
- because this way you avoid the situation where the key is only locked but not actually pressed. – Housewifely