diff options
Diffstat (limited to 'web/share/js/kvm/mouse.js')
-rw-r--r-- | web/share/js/kvm/mouse.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js index dca2f4c5..9ac1fd0c 100644 --- a/web/share/js/kvm/mouse.js +++ b/web/share/js/kvm/mouse.js @@ -27,11 +27,13 @@ import {tools, $} from "../tools.js"; import {Keypad} from "../keypad.js"; -export function Mouse() { +export function Mouse(record_callback) { var self = this; /************************************************************************/ + var __record_callback = record_callback; + var __ws = null; var __online = true; @@ -194,9 +196,11 @@ export function Mouse() { }; var __sendEvent = function(event_type, event) { + event = {"event_type": event_type, "event": event}; if (__ws) { - __ws.send(JSON.stringify({"event_type": event_type, "event": event})); + __ws.send(JSON.stringify(event)); } + __record_callback(event); }; __init__(); |