Detect User Idle State

2 views
Skip to first unread message

daniel...@gmail.com

unread,
Jan 10, 2014, 8:53:16 PM1/10/14
to node-...@googlegroups.com
Our app needs to detect whether or not the user's active. Here's the native Windows API we call in the current version of the app:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646302(v=vs.85).aspx

We want to make my app cross-platform and we're considering node-webkit as a way to make that happen. Is there a way to detect the user's idle state in node-webkit?

Laszlo Z. Antal

unread,
Jan 10, 2014, 9:09:02 PM1/10/14
to node-...@googlegroups.com, node-...@googlegroups.com
Hi,
If you need to detect idle "only" in node-webkit then just add event listener for mouse move and keyup and set isUserIdle = false every time they fire. Add a setInterval to check for that variable being false as often as you need it. 
I used it to do animation in one of my game to tell the player to hurry :)

Hope it helps 

Laszlo
http://twitter.com/LZAntal

--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

daniel...@gmail.com

unread,
Jan 10, 2014, 9:16:48 PM1/10/14
to node-...@googlegroups.com

grze...@gmail.com

unread,
Jan 11, 2014, 4:16:04 AM1/11/14
to node-...@googlegroups.com, daniel...@gmail.com
Try to find some topics before posting another one:

https://groups.google.com/forum/#!topic/node-webkit/NgizskQ74Xo

Shaun Clark

unread,
Jan 11, 2014, 4:12:35 PM1/11/14
to node-...@googlegroups.com, daniel...@gmail.com, grze...@gmail.com
I would also really like this feature, I noticed that their is a keypress npm module, I'm not sure if it does system wide events or not, I can't get raw mode to work to test it.
Reply all
Reply to author
Forward
0 new messages