You could initiate the scan with by calling read() when the soft scan button in your app is pressed down. When the button is released (before a barcode is scanned) you could call cancelRead() which should stop the beam.
Some other thoughts:
- You should only need to configure the scanner once, doing so every time you scan could lead to performance issues
- The beamTimer is not used to limit the time the beam is emitted as you are doing here, though the documentation is unclear I thought it was used in some other case (e.g. continuous scanning), though somebody more knowledgeable may correct me here!
- Have you considered using Swipe Assist? Swipe Assist , it is available on TC75 and can be used to capture data almost as you describe.