Velocity Scripting help - disable scan function with a single field

M Monica Llanes 3 years ago
51 0 0

Please, can someone help me. I am not a programmer.. Here is the script I have for Velocity to run on a TC70. It is for an inventory scanner.
 
//Let's create a function to process the scan
function onScan(event)
{
//Well just handle the scan data ourselves instead of letting the default mechanism handle it
Device.sendKeys(event.data);
Device.sendKeys("{hex:000D}1{pause:500}{hex:000A}");
 
//Clear the data so it does not get sent twice
event.data = "";
}
 
//Register the onScan function to be called when a scan occurs. Without this it will never run.

WLEvent.on("Scan", onScan);

 
I would like to disable the scan function on the Tran Qty field.   
 

 
Currently the functionality from the script is:
 
1. Scan item in item field
2. Enter a 1 in the Tran Qty field
3. Enter input from Qty field
4. Return to cleared Item field
 
This is working properly, however the cursor does not return to the cleared Item field quick enough, allowing accidental scans in the Item field. I was hoping if the scanner cannot function in this field we can bypass this error. Any help or suggestions would be so greatly appreciated as I cannot get anyone with Velocity to help me and we are at a very tight deadline.
 
Thanks!
Monica Llanes
Barona Resort and Casino | (619) 328-3718

CONTACT
Can’t find what you’re looking for?