p90x

Barcode Scan Detection

5 posts in this topic

I have and application that is running and is can recognize 2d barcodes. So even when the app is not the top focus application it will become the top app as soon as the scan happens. My problem is when the app is not top  focus and someone scans a 1D barcode the app does not respond. Any ideas on maybe solving this>?

Share this post


Link to post
Share on other sites



@p90x welcome to the forum. Are these applications written in AutoIt? If so, how about posting the code? Otherwise, you're asking us to first guess at what you're trying to do and then help you troubleshoot. Help us help you ;)

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I've had to deal with a similar issue where I work. I wrote a little script that listens for a HotKey that would be "typed" by the barcode scanner. The barcode scanner you have seems to be like mine in that it basically emulates keyboard entry, at least for 1D. The 1D scanner I have will only scan a barcode if it is 3 characters or longer, so I printed out a barcode that typed /// when scanned. My script, upon seeing /// being "typed", would activate the window I needed scan into.

HotKeySet("/", "Command")

While 1
    Sleep(100)
WEnd

Func Command()
WinActivate ("WindowToScanInto")
ControlFocus ( "WindowToScanInto", "", CertainControlID )
;Uncomment the above line if you need to activate a particular control.
EndFunc

 

1 person likes this

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Theultrahead  Thanks so much. Let me give this a try.

This is the format of the barcode that I'm scanning:

\`0100361553364651\`

How do I mod your code, Sorry I just started using autoIT for the first time when I posted the original message.

 

Edited by p90x

Share this post


Link to post
Share on other sites

I've had to deal with a similar issue where I work. I wrote a little script that listens for a HotKey that would be "typed" by the barcode scanner. The barcode scanner you have seems to be like mine in that it basically emulates keyboard entry, at least for 1D. The 1D scanner I have will only scan a barcode if it is 3 characters or longer, so I printed out a barcode that typed /// when scanned. My script, upon seeing /// being "typed", would activate the window I needed scan into.

HotKeySet("/", "Command")

While 1
    Sleep(100)
WEnd

Func Command()
WinActivate ("WindowToScanInto")
ControlFocus ( "WindowToScanInto", "", CertainControlID )
;Uncomment the above line if you need to activate a particular control.
EndFunc

 

Theultrahead  Thanks so much. Let me give this a try.

This is the format of the barcode that I'm scanning:

\`0100361553364651\`

How do I mod your code, Sorry I just started using autoIT for the first time when I posted the original message.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now