PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Listen for Mouse/Keyboard Event
[WD20] Listen for Mouse/Keyboard Event
Iniciado por guest, 16,nov. 2015 22:36 - No hay respuesta
Publicado el 16,noviembre 2015 - 22:36
I need to log out users if they are idle for more than 10 minutes. The only thing I have left to do is flip a boolean on a mouse or keyboard event. Is there an easy way to listen for mouse/keyboard events?

// WIN_Main global variables gbAppIdle is boolean = True gduAppIdle is Duration // Timer called from end of init of WIN_Main //// Automatic Procedure: // The procedure is run manually, during a call in the code // It will be repeated in loop, with a timeout set to 1 second between each call // Each following call runs the procedure once, without timer // PROCEDURE IdleLoginTimer() duTemp is Duration duTemp..Minute = 10 IF gbAppIdle THEN gduAppIdle..Second+=1 // If idle for more than 10 minutes log out IF gduAppIdle >= duTemp THEN ExecuteProcess(BTN_LogOut,trtClick) ELSE gduAppIdle = 0 gbAppIdle = True END