diff options
Diffstat (limited to 'web/share')
-rw-r--r-- | web/share/js/kvm/hid.js | 2 | ||||
-rw-r--r-- | web/share/js/kvm/recorder.js | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/web/share/js/kvm/hid.js b/web/share/js/kvm/hid.js index 68c19e37..e95d92c2 100644 --- a/web/share/js/kvm/hid.js +++ b/web/share/js/kvm/hid.js @@ -262,7 +262,7 @@ export function Hid(__getGeometry, __recorder) { } else if (http.status !== 200) { wm.error("HID paste error", http.responseText); } else if (http.status === 200) { - __recorder.recordPrintEvent(text); + __recorder.recordPrintEvent(text, keymap); } }, text, "text/plain"); }; diff --git a/web/share/js/kvm/recorder.js b/web/share/js/kvm/recorder.js index f32b5a2e..822aa972 100644 --- a/web/share/js/kvm/recorder.js +++ b/web/share/js/kvm/recorder.js @@ -67,8 +67,8 @@ export function Recorder() { __recordEvent(event); }; - self.recordPrintEvent = function(text) { - __recordEvent({"event_type": "print", "event": {"text": text}}); + self.recordPrintEvent = function(text, keymap) { + __recordEvent({"event_type": "print", "event": {"text": text, "keymap": keymap}}); }; self.recordAtxButtonEvent = function(button) { @@ -159,6 +159,9 @@ export function Recorder() { } else if (event.event_type === "print") { __checkType(event.event.text, "string", "Non-string print text"); + if (event.event.keymap) { + __checkType(event.event.keymap, "string", "Non-string keymap"); + } } else if (event.event_type === "key") { __checkType(event.event.key, "string", "Non-string key code"); @@ -280,7 +283,11 @@ export function Recorder() { return; } else if (event.event_type === "print") { - tools.httpPost("/api/hid/print", {"limit": 0}, function(http) { + let params = {"limit": 0}; + if (event.event.keymap) { + params["keymap"] = event.event.keymap; + } + tools.httpPost("/api/hid/print", params, function(http) { if (http.status === 413) { wm.error("Too many text for paste!"); __stopProcess(); |