Detect scroll activity (when LC is not frontmost)

Mike Bonner bonnmike at gmail.com
Mon Dec 26 06:47:12 CET 2016


If I remember what I read, yes it was only 10.12 so yeah, Its most likely
fixed by 10.12.2  Merry Christmas!

On Sun, Dec 25, 2016 at 10:25 PM, Terry Vogelaar <tvogelaar at de-mare.nl>
wrote:

> Thank you, Mike, for this! This is what I was searching for indeed. And
> you're right; I want to detect activity, not just scrolling. Scrolling was
> the only activity I could not catch yet, hence the subject line. But this
> does exactly what I want.
>
> Fortunately I can not replicate the issue with 10.12 with typing. I am on
> 10.12.2, so maybe it has already been fixed.
>
> This is a priceless Christmas gift to me. Wow!
>
>
> With kind regards,
> Terry Vogelaar
>
> > Op 25 dec. 2016, om 18:19 heeft use-livecode-request at lists.runrev.com
> het volgende geschreven:
> >
> > I have an answer..
> >
> > Heres a sample script:
> > local sRunning
> >
> > on mouseUp
> > if sRunning is empty then put false into sRunning
> > put not sRunning into sRunning
> > loopit
> > end mouseUp
> >
> > command loopit
> > if sRunning then
> > put the last word of (shell("ioreg -c IOHIDSystem |grep Idle")) into
> tIdle
> > put tIdle / 1000000000 into field 1
> > send "loopit" to me in 2 sec
> > end if
> > end loopit
> >
> > The script is in a button, and I have a single field on the card.  The
> math
> > is done to convert to seconds of idle.
> >
> > The are only 2 disclaimers here.  First is that the value returned pre
> 10.3
> > is hex so you'd have to handle that if you have an earlier osx.  10.3 and
> > after this solution should work fine.
> >
> > The second issue is is that on mac 10.12, the idle time won't update on
> > typing.  Its an osx issue for that specific version, but worst case you
> > already have a method to track keypresses.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list