Don't know if this helps, but we had a similar challenge of detecting input from a barcode scanner. The scanner just "typed" in some digits really fast; some scanners end it with a control character but since it's not universal we couldn't even rely on that.
I noticed that a QEvent::KeyboardLayoutChange
would fire when the barcode scanner started its input, but I'm not sure if this applies in all the possible scenarios - but you might want to check for that.
We ended up installing an application-wide event filter (QApplication::installEventFilter
) that checks for keystrokes (QEvent::ShortcutOverride
or QEvent::KeyPress
) and based on criteria such as contiguous digit sequence, very short time interval, etc. decides that it was a barcode input. It has obvious pitfalls, but if you need a very general solution you might be interested in something similar. Also, if the RFID input always returns a control character this might simplify this approach quite a bit.