1
Answer

Temporarily Suspend/Stop Keyboard Inputs

Ask a question
Oky Sabeni

Oky Sabeni

14y
3.2k
1
Hi,

My program takes a key input to switch between states:
Ex:

         private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            switch (e.Key)
            {
                case System.Windows.Input.Key.PageUp:
                    MoveBackward();
                    break;
                case System.Windows.Input.Key.Next :
					// MessageBox.Show(currentState.ToString());
                    MoveForward();
                    break;
                case System.Windows.Input.Key.Escape :
                    Application.Current.Shutdown();
                    break;
                default :
                    break;
            }
        }
 
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)