I am looking to have a C# application implement the Konami Code to display an Easter Egg. http://en.wikipedia.org/wiki/Konami_Code
What is the best way to do this?
This is in a standard C# windows forms app.
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.
In windows forms I would have a class that knows what the sequence is and holds the state of where you are in the sequence. Something like this should do it.
To use it, you would need something in your Form’s code responding to key up events. Something like this should do it:
Hopefully that’s enough to give you what you need. For WPF you will need slight differences is very similar (see edit history #1).
EDIT: updated for winforms instead of wpf.