Skip to content

Commit

Permalink
decrease mousepad sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerwyn committed Dec 9, 2024
1 parent abd7db5 commit 1046b23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/universal-remote-card.min.js

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions src/classes/remote-touchpad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ export class RemoteTouchpad extends BaseRemoteElement {
const multiPrefix = this.getMultiPrefix();

// Only consider significant enough movement
const sensitivity = 2;
const totalDeltaX = (this.currentX ?? 0) - this.initialX;
const totalDeltaY = (this.currentY ?? 0) - this.initialY;
if (
Expand All @@ -173,8 +172,7 @@ export class RemoteTouchpad extends BaseRemoteElement {
// Mouse actions
if (
this.holdMove ||
Math.abs(Math.abs(totalDeltaX) - Math.abs(totalDeltaY)) >
sensitivity
Math.abs(Math.abs(totalDeltaX) - Math.abs(totalDeltaY)) > 1
) {
if (this.fireMouseAction) {
clearTimeout(this.holdTimer);
Expand All @@ -196,10 +194,7 @@ export class RemoteTouchpad extends BaseRemoteElement {
}
}
} else {
if (
Math.abs(Math.abs(totalDeltaX) - Math.abs(totalDeltaY)) >
sensitivity
) {
if (Math.abs(Math.abs(totalDeltaX) - Math.abs(totalDeltaY)) > 2) {
// Directional actions
if (Math.abs(totalDeltaX) > Math.abs(totalDeltaY)) {
this.direction = totalDeltaX < 0 ? 'left' : 'right';
Expand Down

0 comments on commit 1046b23

Please sign in to comment.