diff options
Diffstat (limited to 'web/js/kvm/keyboard.js')
-rw-r--r-- | web/js/kvm/keyboard.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/web/js/kvm/keyboard.js b/web/js/kvm/keyboard.js index ee9a7ba1..8a08a8aa 100644 --- a/web/js/kvm/keyboard.js +++ b/web/js/kvm/keyboard.js @@ -83,7 +83,7 @@ function Keyboard() { if (event.preventDefault) { event.preventDefault(); } - var el_key = document.querySelector("[data-key='" + event.code + "']"); + var el_key = document.querySelector(`[data-key='${event.code}']`); if (el_key && !event.repeat) { __commonHandler(el_key, state, "pressed"); if (__mac_cmd_hook) { @@ -168,7 +168,8 @@ function Keyboard() { }; var __resolveKeys = function(el_key) { - return document.querySelectorAll("[data-key='" + el_key.getAttribute("data-key") + "']"); + var code = el_key.getAttribute("data-key"); + return document.querySelectorAll(`[data-key='${code}']`); }; var __sendKey = function(el_key, state) { |