Do the employees have to click on a form field before swiping their badge, etc?
Or maybe there's something like the RFID reader sending an unusual keycode that an event handler in the browser can wait for?
Do the employees have to click on a form field before swiping their badge, etc?
Or maybe there's something like the RFID reader sending an unusual keycode that an event handler in the browser can wait for?
Some of the original Yubikeys worked this way, and there are some barcode scanners out there that emulate keyboards too. I've seen some web based implementations go to great lengths to hide this fact.
I'd certainly prefer something like un-typeable keycodes to listen for as start/end markers.
Presumably you know the length of the string generated by the barcode reader, so you just set the max length of the text field to that length, and/or ignore anything longer via JS.
When I tap the ID card, it would just blurt out my uni ID number in whichever field had the focus.
I'm not affiliated with this project but built a few variations of the same thing several years ago.
Essentially, yes, you can configure these scanners in a keyboard mode such that they type the student id with a return. Just set up a simple form with focus on a text field, and reset after each submission.
One iteration I worked on used some other groups web form that wasn't design with this case. I just set up my Pis to automatically launch Firefox on boot, and wrote user script to browse the site and launch the form.
This was all built into the image so if anything ever went wrong, just write the image to a new SD card and reboot.
You can set up the scanners as to scan cards passively as well, but (the way I did it anyways) they won't decode the id when configured this way. Or maybe it was just more fun to reverse engineer it.
This may be true for RFID scanners, as well.
They emulate a keyboard and some have pass-through ports, for PS/2 keyboard interfaces.
For more ‘custom’ solutions, some also have serial interfaces, so they can be programmatically controlled to scan and read based on the logic you implement.