I have a USB RFID reader which acts as a HID - pretending to be a keyboard. If a card/tag gets close it 'types' 01234567890\n (ie. the tag's code followed by a newline) straight into the active application, as any keyboard should.
I can capture the output from this device easily by tailing /dev/ttys000, but Mac OS X still writes those characters to the foremost application.
Is there any way to exclusively capture that tty or otherways disable the device in the UI, so that I can have my RFID reader output routed only to my scripts?
Bonus brownie points if you have code that can create the exclusive lock programatically, rather than installing additional software to route the keyboard.