summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/mouse.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-11-05 13:08:24 +0300
committerDevaev Maxim <[email protected]>2020-11-05 13:08:24 +0300
commit6d117c039f979ca5b1465f81db3d78c3e136bb53 (patch)
treedb9f0c3a7c7bfee0cb3a0641a69d1e341c6c5c5d /web/share/js/kvm/mouse.js
parentae6d8258af6a800ca2f2107290114c80e326247f (diff)
fixes
Diffstat (limited to 'web/share/js/kvm/mouse.js')
-rw-r--r--web/share/js/kvm/mouse.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js
index 0f7282e0..8674adf5 100644
--- a/web/share/js/kvm/mouse.js
+++ b/web/share/js/kvm/mouse.js
@@ -71,6 +71,9 @@ export function Mouse(record_callback) {
self.setSocket = function(ws) {
__ws = ws;
$("stream-box").classList.toggle("stream-box-mouse-enabled", ws);
+ if (!__absolute && __isRelativeCaptured()) {
+ $("stream-box").exitPointerLock();
+ }
__updateOnlineLeds();
};
@@ -79,9 +82,12 @@ export function Mouse(record_callback) {
if (!("absolute" in state)) { // FIXME: SPI
state.absolute = true;
}
- if (state.absolute && !__absolute && __isRelativeCaptured()) {
+ if (!__absolute && state.absolute && __isRelativeCaptured()) {
$("stream-box").exitPointerLock();
}
+ if (__absolute && !state.absolute) {
+ __relative_deltas = [];
+ }
__absolute = state.absolute;
__updateOnlineLeds();
};