From 11b11a855dec5f20f6a79ba226f007b27aa8475b Mon Sep 17 00:00:00 2001 From: jcass Date: Fri, 9 Jan 2015 13:01:29 +0200 Subject: [PATCH] Translate unicode keys to actual characters to ensure better handling of shortcut keys. --- mopidy_musicbox_webclient/static/js/gui.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mopidy_musicbox_webclient/static/js/gui.js b/mopidy_musicbox_webclient/static/js/gui.js index d4dcef7..2ef16c1 100644 --- a/mopidy_musicbox_webclient/static/js/gui.js +++ b/mopidy_musicbox_webclient/static/js/gui.js @@ -509,8 +509,10 @@ $(document).ready(function(event) { $(document).keypress( function (event) { //console.log('kp: '+event); if (event.target.tagName != 'INPUT') { - switch(event.which) { - case 32: + var unicode=event.keyCode? event.keyCode : event.charCode; + var actualkey=String.fromCharCode(unicode); + switch(actualkey) { + case ' ': doPlay(); event.preventDefault(); break;