mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
pikvm/pikvm#739: reversed mouse option
This commit is contained in:
parent
232873a77b
commit
55e67e32ae
@ -267,6 +267,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Reverse mouse scrolling:</td>
|
||||||
|
<td align="right">
|
||||||
|
<div class="switch-box">
|
||||||
|
<input type="checkbox" id="hid-mouse-reverse-scrolling-switch">
|
||||||
|
<label for="hid-mouse-reverse-scrolling-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr class="feature-disabled" id="hid-connect">
|
<tr class="feature-disabled" id="hid-connect">
|
||||||
<td>Connect HID to Server:</td>
|
<td>Connect HID to Server:</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
|
|||||||
@ -71,6 +71,8 @@ li(class="right")
|
|||||||
td(id="hid-mouse-sens-value" class="value" style="min-width: 30px; max-width:30px")
|
td(id="hid-mouse-sens-value" class="value" style="min-width: 30px; max-width:30px")
|
||||||
tr(id="hid-mouse-squash" class="feature-disabled")
|
tr(id="hid-mouse-squash" class="feature-disabled")
|
||||||
+menu_switch_notable("hid-mouse-squash-switch", "Squash relative mouse moves", true, true)
|
+menu_switch_notable("hid-mouse-squash-switch", "Squash relative mouse moves", true, true)
|
||||||
|
tr
|
||||||
|
+menu_switch_notable("hid-mouse-reverse-scrolling-switch", "Reverse mouse scrolling", true, false)
|
||||||
tr(id="hid-connect" class="feature-disabled")
|
tr(id="hid-connect" class="feature-disabled")
|
||||||
+menu_switch_notable("hid-connect-switch", "Connect HID to Server", true, true)
|
+menu_switch_notable("hid-connect-switch", "Connect HID to Server", true, true)
|
||||||
tr
|
tr
|
||||||
|
|||||||
@ -64,6 +64,7 @@ export function Mouse(__getGeometry, __recordWsEvent) {
|
|||||||
$("stream-box").ontouchstart = (event) => __streamTouchMoveHandler(event);
|
$("stream-box").ontouchstart = (event) => __streamTouchMoveHandler(event);
|
||||||
|
|
||||||
tools.storage.bindSimpleSwitch($("hid-mouse-squash-switch"), "hid.mouse.squash", true);
|
tools.storage.bindSimpleSwitch($("hid-mouse-squash-switch"), "hid.mouse.squash", true);
|
||||||
|
tools.storage.bindSimpleSwitch($("hid-mouse-reverse-scrolling-switch"), "hid.mouse.reverse_scrolling", false);
|
||||||
tools.slider.setParams($("hid-mouse-sens-slider"), 0.1, 1.9, 0.1, tools.storage.get("hid.mouse.sens", 1.0), __updateRelativeSens);
|
tools.slider.setParams($("hid-mouse-sens-slider"), 0.1, 1.9, 0.1, tools.storage.get("hid.mouse.sens", 1.0), __updateRelativeSens);
|
||||||
tools.slider.setParams($("hid-mouse-rate-slider"), 10, 100, 10, tools.storage.get("hid.mouse.rate", 100), __updateRate); // set __timer
|
tools.slider.setParams($("hid-mouse-rate-slider"), 10, 100, 10, tools.storage.get("hid.mouse.rate", 100), __updateRate); // set __timer
|
||||||
};
|
};
|
||||||
@ -280,6 +281,10 @@ export function Mouse(__getGeometry, __recordWsEvent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (delta.x || delta.y) {
|
if (delta.x || delta.y) {
|
||||||
|
if ($("hid-mouse-reverse-scrolling-switch").checked) {
|
||||||
|
delta.x *= -1;
|
||||||
|
delta.y *= -1;
|
||||||
|
}
|
||||||
tools.debug("Mouse: scrolled:", delta);
|
tools.debug("Mouse: scrolled:", delta);
|
||||||
__sendEvent("mouse_wheel", {"delta": delta});
|
__sendEvent("mouse_wheel", {"delta": delta});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user