counting keystrokes

sims sims at ezpzapps.com
Tue Apr 26 00:47:24 EDT 2005


Thanks for the reply Jacque,

The issue is that the keystrokes *are* passed to my application even when
Rev is *not* in front BUT this only occurs on OS X. I need to be able to count
keystrokes on Windows machines also.  [This is for an application 
which provides
therapy and prevention for musculoskeletal problems caused by sitting at the
computer and working for too many hours without a break. ]

On the PC side I have only tested on XP (two different machines so 
far, thanks Klaus)
and the script shown below is only working on Macs right now. I need 
to count keystrokes
on PCs also.

ciao,
sims



At 9:50 PM -0500 4/25/05, J. Landman Gay wrote:
>The repeat loop might be hogging the cpu and could cause problems. 
>I'd suggest something like this if you were using only Rev:
>
>global tCount
>
>on rawKeyDown
>  add 1 to tCount
>  pass rawKeyDown
>end rawKeyDown
>
>But I'm not sure the keypresses would be passed to Rev if it weren't 
>in front. I suppose you've already tried it.


On 4/25/05 1:18 PM, sims wrote:

>I am using  Rev 2.5.1 on Mac OS X to count keystrokes that are typed
>in any application that I have running - it keeps a running total of how many
>keys I hit no matter what applications I use (MS Word, Eudora, etc.).
>
>I use one btn with the script shown below and one fld which I lock so
>I don't accidently place text in it and mess up my count.
>
>When I try this same Rev file on Windows XP it doesn't work.
>Can anyone tell me what I might have to do to get this to work
>(keep a running total of the number of keys hit) on Windows?
>
>Thanks in advance,
>sims
>----------------------------
>
>on mouseUp
>   busyHands
>           send "mouseUp" to me in 200 millisecs
>end mouseUp
>
>
>on busyHands
>   repeat
>     put the  KeysDown  into tKeys
>     if the KeysDown is not empty then
>       add 1 to fld "strokesClicks"
>       exit busyHands
>     end if
>     wait 10 millisecs with messages
>     if the optionKey is down then exit repeat
>   end repeat
>end busyHands





More information about the use-livecode mailing list