MV is there some script call that you can use to detect inactivity?

Hello, it's me again, well, the title says almost everything, i want to play an event that happens when the player gets inactive for an certain amount of time, but the way i know of doing it is manually checking each usable key if they are pressed or not (and there's the mouse too that i was forgetting), i know there is probably an easier way to make it, like maybe an script line or something, if anyone knows something like this, please tell me, thanks for helping!
it depends on how you define "inactivity".
control variable game data other contains quite a number of counters, and you can compare how many play time has passed with how many steps were taken in the same time.

but that does not cover menu openings or so.
Is this for a Offline RPG Maker Game or is this for some kind of Online Multiplayer?
Is this for a Offline RPG Maker Game or is this for some kind of Online Multiplayer?
Offline
it depends on how you define "inactivity".
control variable game data other contains quite a number of counters, and you can compare how many play time has passed with how many steps were taken in the same time.
This kind of system seems useful to make an idle event, or something that you need to wait stopped to unlock
but that does not cover menu openings or so.
in menu it would be useful to show an video demonstration of the game like arcades or some old console games.

anyway, how can i use it?
you'll need a parallel process constantly updating values of "current" variables, then comparing them to different variables for the old values.
and depending on what is different either update the old variables with the current ones (if the player moved, every count has to start again from current) or trigger the idle whatever.
you can try to use a conditional branch:

if: script: !$gamePlayer.isMoving();
variable x += 1
else
variable x = 0
end

you need a common event probably in parallel set by switch.
so the variable counts UP when the player isn't moving,
if it does move, variable reset to 0.

but that depends on the mechanc you want to build.
you probably also want to check if it doesn't dash as well, or it counts
also UP when dashing.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-some-script-call-that-you-can-use-to-detect-inactivity.150451/