mirror of
https://github.com/SuperBFG7/ympd
synced 2025-08-08 15:05:30 +00:00
Feat: add more keyboard shortcuts #58
This commit is contained in:
parent
2eeddc9786
commit
87872f0554
@ -567,7 +567,7 @@ function appInit() {
|
|||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
document.addEventListener('keydown', function(event) {
|
document.addEventListener('keydown', function(event) {
|
||||||
if (event.target.tagName == 'INPUT')
|
if (event.target.tagName == 'INPUT' || event.target.tagName == 'SELECT')
|
||||||
return;
|
return;
|
||||||
switch (event.which) {
|
switch (event.which) {
|
||||||
case 37: //left
|
case 37: //left
|
||||||
@ -579,6 +579,21 @@ function appInit() {
|
|||||||
case 32: //space
|
case 32: //space
|
||||||
clickPlay();
|
clickPlay();
|
||||||
break;
|
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:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user