8000 GitHub - timotheeg/jsegg: simple key pattern manager to trigger custom events. typically used to set up easter eggs in a js app
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

simple key pattern manager to trigger custom events. typically used to set up easter eggs in a js app

Notifications You must be signed in to change notification settings

timotheeg/jsegg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsegg

jsegg is a small jQuery plugin designed to capture sequences of keys typed. A callback function is called when a full sequence is matched. It is typically use to trigger easter eggs, or keyboard controls.

eggs are attached to dom nodes and therefore capture bubbling events, giving you the ability to have the same keyboard sequence do different things, depending on what's focused when the user types.

Features

  • eggs are attached to DOM nodes, including document
  • multiple eggs can be attached to the same node

Usage

jsegg is used as any jQuery plugin: by being called on a jQuery object. The initialization call requires 2 arguments:

  • the keyboard sequence to capture
  • the callback function to execute on match

the keyboard sequence is defined either as:

Examples

$(document).jsegg('boo', function()
{
    console.log('got ya!')
});

jsegg contains 2 popular easter egg sequences, which can be accessed as such:

$(document).jsegg($.jsegg.KONAMI, function()
{
    console.log('Konami code!')
});
$(document).jsegg($.jsegg.SFII, function()
{
    console.log('SNES Street Fighter II code!')
});

About

simple key pattern manager to trigger custom events. typically used to set up easter eggs in a js app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0