Keystrokes Running in Background

Nonsanity form at nonsanity.com
Mon Feb 21 13:49:54 EST 2011


I needed to do the same thing for a LC tool I use. The only way I found to
work it was by polling. This means that the script may miss the keypress if
it is too short.

-- poll for control-enter keypress
on KeyMonitor
   get "," & the keysDown & ","
   if ",65507," is in it and ",65293," is in it and the hilight of btn
"Active" is true then
      -- do stuff here
   end if
   if KeyMonitor is not in the pendingmessages then send KeyMonitor to me in
10 ticks
end KeyMonitor

I wouldn't want to use this for a program you plan to distribute, but for my
own purposes - where I know about the sample rate and will remember to hold
the keys down for a moment - it works fine.


 ~ Chris Innanen
 ~ Nonsanity



On Mon, Feb 21, 2011 at 11:16 AM, Ray Horsley <ray at linkit.com> wrote:

> Anybody know of a way to trap for keystrokes when a standalone is running
> as
> a service.  I'm using Fire Daemon on Windows 7.  I'm trying to write a
> simple app which launches programs on pre-defined keystrokes.
>
>
>
> Thanks,
>
>
>
> Ray Horsley
>
> LinkIt! Software
>
>
>
> _______________________________________________
> 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