Skip to content

Commit

Permalink
Optional repeat for long press commands (not handled yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
albaintor committed Oct 5, 2024
1 parent ba74fc3 commit a8204e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/app/image-map/image-map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export class ImageMapComponent implements AfterViewInit, OnDestroy {
return {type: "shortpress", event: endEvent};
}),
timeout({first: this.longPressThreshold, with: (info) => {
if (this.longPressRepeat == 0) return of({type: "longpress", event: startEvent});
return timer(0, this.longPressRepeat).pipe(map(count => {
return {type: "longpress", event: startEvent,timing: (count*this.longPressRepeat)}
}), takeUntil(merge(mouseup, touchEnd, mouseupwindow)))
Expand Down

0 comments on commit a8204e5

Please sign in to comment.