Created
January 4, 2010 23:20
-
-
Save maryrosecook/268961 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.onkeyup = keyCheck; | |
function keyCheck(e) | |
{ | |
var keyId = (window.event) ? event.keyCode : e.keyCode; // get identifier of key pressed | |
switch(keyId) | |
{ | |
// space bar | |
case 32: | |
togglePlayback('song' + currentTrack); | |
break; | |
// left arrow | |
case 37: | |
previousSong(); | |
break; | |
// right arrow | |
case 39: | |
nextSong(); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment