Keyboard and Mouse Idle Time

This group of four macros (and a fifth sample macro which demonstrates how to use them) shows how to independently get the idle time of the keyboard and mouse. KM already has a function called IDLE() but it combines the mouse and keyboard into a single idle time value. IDLE() returns a decimal value measured in seconds, but in these macros I chose to use milliseconds. That's a personal preference of mine.

There may not be many people who need to know the idle time of the mouse and keyboard separately, but I did at one time. So I wrote this for myself. It may also be a useful/simple illustration of subroutines, timers and a wildcard text trigger.

Keyboard and Mouse Idle Time

Sample Code- Report Idle Time.kmmacros (4.4 KB)

1 Like

Well my first comment would be "Excellent! I was wanting something like this just the other day, thanks!"

But my next comment is "I think you forgot to link the actual macros?"

Oops. I must have misunderstood how the Share feature worked. Let me try again. Let's see if this copied the remaining four macros...

Idle Time Macros.kmmacros (9.8 KB)

It looks like these are the remaining four macros for the same folder. I'm not sure if the sample macro in the first link now needs to be modified or not.

That's better, thanks. Though the sample code macro doesn't display any values. I'll take a look at it when I get some more time. Thanks again!

Perhaps I didn't mention that the sample code macro only displays values when you run it, manually.