My own productivity app
Mike Bonner
bonnmike at gmail.com
Tue Nov 29 15:35:52 EST 2016
The only way I know of to monitor keystrokes/mouse events is with a loop.
Check to see if keysdown() is empty, and "if the mouse is down." Certain
things won't trigger the mouse is down such as grabbing a title bar and
dragging it around (on windows) but most other clicks will work fine.
For a simple test, I made a stack with a field and a button. the following
code is in the button.
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
if the keysdown is not empty then
put keysdown() into field 1
else
put empty into field 1
end if
if the mouse is down then
set the backgroundcolor of field 1 to red
else
set the backgroundcolor of field 1 to empty
end if
send loopit to me in 100 millisec
end if
end loopit
Placing the window where its visible but not focused and work with another
program. Every click the field turns red, every keypress and the keys that
are down show up in the field. With a delay of 100 seconds its possible to
miss an event, but if a person were actually working actively most
keypresses and clicks will be caught. It should be possible to use either
applescript or vbscript to note what window is focused, though im not sure
how to tell if one is working in a facebook tab or not.
On Tue, Nov 29, 2016 at 1:14 PM, J. Landman Gay <jacque at hyperactivesw.com>
wrote:
> On 11/28/16 9:29 PM, Terry Vogelaar wrote:
> <snippage>
>
>> All of them help users to have productive time and leisure time. But
>> if I would run all three, there would be no agreement between them
>> when I should have my break.
>>
>> The latter app made me realise I could create my own. Any programmer
>> could make that. But ideally I would want to integrate what makes the
>> other two apps great. I want the activity detection that MacBreakZ
>> has and the distraction-restriction (hey)Focus offers. Would an app
>> made in LiveCode be able to do that? If so, how?
>>
>
> The problem I see here is that LC has no knowledge of what other apps are
> in use, and provides no feedback when it isn't the frontmost app. There may
> be shell calls you could use to get some of the information, but I kind of
> doubt there's a way to monitor keystrokes and that sort of thing.
>
> --
> Jacqueline Landman Gay | jacque at hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
>
> _______________________________________________
> 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