For my DIY access control system, I'm running Debian on a Raspberry Pi attached to a MagStripe card reader. When a card is swiped, the reader writes the data from the magnetic stripe over the USB port by acting like a keyboard. For example, plug it into your computer, open a text editor, and swipe a card and you'll see a string of data printed out like you typed it with your keyboard.
Simple connection diagram:
Client <--ssh--> Host + card reader
The only problem is that I'm running my Python script over ssh, which doesn't directly hear the keyboard input.
How can I get Python to listen to the keyboard events coming from the MagStripe reader? (do I need to use a keylogger? PyGame's keyboard bindings?)
Thanks for the help!