https://github.com/grunka/konami.js
A small bit of JavaScript that recognizes the Konami code
https://github.com/grunka/konami.js
Last synced: about 1 year ago
JSON representation
A small bit of JavaScript that recognizes the Konami code
- Host: GitHub
- URL: https://github.com/grunka/konami.js
- Owner: grunka
- Created: 2013-02-19T11:55:28.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2016-08-08T11:25:30.000Z (almost 10 years ago)
- Last Synced: 2025-03-16T23:21:45.376Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
konami.js
=========
A small bit of JavaScript that recognizes the [Konami code](http://en.wikipedia.org/wiki/Konami_Code) and triggers an event of your choice.
Usage
=====
Step 1
------
Either load [konami.js](https://raw.github.com/grunka/konami.js/master/konami.js) through a script tag or copy and paste the method in there to some place where you want it.
Step 2
------
Do something like this
```javascript
konami(function () {
alert('ding');
});
```
This will register a listener on all key(up) events, wait for the right sequence and then call the supplied function, in this case show 'ding' in an alert box.