1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-01-12 18:30:36 +00:00

Feat: add more keyboard shortcuts #58

This commit is contained in:
jcorporation 2018-10-01 22:50:40 +01:00
parent 2eeddc9786
commit 87872f0554

View File

@ -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
@ -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;
}