mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
refactoring
This commit is contained in:
parent
55e67e32ae
commit
70461b6192
@ -158,10 +158,6 @@ export function Mouse(__getGeometry, __recordWsEvent) {
|
||||
return (document.pointerLockElement === $("stream-box"));
|
||||
};
|
||||
|
||||
var __isRelativeSquashed = function() {
|
||||
return $("hid-mouse-squash-switch").checked;
|
||||
};
|
||||
|
||||
var __relativeCapturedHandler = function() {
|
||||
tools.info("Relative mouse", (__isRelativeCaptured() ? "captured" : "released"), "by pointer lock");
|
||||
__updateOnlineLeds();
|
||||
@ -209,7 +205,7 @@ export function Mouse(__getGeometry, __recordWsEvent) {
|
||||
x: Math.min(Math.max(-127, Math.floor(event.movementX * __relative_sens)), 127),
|
||||
y: Math.min(Math.max(-127, Math.floor(event.movementY * __relative_sens)), 127),
|
||||
};
|
||||
if (__isRelativeSquashed()) {
|
||||
if ($("hid-mouse-squash-switch").checked) {
|
||||
__relative_deltas.push(delta);
|
||||
} else {
|
||||
tools.debug("Mouse: relative:", delta);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user