I can’t get the Ctrl key state in the KeyUp event handler as the Ctrl key is released.
Do I have to test the keycode of the event argument?
Is there any other way?
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.
Wiring an event to the
KeyUpevent handler will work.The following code will trigger when the Ctrl key is released:
If you want to test if the Ctrl was pressed in combination with another keystroke, for example: Ctrl+F1 then the following code snippet might apply:
Side note: You might have to enable
KeyPreviewon the form in order to catch all controlKeyUpevents in a single location.