Detect scroll activity (when LC is not frontmost)

classic Classic list List threaded Threaded
37 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Detect scroll activity (when LC is not frontmost)

Terry Vogelaar
I’m working on a productivity & RSI prevention app. So I want to notice activity while my project is not the frontmost application. Thanks to a very helpful list member, my LiveCode stack can detect key strokes (the keysdown is not empty) and mouse clicks (the mouse is down). I added mouse movement to that (the screenMouseLoc).

But how do I catch usage of the mouse scroll wheel? There is a lot of scrolling (and not much else) going on when viewing a website like Facebook or Twitter. So my app would consider that to be a ‘pause’.


With kind regards,
Terry Vogelaar


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

dunbarxx
This post was updated on .
Hi.

The "rawKeyDown" message can return scrollWheel activity. The results are:

65308 for a down scroll
65309 for an up scroll.

Craig Newman
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Mike Bonner
In reply to this post by Terry Vogelaar
I think the scroll wheel sends arrow keys, but since there isn't a
"rawkeysdown()" function to match the keysdown() function it would require
either an external or the function to be added with livecode builder. At
which point I wonder.. Is there a way to hook in to the system timer?  (the
one that decides if the screensaver/sleep mode should activate.)

No clue how to access such a thing. (Could go with the simple method and
request a rawkeysdown() feature)


On Wed, Dec 21, 2016 at 8:17 PM, Terry Vogelaar <[hidden email]>
wrote:

> I’m working on a productivity & RSI prevention app. So I want to notice
> activity while my project is not the frontmost application. Thanks to a
> very helpful list member, my LiveCode stack can detect key strokes (the
> keysdown is not empty) and mouse clicks (the mouse is down). I added mouse
> movement to that (the screenMouseLoc).
>
> But how do I catch usage of the mouse scroll wheel? There is a lot of
> scrolling (and not much else) going on when viewing a website like Facebook
> or Twitter. So my app would consider that to be a ‘pause’.
>
>
> With kind regards,
> Terry Vogelaar
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Mike Bonner
Actually, nevermind, the scroll wheel on my system doesn't trigger an arrow
key press, but the arrowkeys are indeed picked up by keysdown. My
apologies. :)

On Thu, Dec 22, 2016 at 7:58 AM, Mike Bonner <[hidden email]> wrote:

> I think the scroll wheel sends arrow keys, but since there isn't a
> "rawkeysdown()" function to match the keysdown() function it would require
> either an external or the function to be added with livecode builder. At
> which point I wonder.. Is there a way to hook in to the system timer?  (the
> one that decides if the screensaver/sleep mode should activate.)
>
> No clue how to access such a thing. (Could go with the simple method and
> request a rawkeysdown() feature)
>
>
> On Wed, Dec 21, 2016 at 8:17 PM, Terry Vogelaar <[hidden email]>
> wrote:
>
>> I’m working on a productivity & RSI prevention app. So I want to notice
>> activity while my project is not the frontmost application. Thanks to a
>> very helpful list member, my LiveCode stack can detect key strokes (the
>> keysdown is not empty) and mouse clicks (the mouse is down). I added mouse
>> movement to that (the screenMouseLoc).
>>
>> But how do I catch usage of the mouse scroll wheel? There is a lot of
>> scrolling (and not much else) going on when viewing a website like Facebook
>> or Twitter. So my app would consider that to be a ‘pause’.
>>
>>
>> With kind regards,
>> Terry Vogelaar
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

dunbarxx
This post was updated on .
I assume this discussion is still intact.

The "rawkeyDown" message may be trapped as follows:

on rawkeydown tkey
   if  tkey = 65308 then doScrollDownStuff
   if  tkey = 65309 then doScrollUpStuff
end rawkeydown

And it just registered on me that the thread was about when LC was not the frontmost app.Because if that is the case, there is no interaction between the scroll wheel and LC, because although the keysDown function seems to work even when LC is not in front, the rawKeyDown message is not sent.
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Quentin Long
In reply to this post by Terry Vogelaar
sez dunbarx:
> The "rawkeyDown" message may be trapped as follows:
>
> on rawkeydown tkey
>    if  tkey = 65308 then doScrollDownStuff
>    else doScrollUpStuff
> end rawkeydown
Hold it. That code, as written, will trap *A*L*L* rawKeyDown events, and silently kill everything that's *not* a scrollwheel-down event. Which, in turn, means that text input is toast, among other probably-unwanted side-effects. Try something like this instead:

