Sending key events to background script

Hi,

short summary:
I need to send keystrokes from USB keyboard to background (bash-)script. I guess I have to use read on the right devive board but how and which?

My details:

I got a small home server with some VMs using KVM/Qemu, all are suse 11.3. But in general I work on a client using a keyboard switch. Additionally, I have a scanner (HP Officejet 6500).

Now I want to send scans into a VM. I did not get the scan button to work but I want to achieve a similar solution. I bought a numerical keyboard with USB connector, connected it to the server and fowarded the port into the target VM.
Next there should be a background process listening to that kayboard and running a variety of scanimage scripts when the numbers are pressed.

I found the keyboard device under /dev/input/by-id/... and probably also under /dev/bus/usb/001/00[1-4]. Unfortunately, the output looks very "raw". I guess there must be an other device to connect to?

Thank you for your help,
Snowman