Example: Using jQuery DOM Events to Detect a Konami Code

People who grew up playing a lot of video games in the '80s and '90s will have fond memories of the Konami Code (see http://en.wikipedia.org/wiki/Konami_Code). This cheat code was found in many games written by Konami, and usually gave the player “extra lives” or some other bonus to the game.

Several web sites, such as Facebook and Marvel Comics, have added this code in at various times in their history as April Fools' Day pranks or for other events, enabling some often silly feature until the next page refresh.

Implementing the Konami Code Easter egg using pure JavaScript can be pretty daunting, but with RxJS, it's fairly easy to detect the Konami Code pattern in the event stream using ...

Get Programming Reactive Extensions and LINQ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.