Re: counting keystrokes
Sims, The keymap was originally a Macintosh toolbox data structure that sat in low-memory, specifying which keys were currently down. It was intended primarily to let the front-most app see if the user had multiple keys down simultaneously (e.g. ctrl-option-shift-delete), but like others before you, you've found that it's also possible to check for keys down from other than the front-most app. Two comments: 1) It's possible that RunRev is merely simulating the Mac effect for Windows, by providing a keymap function that only works when RunRev is frontmost. If this is the case, then your app will never see other app keystrokes on Windows. 2) I assume you realize that there's no guarantee that you'll see all keystrokes, even with your Mac version? By calling wait 10 millisecs with messages you're assuming first, that keystrokes don't happen any faster than 10 milliseconds, and second, that your app will be given a time-slice every 10 milliseconds...either of these might be incorrect, resulting in lost keystrokes (though possibly not enough to matter). Regards, -- Frank Web Photos Pro: Software for Photo Bloggers and Other Photo Power Users See us on the web at http://www.webphotospro.com/ On Apr 26, 2005, at 8:07 AM, [EMAIL PROTECTED] wrote: From: sims [EMAIL PROTECTED] Subject: Re: counting keystrokes To: How to use Revolution use-revolution@lists.runrev.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii ; format=flowed What if you make the window a systemWindow so that it is always at the front? Interesting idea...and if I don't want that window to show I could hide it somehow. I'll give that a try, thanks. Actually, I am surprised that it works in any system. I would have assumed that keystrokes only got passed to the front application no matter what OS you were using :-) Surprised me also...but it works on OS X, at least with all the non-Rev apps I have and that includes Word. ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: counting keystrokes
At 10:19 AM +0100 4/26/05, Frank Leahy wrote: 1) It's possible that RunRev is merely simulating the Mac effect for Windows, by providing a keymap function that only works when RunRev is frontmost. If this is the case, then your app will never see other app keystrokes on Windows. 2) I assume you realize that there's no guarantee that you'll see all keystrokes, even with your Mac version? By calling wait 10 millisecs with messages you're assuming first, that keystrokes don't happen any faster than 10 milliseconds, and second, that your app will be given a time-slice every 10 milliseconds...either of these might be incorrect, resulting in lost keystrokes (though possibly not enough to matter). Thanks for this interesting information Frank. I'm beginning to think that I'll need a dll or some sort of 'extra' bit to help me. I'm using a combination of time keystrokes and an exact count is not critical but your point is well taken. ciao, sims ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: counting keystrokes
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 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. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: counting keystrokes
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 ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: counting keystrokes
What if you make the window a systemWindow so that it is always at the front? Actually, I am surprised that it works in any system. I would have assumed that keystrokes only got passed to the front application no matter what OS you were using :-) Sarah On 26 Apr 2005, at 2:48 PM, sims wrote: 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. ] ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: counting keystrokes
What if you make the window a systemWindow so that it is always at the front? Interesting idea...and if I don't want that window to show I could hide it somehow. I'll give that a try, thanks. Actually, I am surprised that it works in any system. I would have assumed that keystrokes only got passed to the front application no matter what OS you were using :-) Surprised me also...but it works on OS X, at least with all the non-Rev apps I have and that includes Word. ciao, sims ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution