Skip to content

Commit

Permalink
implement default mousepad scroll on multi mouse action, remove defau…
Browse files Browse the repository at this point in the history
…lt double tap action since two single taps should do the same thing
  • Loading branch information
Nerwyn committed Dec 8, 2024
1 parent 510ac82 commit 1ee9f93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
2 changes: 1 addition & 1 deletion dist/universal-remote-card.min.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/classes/remote-mousepad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export class RemoteMousepad extends RemoteTouchpad {
this.deltaY = currentY - this.initialY;
this.initialX = currentX;
this.initialY = currentY;
console.log(`${this.deltaX},${this.deltaY}`);

// Only consider significant enough movement
const sensitivity = 2;
Expand Down
31 changes: 7 additions & 24 deletions src/models/maps/unified_remote/defaultKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,10 @@ export const unifiedRemoteDefaultKeys: IElementConfig[] = [
action: 'perform-action',
perform_action: 'unified_remote.call',
data: {
remote_id: 'Relmtech.Basic Input',
action: 'delta',
remote_id: 'Core.Input',
action: 'MoveBy',
extras: {
Values: [
{
Value: 0,
},
{
Value: '{{ 3 * deltaX }}',
},
Expand All @@ -159,18 +156,12 @@ export const unifiedRemoteDefaultKeys: IElementConfig[] = [
action: 'perform-action',
perform_action: 'unified_remote.call',
data: {
remote_id: 'Relmtech.Basic Input',
action: 'delta', // TODO find scroll action
remote_id: 'Core.Input',
action: '{{ "Horz" if (deltaX | abs) > (deltaY | abs) else "Vert" }}',
extras: {
Values: [
{
Value: 0,
},
{
Value: '{{ 3 * deltaX }}',
},
{
Value: '{{ 3 * deltaY }}',
Value: '{{ -0.2 * (deltaX if (deltaX | abs) > (deltaY | abs) else deltaY) }}',
},
],
},
Expand All @@ -180,16 +171,8 @@ export const unifiedRemoteDefaultKeys: IElementConfig[] = [
action: 'perform-action',
perform_action: 'unified_remote.call',
data: {
remote_id: 'Relmtech.Basic Input',
action: 'tap',
},
},
double_tap_action: {
action: 'perform-action',
perform_action: 'unified_remote.call',
data: {
remote_id: 'Relmtech.Basic Input',
action: 'double',
remote_id: 'Core.Input',
action: 'Click',
},
},
hold_action: {
Expand Down

0 comments on commit 1ee9f93

Please sign in to comment.