diff options
author | David Banham <david@banham.id.au> | 2014-03-31 22:09:59 +1100 |
---|---|---|
committer | David Banham <david@banham.id.au> | 2014-04-04 21:58:06 +1100 |
commit | 05bfc59bb0824448fbe69f244c795413832c9d01 (patch) | |
tree | 2b15461ec2d523475d3ef49b99a31e3f576eee57 /addons/webinterface.default | |
parent | a8a90e09973b666e51cd84a2d9a35f13365f59ce (diff) |
[webui] Add keyboard controls to web remote
Diffstat (limited to 'addons/webinterface.default')
-rwxr-xr-x | addons/webinterface.default/js/NowPlayingManager.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/webinterface.default/js/NowPlayingManager.js b/addons/webinterface.default/js/NowPlayingManager.js index 1d17c9dc07..18c108f6ff 100755 --- a/addons/webinterface.default/js/NowPlayingManager.js +++ b/addons/webinterface.default/js/NowPlayingManager.js @@ -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: '); |