You should be able to do it easily enough. Just
set up a timer that counts seconds since the last
time your app saw a keyboard or mouse event, and when
it gets to 600 seconds, you stop the timer and set
the "away" flag. Whenever your app sees a mouse or
keyboard event, reset the counter to 0 seconds, remove the
"away" status and restart the timer if necessary. No
problem ;).