Hello.
I just want to add that StefanK has made an alternative version that I find easier to use since you can specify the keys you want to listen to on the command line, and gets a true result if that condition of the keys were true at that moment. I’m not saying that the one is better than the other, just that there is an alternative. The version you describe is the obvious choice when listening for function keys. But can you get out which function key was pressed?
[code]checkModifierKeys(1) BSD General Commands Manual checkModifierKeys(1)
NAME
checkModifierKeys, – Modifier Key listener for the Mac Os X
SYNOPSIS
checkModifierKeys, [shift | cmd | control | option | capslock]
DESCRIPTION
checkModifierKeys, Returns “1” to standard output if one of or more of
the modifierkeys in the argumentlist were held down under execution or
“0” if not.
AUTHOR
Stefan Klieme
Darwin July 22, 2010 Darwin[/code]
You can download StefanK’s checkModifierKeys from here