public void OnKeyPressed() //This gets called whenever a key gets pressed in the MainWindow, checks if the key that is pressed is a command key. { RestartThread(); if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt || (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) // Is Alt key pressed { foreach (Key k in getPressedKeys()) { Console.Write(k + " - "); } Console.WriteLine("____________________________________"); firstKeyChain.Handle(getPressedKeys()); } else { target.SetNewState(); } }