Watching for KeyDown in Background 
Author Message
 Watching for KeyDown in Background

I'm wanting to create some kind of background app (similar to an extension)
that watches for a key combination (i.e. Command-Shift-5). I'm considering
using either a thread or a timer that constantly polls the keyboard via an
"if keyboard.asyncKeyDown(<keycode for '5'>) and keyboard.asyncCommandKey
and keyboard.asyncShiftKey then" statement. If true, an appleevent would be
sent to my application to do its thing.

In a test I ran a while ago, Classic seems to be somewhat unreliable using a
timer, but OS X does just fine, so I may have to use a thread for Classic
and a timer for OS X.

Is this the best way to watch for something like this? If so, how much
processor time would have to be yielded?

Any advice would be appreciated.

Matheau



Tue, 04 May 2004 05:21:31 GMT  
 Watching for KeyDown in Background


Quote:
> I'm wanting to create some kind of background app (similar to an extension)
> that watches for a key combination (i.e. Command-Shift-5). I'm considering
> using either a thread or a timer that constantly polls the keyboard via an
> "if keyboard.asyncKeyDown(<keycode for '5'>) and keyboard.asyncCommandKey
> and keyboard.asyncShiftKey then" statement. If true, an appleevent would be
> sent to my application to do its thing.

> In a test I ran a while ago, Classic seems to be somewhat unreliable using a
> timer, but OS X does just fine, so I may have to use a thread for Classic
> and a timer for OS X.

I might point out that timers only count while there are no other activities
occuring. They use processor idle time only to count.

Quote:

> Is this the best way to watch for something like this? If so, how much
> processor time would have to be yielded?

> Any advice would be appreciated.

> Matheau

Regards.

------
Chris Willis



Tue, 04 May 2004 05:28:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. BLT [graph configure -background] doesn't affect axis backgrounds on my Sun

2. Keydown in Global floating window

3. KeyDown doesn't works

4. ListBox and KeyDown

5. Keydown in Windows

6. simulationg keydown!

7. arrow keys & keydown event

8. ListBox and KeyDown events

9. Keydown in the editfield

10. How Regain Java Applet KeyDown Events with VRML Browser

11. Help on reading KeyUp/KeyDown codes from KBD

12. URGENT HELP: ST/V Mac KeyDown event handling

 

 
Powered by phpBB® Forum Software