Skip to content

Commit

Permalink
Feat: add more keyboard shortcuts #58
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Oct 1, 2018
1 parent 2eeddc9 commit 87872f0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion htdocs/js/mympd.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ function appInit() {
}, false);

document.addEventListener('keydown', function(event) {
if (event.target.tagName == 'INPUT')
if (event.target.tagName == 'INPUT' || event.target.tagName == 'SELECT')
return;
switch (event.which) {
case 37: //left
Expand All @@ -579,6 +579,21 @@ function appInit() {
case 32: //space
clickPlay();
break;
case 83: //s
clickStop();
break;
case 173: //-
chVolume(-5);
break;
case 171: //+
chVolume(5);
break;
case 67: //C c
if (event.shiftKey)
sendAPI({"cmd": "MPD_API_QUEUE_CROP"});
else
sendAPI({"cmd": "MPD_API_QUEUE_CLEAR"});
break;
default:
return;
}
Expand Down

0 comments on commit 87872f0

Please sign in to comment.