Lo del timer puede funcionar.
Yo haría algo así:
1. Declara una constante TIMEOUT con el máximo tiempo posible de inactividad (en milisegundos) y una variable StartTime para guardar el tiempo en que se inicia la cuenta)
Código Delphi
[-]
const
TIMEOUT = 90000;
var
StartTime: Cardinal;
2. En el evento OnTimer de un Timer comparas el valor de StartTime con el tiempo actual y haces lo que tengas que hacer en caso de que haya transcurrido más tiempo que el indicado por TIMEOUT:
Código Delphi
[-]
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if GetTickCount() - StartTime > TIMEOUT then
Close;
end;
3. En el evento OnMessage de un componente TApplicationEvents (pestaña Additional) detectas los mensajes del teclado o del ratón para reiniciar la cuenta:
Código Delphi
[-]
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);
begin
if
(
(Msg.message >= WM_MOUSEFIRST) and (Msg.message <= WM_MOUSELAST)
or
(Msg.message >= WM_KEYFIRST) and (Msg.message <= WM_KEYLAST)
)
then
StartTime := GetTickCount();
end;
// Saludos