Our application utilizes Angularjs 1.5 and the Ng-Idle module to monitor user inactivity time within specific intervals. A notification window is displayed when the timeout threshold is reached, prompting the user to refresh their session based on the Idle start and Idle end events. While this method works well for detecting true inactivity (no scrolling, clicking, or typing), it lacks the capability to register user activity when simply moving the mouse over the screen. Is there a way to implement additional event listeners such as mouse movements within the Ng_Idle module to prevent false inactivity triggers?
For reference, you can find the code snippet here
function closeModals() {
if ($scope.warning) {
$scope.warning.close();
$scope.warning = null;
//refreshing the session from server
}
if ($scope.timedout) {
$scope.timedout.close();
$scope.timedout = null;
}
}
$scope.$on('IdleStart', function() {
closeModals();
$scope.warning = $uibModal.open({
templateUrl: 'warning-dialog.html'
});
});
$scope.$on('IdleEnd', function() {
closeModals();
});
$scope.$on('IdleTimeout',
function() {
closeModals();
$scope.timedout = $uibModal.open({
templateUrl: 'timedout-dialog.html'
});
$timeout(
function() {
//logout the application
}, 72000);
});