Choose the correct input model
| Keyboard wedge / USB HID | Appears as keystrokes; focus, prefix/suffix and human typing must be distinguished. |
|---|---|
| Serial / virtual COM | Requires port settings, buffering and explicit frame completion. |
| Vendor SDK/API | Requires compatible drivers, DLLs, callbacks and deployment assets. |
A keyboard-wedge scanner is easy to demonstrate but fragile when a dialog steals focus. A serial or SDK integration can provide stronger device identity and framing, but adds dependencies and lifecycle code.
Avoid missed and duplicate scans
- Configure and document symbologies, prefix, suffix and terminator behavior.
- Accumulate input until a complete scan, then process it once.
- Separate scan events from UI navigation or validation side effects.
- Validate permitted length/content and check digits when the symbology or business rule supports them.
- Log timestamp, source and normalized value without exposing sensitive payloads unnecessarily.
- Test rapid consecutive scans, partial reads, focus changes and reconnects.
Do not use a fixed inter-character delay as the only frame boundary when an explicit suffix is available. For old components, verify that the deployed DLL/package and application architecture match the working environment.
See Delphi hardware integration, COM-port troubleshooting, virtual COM integration and the Delphi pillar.