How to detect any user action for timeout

My intention is to auto logout an user who is logged into app-implemented login form after a while.

I need to detect wether the user is inactive or not. How to detect any user action? I am ok to logout after screen timeout, but actually I want to set a duration of my choice.

Is there a solution for this?

what kind of actions are there available in your app?
for example button clicks? on each button click reset yout countdown timer…


Button click, textbox input, scrolling, side menu.

Thanks for reply, but I would prefer a “any actions” block instead of query and manage every single action component. But that seems to be the only way?