User Tools

Site Tools


getting_20the_20user_20idle_20time

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

getting_20the_20user_20idle_20time [2018/03/31 13:19]
127.0.0.1 external edit
getting_20the_20user_20idle_20time [2018/04/15 10:36] (current)
richardrussell Added syntax highlighting
Line 1: Line 1:
 =====Getting the User Idle time===== =====Getting the User Idle time=====
  
-//by Richard Russell, October 2011//\\ \\  The **User Idle** time is the time since the user last interacted with the PC, for example by pressing a key or moving the mouse. It's useful for things like determining when to display a screensaver.\\ \\  It's quite easy to get the User Idle time in BBC BASIC:\\ +//by Richard Russell, October 2011//\\ \\  The **User Idle** time is the time since the user last interacted with the PC, for example by pressing a key or moving the mouse. It's useful for things like determining when to display a screensaver.\\ \\  It's quite easy to get the User Idle time in BBC BASIC: 
 + 
 +<code bb4w>
         DIM lii{cbSize%,​ dwTime%}         DIM lii{cbSize%,​ dwTime%}
         lii.cbSize% = DIM(lii{})         lii.cbSize% = DIM(lii{})
Line 7: Line 9:
         SYS "​GetTickCount"​ TO tick%         SYS "​GetTickCount"​ TO tick%
         PRINT "User Idle time is "; (tick%-lii.dwTime%)/​1000 " seconds"​         PRINT "User Idle time is "; (tick%-lii.dwTime%)/​1000 " seconds"​
 +</​code>​
getting_20the_20user_20idle_20time.txt · Last modified: 2018/04/15 10:36 by richardrussell