views:

119

answers:

2

Hi there, sorry for this little bit strange title, didn't found a better one.. I've got the following situation:

I have a PC with an RFID reader connected via USB. I now need a program which pops up when ab transponder was scanned the the RFID reader and shows the scanned value. (The reader just simulates keystrokes) Problem: the value of the transponder is something like 0001230431, and I can't change it. (To prefix a hotkey combination or so)

So I have thought about using a global keyboard hook, check if three zeros where typed in, capture rest of data and when the 10 digits are complete, call the application through an automation object and show the number. But I'm not very exalted about using a global keyboard hook. Many AV programs don't like them very much, they are not so easy to handle with Delphi and I guess that's not very resource-friendly for such a little task...

So I'm looking for an alternative solution...maybe somebody has an idea? Big thx!

A: 

Why not make sure the Delphi app with a text edit control has focus before the scan is done? Then the keystrokes will go straight into your Delphi app.

dthorpe
I don't want to bring the application to front manually for every scan...that should be done automatically.
ben
+1  A: 

ben, you can use the RegisterRawInputDevices and GetRawInputData functions.

first you must use the RegisterRawInputDevices function to register the input device to monitor and then you can retrieves the data from the input device using the GetRawInputData function.

Check theses functions too

RRUZ
That sound interessting! I'll take a look at this, thanks!
ben