summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/kvm/index.html14
-rw-r--r--web/kvm/navbar-system.pug8
-rw-r--r--web/share/css/navbar.css1
-rw-r--r--web/share/js/kvm/mouse.js36
4 files changed, 29 insertions, 30 deletions
diff --git a/web/kvm/index.html b/web/kvm/index.html
index 44779b01..10c47d44 100644
--- a/web/kvm/index.html
+++ b/web/kvm/index.html
@@ -276,13 +276,6 @@
</td>
<td class="value-number" id="hid-mouse-sens-value"></td>
</tr>
- <tr>
- <td>Mouse Scroll Rate:</td>
- <td class="value-slider">
- <input class="slider" type="range" id="hid-mouse-scroll-slider">
- </td>
- <td class="value-number" id="hid-mouse-scroll-value"></td>
- </tr>
<tr class="feature-disabled" id="hid-mouse-squash">
<td>Squash relative moves:</td>
<td align="right">
@@ -301,6 +294,13 @@
</div>
</td>
</tr>
+ <tr>
+ <td>Scroll rate:</td>
+ <td class="value-slider">
+ <input class="slider" type="range" id="hid-mouse-scroll-slider">
+ </td>
+ <td class="value-number" id="hid-mouse-scroll-value"></td>
+ </tr>
</table>
</div>
</details>
diff --git a/web/kvm/navbar-system.pug b/web/kvm/navbar-system.pug
index fa1b47f3..717b4cf8 100644
--- a/web/kvm/navbar-system.pug
+++ b/web/kvm/navbar-system.pug
@@ -80,14 +80,14 @@ li(id="system-dropdown" class="right")
td Relative sensitivity:
td(class="value-slider") #[input(disabled type="range" id="hid-mouse-sens-slider" class="slider")]
td(id="hid-mouse-sens-value" class="value-number")
- tr
- td Mouse Scroll Rate:
- td(class="value-slider") #[input(type="range" id="hid-mouse-scroll-slider" class="slider")]
- td(id="hid-mouse-scroll-value" class="value-number")
tr(id="hid-mouse-squash" class="feature-disabled")
+menu_switch_notable("hid-mouse-squash-switch", "Squash relative moves", true, true)
tr
+menu_switch_notable("hid-mouse-reverse-scrolling-switch", "Reverse scrolling", true, false)
+ tr
+ td Scroll rate:
+ td(class="value-slider") #[input(type="range" id="hid-mouse-scroll-slider" class="slider")]
+ td(id="hid-mouse-scroll-value" class="value-number")
table(class="kv")
tr(id="hid-connect" class="feature-disabled")
+menu_switch_notable("hid-connect-switch", "Connect HID to Server", true, true)
diff --git a/web/share/css/navbar.css b/web/share/css/navbar.css
index 5be9ac81..efb1c384 100644
--- a/web/share/css/navbar.css
+++ b/web/share/css/navbar.css
@@ -131,6 +131,7 @@ ul#navbar li div.menu details summary {
ul#navbar li div.menu details div.spoiler {
margin-left: 20px !important;
border-left: var(--border-default-thin);
+ border-bottom: var(--border-default-thin);
}
ul#navbar li div.menu details summary::marker {
color: var(--cs-marker-fg);
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js
index 08cea815..31d6dfbe 100644
--- a/web/share/js/kvm/mouse.js
+++ b/web/share/js/kvm/mouse.js
@@ -44,8 +44,8 @@ export function Mouse(__getGeometry, __recordWsEvent) {
var __relative_deltas = [];
var __relative_touch_pos = null;
var __relative_sens = 1.0;
- var __relative_scroll_rate = 5;
- var __wheel_delta = {"x": 0, "y": 0};
+ var __scroll_rate = 5;
+ var __scroll_delta = {"x": 0, "y": 0};
var __stream_hovered = false;
@@ -62,7 +62,7 @@ export function Mouse(__getGeometry, __recordWsEvent) {
$("stream-box").onmouseup = (event) => __streamButtonHandler(event, false);
$("stream-box").oncontextmenu = (event) => event.preventDefault();
$("stream-box").onmousemove = __streamMoveHandler;
- $("stream-box").onwheel = __streamWheelHandler;
+ $("stream-box").onwheel = __streamScrollHandler;
$("stream-box").ontouchstart = (event) => __streamTouchStartHandler(event);
$("stream-box").ontouchmove = (event) => __streamTouchMoveHandler(event);
$("stream-box").ontouchend = (event) => __streamTouchEndHandler(event);
@@ -118,7 +118,7 @@ export function Mouse(__getGeometry, __recordWsEvent) {
var __updateScrollRate = function(value) {
$("hid-mouse-scroll-value").innerHTML = value + " #";
tools.storage.set("hid.mouse.scroll_rate", value);
- __relative_scroll_rate = value;
+ __scroll_rate = value;
};
var __updateRelativeSens = function(value) {
@@ -252,21 +252,19 @@ export function Mouse(__getGeometry, __recordWsEvent) {
}
};
- var __streamWheelHandler = function(event) {
+ var __streamScrollHandler = function(event) {
// https://learn.javascript.ru/mousewheel
// https://stackoverflow.com/a/24595588
event.preventDefault();
- //set default rate of -5, but allow localStorage hid.mouse.scroll_rate value to be used.
- var rate = -(__relative_scroll_rate);
+ let rate = -__scroll_rate;
if (!__absolute && !__isRelativeCaptured()) {
return;
}
let delta = {"x": 0, "y": 0};
- //This is for firefox and chrome, but not on mac. Mac uses 5-lines-per-scroll.
- if ((tools.browser.is_firefox || tools.browser.is_chrome) && !tools.browser.is_mac) {
+ if (tools.browser.is_firefox && !tools.browser.is_mac) {
if (event.deltaX !== 0) {
delta.x = event.deltaX / Math.abs(event.deltaX) * (rate);
}
@@ -276,20 +274,20 @@ export function Mouse(__getGeometry, __recordWsEvent) {
} else {
let factor = (tools.browser.is_mac ? 5 : 1);
- __wheel_delta.x += event.deltaX * factor; // Horizontal scrolling
- if (Math.abs(__wheel_delta.x) >= 100) {
- delta.x = __wheel_delta.x / Math.abs(__wheel_delta.x) * (rate);
- __wheel_delta.x = 0;
+ __scroll_delta.x += event.deltaX * factor; // Horizontal scrolling
+ if (Math.abs(__scroll_delta.x) >= 100) {
+ delta.x = __scroll_delta.x / Math.abs(__scroll_delta.x) * (rate);
+ __scroll_delta.x = 0;
}
- __wheel_delta.y += event.deltaY * factor; // Vertical scrolling
- if (Math.abs(__wheel_delta.y) >= 100) {
- delta.y = __wheel_delta.y / Math.abs(__wheel_delta.y) * (rate);
- __wheel_delta.y = 0;
+ __scroll_delta.y += event.deltaY * factor; // Vertical scrolling
+ if (Math.abs(__scroll_delta.y) >= 100) {
+ delta.y = __scroll_delta.y / Math.abs(__scroll_delta.y) * (rate);
+ __scroll_delta.y = 0;
}
}
- __sendWheel(delta);
+ __sendScroll(delta);
};
var __sendOrPlanRelativeMove = function(delta) {
@@ -307,7 +305,7 @@ export function Mouse(__getGeometry, __recordWsEvent) {
}
};
- var __sendWheel = function(delta) {
+ var __sendScroll = function(delta) {
if (delta.x || delta.y) {
if ($("hid-mouse-reverse-scrolling-switch").checked) {
delta.x *= -1;