on rawKeyDown DerKey
  switch DerKey
    case 65308
      DoScrollDownStuff
      break
    case 65309
      DoScrollUpStuff
      break
    default
     pass rawKeyDown
  end switch
end rawKeyDown

Note that with the switch structure I've used here, there are a number of perhaps-useful tricks you can pull… but said tricks are strictly outside the scope of the original "how do I detect scrollwheel activity?" problem, so I will leave said tricks as exercises for the reader.
   
"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"
   
Read the webcomic at [ http://www.atarmslength.net ]!
   
If you like "At Arm's Length", support it at [ http://www.patreon.com/DarkwingDude ].

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
hh
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

hh
In reply to this post by Terry Vogelaar
What you say is logically totally wrong.
"DoScrollUpStuff" may of course easily be written such that Craig's
script does the same as your script. And even more, for example
reader's exercises :-))

> Quentin L. wrote:
> sez dunbarx:
> > The "rawkeyDown" message may be trapped as follows:
> >
> > on rawkeydown tkey
> >    if  tkey = 65308 then doScrollDownStuff
> >    else doScrollUpStuff
> > end rawkeydown
> Hold it. That code, as written, will trap *A*L*L* rawKeyDown
> events, and silently kill everything that's *not* a scrollwheel-down
> event. Which, in turn, means that text input is toast, among other
> probably-unwanted side-effects. Try something like this instead:
>
> on rawKeyDown DerKey
>   switch DerKey
>     case 65308
>       DoScrollDownStuff
>       break
>     case 65309
>       DoScrollUpStuff
>       break
>     default
>      pass rawKeyDown
>   end switch
> end rawKeyDown
>
> Note that with the switch structure I've used here, there are a
> number of perhaps-useful tricks you can pull… but said tricks are
> strictly outside the scope of the original "how do I detect
> scrollwheel activity?" problem, so I will leave said tricks as
> exercises for the reader.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

J. Landman Gay
It doesn't seem logical to expect a "doScrollUpStuff" handler to also
manage all other keystrokes. One would expect the original rawKeyDown
handler to manage non-scroll keys by passing them to the engine.

If the intent is to block all keys except those used for scrolling, then
Craig's way would work. The method chosen depends on where the handler
resides; other keys may not be applicable in a field script where the
field is locked. If the handler is in a card or stack script, then
passing other keystrokes is usually necessary.


On 12/23/16 3:47 PM, hh wrote:

> What you say is logically totally wrong.
> "DoScrollUpStuff" may of course easily be written such that Craig's
> script does the same as your script. And even more, for example
> reader's exercises :-))
>
>> Quentin L. wrote:
>> sez dunbarx:
>>> The "rawkeyDown" message may be trapped as follows:
>>>
>>> on rawkeydown tkey
>>>    if  tkey = 65308 then doScrollDownStuff
>>>    else doScrollUpStuff
>>> end rawkeydown
>> Hold it. That code, as written, will trap *A*L*L* rawKeyDown
>> events, and silently kill everything that's *not* a scrollwheel-down
>> event. Which, in turn, means that text input is toast, among other
>> probably-unwanted side-effects. Try something like this instead:
>>
>> on rawKeyDown DerKey
>>   switch DerKey
>>     case 65308
>>       DoScrollDownStuff
>>       break
>>     case 65309
>>       DoScrollUpStuff
>>       break
>>     default
>>      pass rawKeyDown
>>   end switch
>> end rawKeyDown
>>
>> Note that with the switch structure I've used here, there are a
>> number of perhaps-useful tricks you can pull… but said tricks are
>> strictly outside the scope of the original "how do I detect
>> scrollwheel activity?" problem, so I will leave said tricks as
>> exercises for the reader.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
hh
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

hh
In reply to this post by Terry Vogelaar
> Jacqueline LG wrote:
> It doesn't seem logical to expect a "doScrollUpStuff" handler to also  
> manage all other keystrokes.

It's possibly "unusual" as naming has some conventions. But still
logical, why not? Nothing is blocked as long as we don't know what
doScrollUpStuff does.

Quentin derived his post greatly from a conclusion what Craig's script
does (blocking). And this conclusion is logically wrong, that's my point.

Of course his script is the "usual" one for rawkeyDown:
This is after all the example from the dictionary entry  ;-)

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Mike Bonner
I was kicked form list again and missed a few messages.. Did someone
actually come up with an answer to detect scroll activity?

On Fri, Dec 23, 2016 at 4:17 PM, hh <[hidden email]> wrote:

> > Jacqueline LG wrote:
> > It doesn't seem logical to expect a "doScrollUpStuff" handler to also
> > manage all other keystrokes.
>
> It's possibly "unusual" as naming has some conventions. But still
> logical, why not? Nothing is blocked as long as we don't know what
> doScrollUpStuff does.
>
> Quentin derived his post greatly from a conclusion what Craig's script
> does (blocking). And this conclusion is logically wrong, that's my point.
>
> Of course his script is the "usual" one for rawkeyDown:
> This is after all the example from the dictionary entry  ;-)
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Terry Vogelaar
In reply to this post by Terry Vogelaar
Thank you, Craig and Mike, for your responses. But the problem with the rawKeyDown message is that the mouse needs to be in the LiveCode window. I can scroll in my web browser all day and LiveCode wouldn’t ever notice. So unfortunately this is not what I’m looking for.

Doing a feature request for a rawkeysdown function sounds like a good idea.

Maybe there is something to the idea of hooking in to the system timer. Although I wouldn’t know how to do that either.


With kind regards,
Terry Vogelaar

> Op 23 dec. 2016, om 12:00 heeft [hidden email] het volgende geschreven:
>
> From: dunbarx <[hidden email] <mailto:[hidden email]>>
>
> Hi.
>
> The "rawKeyDown" message can detect scrollWheel activity. The results are:
>
> 65308 for a down scroll
> 65309 for an up scroll.
>
> Craig Newman
> ------------------------------
>
> From: Mike Bonner <[hidden email] <mailto:[hidden email]>>
>
> I think the scroll wheel sends arrow keys, but since there isn't a
> "rawkeysdown()" function to match the keysdown() function it would require
> either an external or the function to be added with livecode builder. At
> which point I wonder.. Is there a way to hook in to the system timer?  (the
> one that decides if the screensaver/sleep mode should activate.)
>
> No clue how to access such a thing. (Could go with the simple method and
> request a rawkeysdown() feature)
> ------------------------------
>
> Actually, nevermind, the scroll wheel on my system doesn't trigger an arrow
> key press, but the arrowkeys are indeed picked up by keysdown. My
> apologies. :)
>
> ------------------------------
>
> From: dunbarx <[hidden email] <mailto:[hidden email]>>
>
> I assume this discussion is still intact.
>
> The "rawkeyDown" message may be trapped as follows:
>
> on rawkeydown tkey
>   if  tkey = 65308 then doScrollDownStuff
>   else doScrollUpStuff
> end rawkeydown

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

dunbarxx
I never intended that handler to do anything but demonstrate how the scrollWheel was linked to the rawkeyDown message. It is and was always possible to pass rawKeyDown so that the keyboard was not crippled. I assumed everyone knew that.

There is a thread on the forums, "keysDown works across applications" that might be interesting, as it presents a topic concerning access to LC while in, say, a browser. But "rawKeyDown" is not part of it.

Craig
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Mike Bonner
In reply to this post by Terry Vogelaar
Is this a windows only app? If so I have the beginnings of an idea. The
short version is inserting a scheduled task using schtask.exe that only
fires after a period of idle.  The task could be to simply write the time
to a file.  Perhaps after a couple of minutes of idle. Then you can have
your app check that file, and do the math to figure out how long the user
has been active since the last idle write.  If this works, it would remove
the need for checking the keys down, or scrolling or anything of that
nature.

Not sure yet if it will work, but I'll experiment some.

On Fri, Dec 23, 2016 at 7:42 PM, Terry Vogelaar <[hidden email]>
wrote:

> Thank you, Craig and Mike, for your responses. But the problem with the
> rawKeyDown message is that the mouse needs to be in the LiveCode window. I
> can scroll in my web browser all day and LiveCode wouldn’t ever notice. So
> unfortunately this is not what I’m looking for.
>
> Doing a feature request for a rawkeysdown function sounds like a good idea.
>
> Maybe there is something to the idea of hooking in to the system timer.
> Although I wouldn’t know how to do that either.
>
>
> With kind regards,
> Terry Vogelaar
>
> > Op 23 dec. 2016, om 12:00 heeft [hidden email]
> het volgende geschreven:
> >
> > From: dunbarx <[hidden email] <mailto:[hidden email]>>
> >
> > Hi.
> >
> > The "rawKeyDown" message can detect scrollWheel activity. The results
> are:
> >
> > 65308 for a down scroll
> > 65309 for an up scroll.
> >
> > Craig Newman
> > ------------------------------
> >
> > From: Mike Bonner <[hidden email] <mailto:[hidden email]>>
> >
> > I think the scroll wheel sends arrow keys, but since there isn't a
> > "rawkeysdown()" function to match the keysdown() function it would
> require
> > either an external or the function to be added with livecode builder. At
> > which point I wonder.. Is there a way to hook in to the system timer?
> (the
> > one that decides if the screensaver/sleep mode should activate.)
> >
> > No clue how to access such a thing. (Could go with the simple method and
> > request a rawkeysdown() feature)
> > ------------------------------
> >
> > Actually, nevermind, the scroll wheel on my system doesn't trigger an
> arrow
> > key press, but the arrowkeys are indeed picked up by keysdown. My
> > apologies. :)
> >
> > ------------------------------
> >
> > From: dunbarx <[hidden email] <mailto:[hidden email]>>
> >
> > I assume this discussion is still intact.
> >
> > The "rawkeyDown" message may be trapped as follows:
> >
> > on rawkeydown tkey
> >   if  tkey = 65308 then doScrollDownStuff
> >   else doScrollUpStuff
> > end rawkeydown
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Mike Bonner
that shoulda been schtasks.exe

On Sat, Dec 24, 2016 at 9:08 AM, Mike Bonner <[hidden email]> wrote:

> Is this a windows only app? If so I have the beginnings of an idea. The
> short version is inserting a scheduled task using schtask.exe that only
> fires after a period of idle.  The task could be to simply write the time
> to a file.  Perhaps after a couple of minutes of idle. Then you can have
> your app check that file, and do the math to figure out how long the user
> has been active since the last idle write.  If this works, it would remove
> the need for checking the keys down, or scrolling or anything of that
> nature.
>
> Not sure yet if it will work, but I'll experiment some.
>
> On Fri, Dec 23, 2016 at 7:42 PM, Terry Vogelaar <[hidden email]>
> wrote:
>
>> Thank you, Craig and Mike, for your responses. But the problem with the
>> rawKeyDown message is that the mouse needs to be in the LiveCode window. I
>> can scroll in my web browser all day and LiveCode wouldn’t ever notice. So
>> unfortunately this is not what I’m looking for.
>>
>> Doing a feature request for a rawkeysdown function sounds like a good
>> idea.
>>
>> Maybe there is something to the idea of hooking in to the system timer.
>> Although I wouldn’t know how to do that either.
>>
>>
>> With kind regards,
>> Terry Vogelaar
>>
>> > Op 23 dec. 2016, om 12:00 heeft [hidden email]
>> het volgende geschreven:
>> >
>> > From: dunbarx <[hidden email] <mailto:[hidden email]>>
>> >
>> > Hi.
>> >
>> > The "rawKeyDown" message can detect scrollWheel activity. The results
>> are:
>> >
>> > 65308 for a down scroll
>> > 65309 for an up scroll.
>> >
>> > Craig Newman
>> > ------------------------------
>> >
>> > From: Mike Bonner <[hidden email] <mailto:[hidden email]>>
>> >
>> > I think the scroll wheel sends arrow keys, but since there isn't a
>> > "rawkeysdown()" function to match the keysdown() function it would
>> require
>> > either an external or the function to be added with livecode builder. At
>> > which point I wonder.. Is there a way to hook in to the system timer?
>> (the
>> > one that decides if the screensaver/sleep mode should activate.)
>> >
>> > No clue how to access such a thing. (Could go with the simple method and
>> > request a rawkeysdown() feature)
>> > ------------------------------
>> >
>> > Actually, nevermind, the scroll wheel on my system doesn't trigger an
>> arrow
>> > key press, but the arrowkeys are indeed picked up by keysdown. My
>> > apologies. :)
>> >
>> > ------------------------------
>> >
>> > From: dunbarx <[hidden email] <mailto:[hidden email]>>
>> >
>> > I assume this discussion is still intact.
>> >
>> > The "rawkeyDown" message may be trapped as follows:
>> >
>> > on rawkeydown tkey
>> >   if  tkey = 65308 then doScrollDownStuff
>> >   else doScrollUpStuff
>> > end rawkeydown
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Richmond Mathewson-2
Sorry: late to the party!

A rawKeyDown message IS recieved even IF the mouse is NOT in the
LiveCode window, BUT
the LiveCode window MUST be the front window.

A rawKeyDown message won't be recieved IF the mouse is NOT in the
LiveCode windows if
it comes from a mouse button, scrollwheel or track ball.

The micro trackball on the top of my Macintosh mouse sends these
rawKeydowns:

Left: 65310 . . . . . . Left Arrow Key: 65361

Right: 65311 . . . . . . Right Arrow Key: 65363

Forward: 65308 . . . . . . Up Arrow Key: 65362

Back: 65309 . . . . . .Down Arrow Key 65364

Richmond.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Mike Bonner
While digging around for answers I came across something interesting..

From windows vista and onward there is a program quser.exe located in
\windows\system32 that returns the current user state. From the command
line it shows
mike                  console             1  Active      none   12/16/2016
5:56 PM

I was going to test and see if it would show idle after a period of
inactivity (using a looping lc shell call) but heres the interesting
thing..  Lc can't see it.  At all.  Trying a shell call returns " is not
recognized as an internal or external command, operable program, or batch
file.

I can change to the directory in shell and "dir" and there it is.  I can
run it from shell.

If I do a shell call shell("dir quser.exe") on that directory it says
"Directory of c:\windows\system" file not found.
If I get the files, it isn't there.

So my question is this.. What the heck is going on?  Its not a hidden or
system file, as far as I can tell its just a file sitting there like
normal.  Why can't lc see it?  (why can't the LC shell see it for that
matter)

On Sat, Dec 24, 2016 at 9:49 AM, Richmond Mathewson <
[hidden email]> wrote:

> Sorry: late to the party!
>
> A rawKeyDown message IS recieved even IF the mouse is NOT in the LiveCode
> window, BUT
> the LiveCode window MUST be the front window.
>
> A rawKeyDown message won't be recieved IF the mouse is NOT in the LiveCode
> windows if
> it comes from a mouse button, scrollwheel or track ball.
>
> The micro trackball on the top of my Macintosh mouse sends these
> rawKeydowns:
>
> Left: 65310 . . . . . . Left Arrow Key: 65361
>
> Right: 65311 . . . . . . Right Arrow Key: 65363
>
> Forward: 65308 . . . . . . Up Arrow Key: 65362
>
> Back: 65309 . . . . . .Down Arrow Key 65364
>
> Richmond.
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Mike Bonner
nvm, found the answer. Now going afk long enough to see if I can pick up an
"idle" msg"


On Sat, Dec 24, 2016 at 10:24 AM, Mike Bonner <[hidden email]> wrote:

> While digging around for answers I came across something interesting..
>
> From windows vista and onward there is a program quser.exe located in
> \windows\system32 that returns the current user state. From the command
> line it shows
> mike                  console             1  Active      none   12/16/2016
> 5:56 PM
>
> I was going to test and see if it would show idle after a period of
> inactivity (using a looping lc shell call) but heres the interesting
> thing..  Lc can't see it.  At all.  Trying a shell call returns " is not
> recognized as an internal or external command, operable program, or batch
> file.
>
> I can change to the directory in shell and "dir" and there it is.  I can
> run it from shell.
>
> If I do a shell call shell("dir quser.exe") on that directory it says
> "Directory of c:\windows\system" file not found.
> If I get the files, it isn't there.
>
> So my question is this.. What the heck is going on?  Its not a hidden or
> system file, as far as I can tell its just a file sitting there like
> normal.  Why can't lc see it?  (why can't the LC shell see it for that
> matter)
>
> On Sat, Dec 24, 2016 at 9:49 AM, Richmond Mathewson <
> [hidden email]> wrote:
>
>> Sorry: late to the party!
>>
>> A rawKeyDown message IS recieved even IF the mouse is NOT in the LiveCode
>> window, BUT
>> the LiveCode window MUST be the front window.
>>
>> A rawKeyDown message won't be recieved IF the mouse is NOT in the
>> LiveCode windows if
>> it comes from a mouse button, scrollwheel or track ball.
>>
>> The micro trackball on the top of my Macintosh mouse sends these
>> rawKeydowns:
>>
>> Left: 65310 . . . . . . Left Arrow Key: 65361
>>
>> Right: 65311 . . . . . . Right Arrow Key: 65363
>>
>> Forward: 65308 . . . . . . Up Arrow Key: 65362
>>
>> Back: 65309 . . . . . .Down Arrow Key 65364
>>
>> Richmond.
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Richmond Mathewson-2
In a perfect world . . . .

