mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
pikvm/pikvm#1094: web: separate switch for reversed scrolling and panning
This commit is contained in:
parent
e78d3e03ec
commit
81d67c6ed7
@ -287,12 +287,27 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Reverse scrolling:</td>
|
<td>Reverse scrolling:</td>
|
||||||
|
<td>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Y:</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<div class="switch-box">
|
<div class="switch-box">
|
||||||
<input type="checkbox" id="hid-mouse-reverse-scrolling-switch">
|
<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>
|
<label for="hid-mouse-reverse-scrolling-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
<td> </td>
|
||||||
|
<td>X:</td>
|
||||||
|
<td align="right">
|
||||||
|
<div class="switch-box">
|
||||||
|
<input type="checkbox" id="hid-mouse-reverse-panning-switch">
|
||||||
|
<label for="hid-mouse-reverse-panning-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Cumulative scrolling:</td>
|
<td>Cumulative scrolling:</td>
|
||||||
|
|||||||
@ -83,7 +83,13 @@ li(id="system-dropdown" class="right")
|
|||||||
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 moves", true, true)
|
+menu_switch_notable("hid-mouse-squash-switch", "Squash relative moves", true, true)
|
||||||
tr
|
tr
|
||||||
+menu_switch_notable("hid-mouse-reverse-scrolling-switch", "Reverse scrolling", true, false)
|
td Reverse scrolling:
|
||||||
|
td
|
||||||
|
table
|
||||||
|
tr
|
||||||
|
+menu_switch_notable("hid-mouse-reverse-scrolling-switch", "Y", true, false)
|
||||||
|
td
|
||||||
|
+menu_switch_notable("hid-mouse-reverse-panning-switch", "X", true, false)
|
||||||
tr
|
tr
|
||||||
+menu_switch_notable("hid-mouse-cumulative-scrolling-switch", "Cumulative scrolling", true, false)
|
+menu_switch_notable("hid-mouse-cumulative-scrolling-switch", "Cumulative scrolling", true, false)
|
||||||
tr
|
tr
|
||||||
|
|||||||
@ -72,6 +72,7 @@ export function Mouse(__getGeometry, __recordWsEvent) {
|
|||||||
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
|
||||||
|
|
||||||
tools.storage.bindSimpleSwitch($("hid-mouse-reverse-scrolling-switch"), "hid.mouse.reverse_scrolling", false);
|
tools.storage.bindSimpleSwitch($("hid-mouse-reverse-scrolling-switch"), "hid.mouse.reverse_scrolling", false);
|
||||||
|
tools.storage.bindSimpleSwitch($("hid-mouse-reverse-panning-switch"), "hid.mouse.reverse_panning", false);
|
||||||
let cumulative_scrolling = !(tools.browser.is_firefox && !tools.browser.is_mac);
|
let cumulative_scrolling = !(tools.browser.is_firefox && !tools.browser.is_mac);
|
||||||
tools.storage.bindSimpleSwitch($("hid-mouse-cumulative-scrolling-switch"), "hid.mouse.cumulative_scrolling", cumulative_scrolling);
|
tools.storage.bindSimpleSwitch($("hid-mouse-cumulative-scrolling-switch"), "hid.mouse.cumulative_scrolling", cumulative_scrolling);
|
||||||
tools.slider.setParams($("hid-mouse-scroll-slider"), 1, 25, 1, tools.storage.get("hid.mouse.scroll_rate", 5), __updateScrollRate);
|
tools.slider.setParams($("hid-mouse-scroll-slider"), 1, 25, 1, tools.storage.get("hid.mouse.scroll_rate", 5), __updateScrollRate);
|
||||||
@ -310,9 +311,11 @@ export function Mouse(__getGeometry, __recordWsEvent) {
|
|||||||
var __sendScroll = function(delta) {
|
var __sendScroll = function(delta) {
|
||||||
if (delta.x || delta.y) {
|
if (delta.x || delta.y) {
|
||||||
if ($("hid-mouse-reverse-scrolling-switch").checked) {
|
if ($("hid-mouse-reverse-scrolling-switch").checked) {
|
||||||
delta.x *= -1;
|
|
||||||
delta.y *= -1;
|
delta.y *= -1;
|
||||||
}
|
}
|
||||||
|
if ($("hid-mouse-reverse-panning-switch").checked) {
|
||||||
|
delta.x *= -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