I would like to have my console app that runs for a while to give some options to the user at the end if at anytime during the process the user pressed the shift key. Is this possible?
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.
I changed the infinite loop to one that looks for a flag that is set after my process finishes. I also changed how the Shift key was being looked for because it didn’t look like Console.ReadKey() was doing anything for Shift. I’ll still give Ron credit though for bringing up threading. This code tested out ok: