From 87872f05548a5ce1b31c1cf03e09619e02af5709 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Mon, 1 Oct 2018 22:50:40 +0100 Subject: [PATCH] Feat: add more keyboard shortcuts #58 --- htdocs/js/mympd.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/js/mympd.js b/htdocs/js/mympd.js index d0c4d1e42..40a1a0d8b 100644 --- a/htdocs/js/mympd.js +++ b/htdocs/js/mympd.js @@ -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; }