Shell Getting Raw Key Events

Hey gang, I am interested in writing a daemon that watches for raw key events so I can detect the F-keys on the console and launch actions. So far the closest thing I found is something like usbdump -i usbus2 -v. I think I can make it work from that, but this seems a bit ugly.

Curious if you are aware of any better way inside base system (ie, no ports) in order to watch for raw keyboard events?

Also, to clarify, I was looking at snooping the USB events because this should work regardless of whether there is a user logged in, what program is running on the console, etc
Ahh, interesting stuff! It is really a shame this usbhidaction cannot somehow be made to work with regular keyboard keys, because it is designed to launch a program when the key is detected and that is exactly what I am hoping to accomplish!

Actually hmm, there are events for the keyboard F-keys in /usr/share/misc/usb_hid_usages... So maybe this could work?

I think somehow would have to prevent ukbd from attaching to keyboard so it gets picked up by uhid driver instead. And then it could not be used as regular keyboard, but possibly you could use the F-keys with usbhidaction.