Good evening.
Can anyone point me in the correct direction of a barcode scanner for LiveCode?
The following link is one that shows where the forms of data I need to pull into the application for use in a login system: https://www.reddit.com/r/AirForce/comme ... fficiency/
But I need to translate this into LiveCode.
Barcode Scanner
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Barcode Scanner
What does :Quinton B. wrote: ↑Fri Dec 28, 2018 2:32 amCan anyone point me in the correct direction of a barcode scanner for LiveCode?
The following link is one that shows where the forms of data I need to pull into the application for use in a login system: https://www.reddit.com/r/AirForce/comme ... fficiency/
-a barcode scanner (connected to a PC via USB port for instance)
-an android terminal with an integrated barcode scanner
?
.. most of those devices... just "emulate" a "keyboard" when they read a barcode !
AKA : when you scan a barcode... a string of characters is sent to the computer, like if it was typed on its keyboard.
Therefore : Livecode can without any problem "catch" on the fly those characters and take proper action.
On PC (windows or macos) it's very easy. On your script card, use
Code: Select all
on keyDown theKey
...
end KeyDown
All barcode scanners can be programmed and the addition of a "suffix" and "prefix" is easy.
A more basic solution would be to just open a field on your LC card, and scan a barcode and then click a button.
Or : add a "CR" as "suffix" on your scanner, and then
Code: Select all
on returninfield
...
end returninfield
There are many ways actually to deal with the data sent by barcode scanner.
On Android, it's more tricky, because you need to have a focus... in a field. Unless you find a device with a special external developped for LC (but it doesnt seem to exist yet).
-
- Posts: 108
- Joined: Mon Mar 20, 2017 5:13 am
Re: Barcode Scanner
I'm primarily focused on the integrated camera in the Android phone itself, not an external source.
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Barcode Scanner
There's one for iOS but nothing for Android yet. If you're up for working with LCB then that would be the way to go, I think.
Edit: I looked at the link you posted and while it tells you what the numbers mean, it assumes an external reader that translates the image to text content. You could probably read the raw image data byte by byte and figure out how to translate the wide and narrow stripes, then use the info in the link to read the resulting numbers. (There are several different barcodes types so that link may not be accurate for the barcodes you'll be using.) That way you could do it all in LCS.
Edit: I looked at the link you posted and while it tells you what the numbers mean, it assumes an external reader that translates the image to text content. You could probably read the raw image data byte by byte and figure out how to translate the wide and narrow stripes, then use the info in the link to read the resulting numbers. (There are several different barcodes types so that link may not be accurate for the barcodes you'll be using.) That way you could do it all in LCS.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com