diff options
Diffstat (limited to 'web/share/js/kvm')
-rw-r--r-- | web/share/js/kvm/keyboard.js | 6 | ||||
-rw-r--r-- | web/share/js/kvm/mouse.js | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/web/share/js/kvm/keyboard.js b/web/share/js/kvm/keyboard.js index 4b30b2c6..7f4c4f84 100644 --- a/web/share/js/kvm/keyboard.js +++ b/web/share/js/kvm/keyboard.js @@ -89,7 +89,7 @@ export function Keyboard(__recordWsEvent) { }; self.emit = function(code, state) { - __keyboardHandler({code: code}, state); + __keypad.emitByCode(code, state); }; var __updateOnlineLeds = function() { @@ -126,9 +126,7 @@ export function Keyboard(__recordWsEvent) { if (event.preventDefault) { event.preventDefault(); } - if (!event.repeat) { - __keypad.emit(event.code, state); - } + __keypad.emitByKeyEvent(event, state); }; var __sendKey = function(code, state) { diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js index f927567c..703ea095 100644 --- a/web/share/js/kvm/mouse.js +++ b/web/share/js/kvm/mouse.js @@ -168,11 +168,11 @@ export function Mouse(__getGeometry, __recordWsEvent) { event.preventDefault(); if (__absolute || __isRelativeCaptured()) { switch (event.button) { - case 0: __keypad.emit("left", state); break; - case 2: __keypad.emit("right", state); break; - case 1: __keypad.emit("middle", state); break; - case 3: __keypad.emit("up", state); break; - case 4: __keypad.emit("down", state); break; + case 0: __keypad.emitByCode("left", state); break; + case 2: __keypad.emitByCode("right", state); break; + case 1: __keypad.emitByCode("middle", state); break; + case 3: __keypad.emitByCode("up", state); break; + case 4: __keypad.emitByCode("down", state); break; } } else if (!__absolute && !__isRelativeCaptured() && !state) { $("stream-box").requestPointerLock(); |