Disable Perspective Barcode Component

I would like to disable a barcode scanner component on a view to prevent scanning more than one barcode. I am changing the prefix and suffix to something I know the keyboard wedge will not send (‘Ignore’ for both) but this seems like a bit of a hack. Is there any other way to do this?

Altering the prefix and suffix works for this scenario, but there are others ways to approach this.

Another option would be a custom property on the component that tracks if a barcode has been scanned yes. Have the custom property initialize as 0, and then when a scan comes in, set the value to 1. Then wherever you have logic for the scan, only have that logic evaluate when the custom property is 0.

That way after the first scan the logic behind the scan will not run. This is assuming scripts are behind most of the logic related to the barcode scan.