diff options
author | Devaev Maxim <[email protected]> | 2018-08-01 17:31:23 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-08-01 17:31:23 +0300 |
commit | 9a5c583f808f7167a5a630d675c195a4a7ded2aa (patch) | |
tree | 904f4250943e04aa0f8864ccb7785c9618ece058 /kvmd/web/js/hid.js | |
parent | cb8e5efbc74343a932a712444c5d7f017094cbe2 (diff) |
mouse support
Diffstat (limited to 'kvmd/web/js/hid.js')
-rw-r--r-- | kvmd/web/js/hid.js | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/kvmd/web/js/hid.js b/kvmd/web/js/hid.js index a8a5d653..cb6c37bf 100644 --- a/kvmd/web/js/hid.js +++ b/kvmd/web/js/hid.js @@ -1,10 +1,4 @@ var hid = new function() { - var __install_timer = null; - var __installed = false; - - var __hidden_attr = null; - var __visibility_change_attr = null; - this.init = function() { keyboard.init(); mouse.init(); @@ -32,32 +26,12 @@ var hid = new function() { }; this.installCapture = function(ws) { - var http = tools.makeRequest("GET", "/kvmd/hid", function() { - if (http.readyState === 4) { - if (http.status === 200) { - features = JSON.parse(http.responseText).result.features; - if (features.mouse) { - mouse.setSocket(ws); - } - keyboard.setSocket(ws); - __installed = true; - } else { - tools.error("Can't resolve HID features:", http.responseText); - __install_timer = setTimeout(() => hid.installCapture(ws), 1000); - } - } - }); + keyboard.setSocket(ws); + mouse.setSocket(ws); }; this.clearCapture = function() { - if (__install_timer) { - clearTimeout(__install_timer); - __install_timer = null; - } - if (__installed) { - mouse.setSocket(null); - keyboard.setSocket(null); - __installed = false; - } + mouse.setSocket(null); + keyboard.setSocket(null); }; } |