LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine which USB input created "Key Down?"

Highlighted

 have a barcode scanner that connects to my computer as HID keyboard device.

 

How can I isolate my scanner so that it triggers a different "Key Down?" event case from when my Laptop Keyboard generates a "Key Down?" 

 

Right now, I have this:

BarcodeScanerChecker.png

 

However, this is lossy as shown below:

 

barcodefp.PNG

 

How can I go about this properly?

 

0 Kudos
Message 1 of 5
(767 Views)

This is a difficult task if not impossible. What are you trying to achieve? Get bar code input while you are manually writing in a String control?

Paolo
-------------------
LV 7.1, 2011, 2017, 2019
0 Kudos
Message 2 of 5
(703 Views)

@pincpanter wrote:

This is a difficult task if not impossible. What are you trying to achieve? Get bar code input while you are manually writing in a String control?


I want to create a text box that only the barcode scanner can write to. I want a situation where the user must scan their ID badge, but still enters their password with a keyboard. If there's a way to disable the keyboard until a badge is scanned that would work too.

0 Kudos
Message 3 of 5
(697 Views)

Try something like the attached vi. The receiving Scancode control should be visible and enabled but outside the visible part of the Front Panel.

Remark that I had to set Scancode as Update Value while Typing in order to get the new value in the Value Change event.

Once you validated the received scan code ("ok" in my example, try typing this string manually), you can enable the Password control and give focus to it.

This code is not fool proof because the user may still write into the Scancode control even if not in sight. You may prevent this case either by scan code validation (best way) or using a method based on character input speed I suggested some years ago, see this thread.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019
0 Kudos
Message 4 of 5
(692 Views)

I think catching\polling key down is a dead track.

 

I'd check if the scanner has a virtual serial port. Then use that to communicate. Not sure how the scanner can be disabled as a keyboard, that is probably device dependent (in other words: check the manual).

Message 5 of 5
(668 Views)