add scroll wheel support to remote desktop

This commit is contained in:
KingKDot
2026-04-22 16:15:53 -05:00
parent 55a346e39b
commit 8c3c6de1c3
5 changed files with 37 additions and 1 deletions
@@ -1318,6 +1318,14 @@ import { checkFeatureAccess } from "./feature-gate.js";
canvas.addEventListener("contextmenu", function (e) {
e.preventDefault();
});
canvas.addEventListener("wheel", function (e) {
if (!mouseCtrl.checked) return;
const pt = getCanvasPoint(e);
if (!pt) return;
const delta = Math.max(-120, Math.min(120, Math.round(-e.deltaY)));
sendCmd("mouse_wheel", { delta, x: pt.x, y: pt.y });
e.preventDefault();
}, { passive: false });
canvas.setAttribute("tabindex", "0");
canvas.addEventListener("click", function () {