From f5a6fe35a99735c11eaad5d194061223bf9a0820 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 10 Dec 2019 05:53:29 +0300 Subject: ws api refactoring --- web/share/js/kvm/mouse.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'web/share/js/kvm/mouse.js') diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js index 3b5da1de..1b8aa716 100644 --- a/web/share/js/kvm/mouse.js +++ b/web/share/js/kvm/mouse.js @@ -147,9 +147,8 @@ export function Mouse() { __sendMove(); if (__ws) { __ws.send(JSON.stringify({ - event_type: "mouse_button", - button: button, - state: state, + "event_type": "mouse_button", + "event": {"button": button, "state": state}, })); } }; @@ -166,8 +165,8 @@ export function Mouse() { tools.debug("Mouse: moved:", to); if (__ws) { __ws.send(JSON.stringify({ - event_type: "mouse_move", - to: to, + "event_type": "mouse_move", + "event": {"to": to}, })); } __sent_pos = pos; @@ -202,8 +201,8 @@ export function Mouse() { tools.debug("Mouse: scrolled:", delta); if (__ws) { __ws.send(JSON.stringify({ - event_type: "mouse_wheel", - delta: delta, + "event_type": "mouse_wheel", + "event": {"delta": delta}, })); } } -- cgit v1.2.3