Skip to content

Commit

Permalink
[webui] Add keyboard controls to web remote
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbanham committed Apr 4, 2014
1 parent a8a90e0 commit 05bfc59
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions addons/webinterface.default/js/NowPlayingManager.js
Expand Up @@ -141,6 +141,27 @@ NowPlayingManager.prototype = {
$('#pbStop').bind('click', jQuery.proxy(this.stopTrack, this));
$('#pbPlay').bind('click', jQuery.proxy(this.playPauseTrack, this));
$('#pbPause').bind('click', jQuery.proxy(this.playPauseTrack, this));
that = this
$(document).keypress(function(event) {
switch (event.which) {
case 32: //spacebar
event.preventDefault()
jQuery.proxy(that.playPauseTrack, that)();
break;
case 120: //x key
event.preventDefault()
jQuery.proxy(that.stopTrack, that)();
break;
case 44: //period key
event.preventDefault()
jQuery.proxy(that.nextTrack, that)();
break;
case 46: //comma key
event.preventDefault()
jQuery.proxy(that.prevTrack, that)();
break;
}
});
},
showPlaylist: function() {
$('#nextText').html('Playlist: ');
Expand Down

0 comments on commit 05bfc59

Please sign in to comment.