Oky Sabeni

Oky Sabeni

  • NA
  • 1
  • 5.7k

Temporarily Suspend/Stop Keyboard Inputs

Jul 28 2010 4:08 PM
Hi,
My program takes a key input to switch between states:
Ex: 
  1. private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)  
  2. {  
  3.     switch (e.Key)  
  4.     {  
  5.         case System.Windows.Input.Key.PageUp:  
  6.             MoveBackward();  
  7.             break;  
  8.         case System.Windows.Input.Key.Next:  
  9.             // MessageBox.Show(currentState.ToString());  
  10.             MoveForward();  
  11.             break;  
  12.         case System.Windows.Input.Key.Escape:  
  13.             Application.Current.Shutdown();  
  14.             break;  
  15.         default:  
  16.             break;  
  17.     }  
  18. }  
  
But, there are times when I'm playing a file in which I would like to temporarily suspend any input mouse/keyboard. Does anyone have any idea on how to accomplish that?
Thanks

Answers (1)