When our WPF application starts, it uses Single Sign On to log in. To allow testers to simulate other users, we’d like to detect the Control button being held down on startup, and pop up a login dialog.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is what I use in a WPF app to check if the control key is being held down in the constructor of the main Window. It uses System.Windows.Input.Keyboard
EDIT – corrected bug pointed out by Coincoin