action after user inactivity

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
tglabicki
Posts: 3
Last visit: Sat Jul 28, 2012 8:05 am

action after user inactivity

Post by tglabicki »

Hiwhether it is possible to show or hide a DIV using VBS in HTA application when it detects that the user does not do anything in the application by, eg. 5 minutesThanks for quick replay :)
User avatar
tglabicki
Posts: 3
Last visit: Sat Jul 28, 2012 8:05 am

action after user inactivity

Post by tglabicki »

Hiwhether it is possible to show or hide a DIV using VBS in HTA application when it detects that the user does not do anything in the application by, eg. 5 minutesThanks for quick replay :)
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

action after user inactivity

Post by jvierra »

Yes but you have to define "do" and "does not do".

The baseline method is to trap on all clicks and keystrokes and clear a flag. Set a timer for the timeout, when the timer ticks and if the flag is set hide or unhide your div.

1. set trap on all events and keystrokes a document level that clears flag.
2. set timer - set flag
3. timer ticks and flag is checked. if flag still set then perform action.


jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

action after user inactivity

Post by jvierra »

On body object place onclick="mysub"

In window load routine start a timer event and set its function. aet glocal flag variable to True.

Once you see how it works for the onclick then you can catch the onkeypressevent (?) and send it to the same function.

jvierra2012-07-28 12:05:08
User avatar
tglabicki
Posts: 3
Last visit: Sat Jul 28, 2012 8:05 am

action after user inactivity

Post by tglabicki »

Works perfect Thanks :D
This topic is 11 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked