moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
315 stars 128 forks source link

remove mousemove etc events from Ng-Idle #161

Closed viveksinghalalgoscale closed 2 years ago

viveksinghalalgoscale commented 2 years ago

I'm using Ng-Idle library for keeping check of user inactivity in a angular webapp.

I'm implemented library this much far

idle.setIdle(5); idle.setTimeout(0); idle.setInterrupts(DEFAULT_INTERRUPTSOURCES); idle.onIdleEnd.subscribe(() => { this.idleState = 'No longer idle.' console.log(this.idleState); this.idle.watch(); this.idleState = 'Started.'; }); idle.onIdleStart.subscribe(() => { this.idleState = 'You\'ve gone idle!' console.log(this.idleState); });

The problem is that the DEFAULT_INTERRUPTSOURCES takes all these mousemove keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll interrupt events but I want only keyboard and mouse click interrupts to stop ng-idle.

I've tried changing the events from these library files ---> ng-idle-core.umd.js, ng-idle-core.umd.js.map and ng-idle-core.metadata.json. Still no success.

How can I achieve the desired functionality?

@ng-idle version: 11.1.0

Angular version: 8