I need to make a redirect to a "sleep screen", in case the user does not interact via click / touch, drag and mouse movement.
What you can do
<script type="text/javascript">
var meuTempo;
meuTempo = setTimeout(openUrl, 5000); // redirecionamento
function resetTimer(){
clearTimeout(meuTempo); // dá um clear no tempo para dar reload
}
function openUrl(){
window.location = "https://www.google.com.br/"; // reload
}
jQuery(document).bind("click mousemove touchstart", resetTimer); // reset de timer por interação
</script>
The problem
It is necessary that whenever the user does not interact, the counter is set again.
That is, if the user interacts, he stays on the page, if not, he is redirected after X seconds to another screen.