필터 지우기
필터 지우기

How to differentiate the Input from a Barcode reader and the keyboard?

조회 수: 20 (최근 30일)
Sergii Snegir
Sergii Snegir 2022년 10월 18일
답변: Federico 2024년 5월 19일
Dear all,
can anyone propose a strategy how to deferentiate a keyboard input from the barcode reader. The reader in Windows acts like a keyboard in principle.
The idear behaind is the following: In the writen program there several input fields. A data from the scanner has to be added ONLY in defined input field while in others from the keyboard. Now it works wrong, since the data from the scanner (when operator clicks on the scanner) goes in the field where the last input was (a last position of a cursor).
I woudl be very grateful for any Idears how to make this deferentiation!
Thanks

답변 (2개)

ag
ag 2023년 9월 13일
Hi Sergii,
I understand that you need to distinguish between input from a barcode reader and a keyboard, which will allow you to update the required fields accordingly.
To achieve this, you can configure your barcode scanner to include an untypeable prefix to the scanned text. By checking for the presence of this prefix in the input text, you can determine whether it originated from the keyboard or the barcode scanner.
An ‘untypeable prefix can be any text or symbol which has very less probability of being manually typed using the keyboard.
Hope this helps! 
Best Regards, Aryan Gupta

Federico
Federico 2024년 5월 19일
I could differentiate keyboard input from barcode input verifying the frequence of typed keys: when I found more than 4 (or any number you like) keys typed within a delay of 100 msecs (or the delay you like) I know I am receiving input from barcode, otherwise from the keyboard.
Hope this helps!
Federico

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by