You can use the scancodes for the function keys with keystate. I am at my work computer so I don't have the scancode available. I'm sure it's in a number of code snippets here. I'll try to hunt it down for you.
The only thing else you would need to do is have flags for release (keyup) and press(keydown) to prevent the program from freaking out when the key is held.
edit
Here, check out
cloggy's implementation of a keyboard monitor
"When I look at that square... I wish FPSC noobs would stay on their side of the forums and stop polluting these boards." - Benjamin