Skip to content

Instantly share code, notes, and snippets.

@mikel
Created April 12, 2011 23:11
Show Gist options
  • Save mikel/916650 to your computer and use it in GitHub Desktop.
Save mikel/916650 to your computer and use it in GitHub Desktop.
// Fires up Asteroids through pressing Ctrl-A
//
var isCtrl = false;
$(document).keyup(function (e) {
if(e.which == 17) isCtrl=false;
}).keydown(function (e) {
if(e.which == 17) isCtrl=true;
if(e.which == 65 && isCtrl == true) {
if($('script#Asteroids').size()==0){
var s = document.createElement('script');s.type='text/javascript';
$(s).attr('id', 'Asteroids');
document.body.appendChild(s);
s.src='http://erkie.github.com/asteroids.min.js';
return false;
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment