Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 106163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:33:12+00:00 2026-05-11T01:33:12+00:00

I am looking to have a C# application implement the Konami Code to display

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:33:13+00:00Added an answer on May 11, 2026 at 1:33 am

    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.

    using System; using System.Collections.Generic; using System.Windows.Forms;  namespace WindowsFormsApplication3 {     public class KonamiSequence {          List<Keys> Keys = new List<Keys>{System.Windows.Forms.Keys.Up, System.Windows.Forms.Keys.Up,                                         System.Windows.Forms.Keys.Down, System.Windows.Forms.Keys.Down,                                         System.Windows.Forms.Keys.Left, System.Windows.Forms.Keys.Right,                                         System.Windows.Forms.Keys.Left, System.Windows.Forms.Keys.Right,                                         System.Windows.Forms.Keys.B, System.Windows.Forms.Keys.A};         private int mPosition = -1;          public int Position {             get { return mPosition; }             private set { mPosition = value; }         }          public bool IsCompletedBy(Keys key) {              if (Keys[Position + 1] == key) {                 // move to next                 Position++;             }             else if (Position == 1 && key == System.Windows.Forms.Keys.Up) {                 // stay where we are             }             else if (Keys[0] == key) {                 // restart at 1st                 Position = 0;             }             else {                 // no match in sequence                 Position = -1;             }              if (Position == Keys.Count - 1) {                 Position = -1;                 return true;             }              return false;         }     } } 

    To use it, you would need something in your Form’s code responding to key up events. Something like this should do it:

        private KonamiSequence sequence = new KonamiSequence();      private void Form1_KeyUp(object sender, KeyEventArgs e) {         if (sequence.IsCompletedBy(e.KeyCode)) {             MessageBox.Show('KONAMI!!!');         }     } 

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 70k
  • Answers 70k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Paging with ASP.NET MVC Demo (source: taiga.nl) May 11, 2026 at 12:54 pm
  • added an answer That seems not possible in my situation, since the function… May 11, 2026 at 12:54 pm
  • added an answer Try something like SELECT id, SUM(CASE WHEN votedate >= $yesterday… May 11, 2026 at 12:54 pm

Related Questions

I am looking to distribute an open source iPhone app and I have a
I am looking for good ideas for implementing a generic way to have a
I am looking in to ways to enable a site to basically have something
I am looking for a way to have some control over the shape of
I am looking into building an authentication in my ASP.NET application with the following
Due to company constraints out of my control, I have the following scenario: A
I am working on a software development project that uses code written primarily in
In my VC++ application I have an embedded browser (MSHTML). It works fine and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.