There would be a cross-platform solution that did not depend of external
code snippets or components
of operating systems.

A little bird just sang "poll a key" in my ear, but I dismissed it as it
made me think of the executioner
on Tower Hill having to finally hack off the Duke of Monmouth's head
with his pocket knife as his
axe had gone blunt.

Richmond.

On 12/24/16 7:41 pm, Mike Bonner wrote:

> nvm, found the answer. Now going afk long enough to see if I can pick up an
> "idle" msg"
>
>
> On Sat, Dec 24, 2016 at 10:24 AM, Mike Bonner <[hidden email]> wrote:
>
>> While digging around for answers I came across something interesting..
>>
>>  From windows vista and onward there is a program quser.exe located in
>> \windows\system32 that returns the current user state. From the command
>> line it shows
>> mike                  console             1  Active      none   12/16/2016
>> 5:56 PM
>>
>> I was going to test and see if it would show idle after a period of
>> inactivity (using a looping lc shell call) but heres the interesting
>> thing..  Lc can't see it.  At all.  Trying a shell call returns " is not
>> recognized as an internal or external command, operable program, or batch
>> file.
>>
>> I can change to the directory in shell and "dir" and there it is.  I can
>> run it from shell.
>>
>> If I do a shell call shell("dir quser.exe") on that directory it says
>> "Directory of c:\windows\system" file not found.
>> If I get the files, it isn't there.
>>
>> So my question is this.. What the heck is going on?  Its not a hidden or
>> system file, as far as I can tell its just a file sitting there like
>> normal.  Why can't lc see it?  (why can't the LC shell see it for that
>> matter)
>>
>> On Sat, Dec 24, 2016 at 9:49 AM, Richmond Mathewson <
>> [hidden email]> wrote:
>>
>>> Sorry: late to the party!
>>>
>>> A rawKeyDown message IS recieved even IF the mouse is NOT in the LiveCode
>>> window, BUT
>>> the LiveCode window MUST be the front window.
>>>
>>> A rawKeyDown message won't be recieved IF the mouse is NOT in the
>>> LiveCode windows if
>>> it comes from a mouse button, scrollwheel or track ball.
>>>
>>> The micro trackball on the top of my Macintosh mouse sends these
>>> rawKeydowns:
>>>
>>> Left: 65310 . . . . . . Left Arrow Key: 65361
>>>
>>> Right: 65311 . . . . . . Right Arrow Key: 65363
>>>
>>> Forward: 65308 . . . . . . Up Arrow Key: 65362
>>>
>>> Back: 65309 . . . . . .Down Arrow Key 65364
>>>
>>> Richmond.
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Terry Vogelaar
In reply to this post by Terry Vogelaar
A lot of responses to my question; thank you all for that. I use the digest, so sometimes it takes a while before I respond.

Richard's suggestion to keep the LC window in front is not what I want. It needs to run in the background because it is for a productivity & RSI-prevention app. The whole idea is that I do other work in-between and I get warnings and suggestions when it is time for a break.

Mike's idea to periodically check some Windows log file is hard for me to implement because I am on a Mac.

So it starts to become clear that it might not be possible to do what I want. Although I hope to be wrong about that.



With kind regards,
Terry Vogelaar


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Detect scroll activity (when LC is not frontmost)

Mike Bonner
Hmm.  Theres probably a way to do it on mac.  If I get lucky I'll let you
know.

On Sun, Dec 25, 2016 at 8:05 AM, Terry Vogelaar <[hidden email]>
wrote:

> A lot of responses to my question; thank you all for that. I use the
> digest, so sometimes it takes a while before I respond.
>
> Richard's suggestion to keep the LC window in front is not what I want. It
> needs to run in the background because it is for a productivity &
> RSI-prevention app. The whole idea is that I do other work in-between and I
> get warnings and suggestions when it is time for a break.
>
> Mike's idea to periodically check some Windows log file is hard for me to
> implement because I am on a Mac.
>
> So it starts to become clear that it might not be possible to do what I
> want. Although I hope to be wrong about that.
>
>
>
> With kind regards,
> Terry Vogelaar
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12