That idea of timer resetting a textbox value is by no means safe anyway.
Scanners allow configuring a preamble, which could be, say, CTRL+F3 or any nonprintable hotkey combination. If your textbox expects that as input and only "unlocks" once that's given users would need to be inventive and use some app checking what a scanner enters including nonprintable characters to emulate that, but even if you know there is a preamble of CTRL+F3 (just as an example, use whatever is possible with your scanners) there is no way to put hotkeys like that into the _clipboard and paste them.
Otherwise, as atlopes Simulator.click shows, people can first input the barcode in a notepad and then copy&paste it into the barcode textbox.
People usually don't manually enter barcodes they could also scan, either they only do so having no scanner, but in a POS system, they'd be worse off in such a situation having to always manually enter barcodes or manually type prices.
The most common situation cashiers will manually enter barcodes is, no matter if to scan a known product or register a new one, if the barcode isn't scannable.
That means - in very short - you better solve this problem with either better scanners or using another readable sample product, which is scannable. Taking away the ability for manual input in a POS system in any situation will only mean a customer will either tell the cashier to leave this product out or need to get another one, which doesn't solve the readability of the barcode and just delays the problem to another customer.
If a product is registered wrong a scan if the product will reveal that it's not found in the system and the cashier with that problem should have an easy means to add that missing product himself, problem solved just in time. All you need is to remove products with no valid (recent) sale scans from time to time.
Overall, disabling manual input just causes more lost sales than it solves errors, so in my opinion, that's a bad idea. You can trust your cashiers better than that and even if a product is registered with wrong barcode, the only effect that has is another cashier will need to register it once more and most often then it will be a sample product with a scannable barcode.
And if your shop is doing this in the hours a shop is closed as a maintenance task and people enter codes manually because they have no scanner at hand, you should solve that real-world resource problem making scanners available where needed.
So, overall, I'd say you solve a problem with software here, that has better real-world solutions. Sometimes the job of a developer is pointing out no change in the software but a change in handling a problem is the simplest and cheapest solution.
Bye, Olaf.
Olaf Doschke Software Engineering