Capturing key presses

Hello all,

A while ago I was messing around with Konfabulator (great util btw), I had a little widget, and all it would do would be to intercept a key press (say control F3) and then change the status of MSN Messenger. The idea being, if I hit control F1, it’d set the status to ‘online’ if I hit control F2, it’s set it to “on the phone”. You get the idea.

I was using Konfabulator, as it was sitting there intercepting the key presses, thing is, it’s a bit of overkill for a widget.

My question is this, is it possible, and if so, how, for a pure applescript (it’d obvisouly be a ‘stay open’ type script) to ‘capture’ key presses globally?

Not “pure” applescript. You may need something similar to Jon’s Commands, and it would require a repeat-infinite-loop in order to trap any key, which may be too much cpu-intensive:

repeat
	if (keys pressed) is {"Command"} then beep
end repeat