Michel
Thu Aug 10 08:37:46 CDT 2006
Tham,
Some barcode scanner can be set with sending a control code before or/and
after the barcode. That could be a way to determine the input origin.
--
Michel Lévy
Communauté Francophone des Professionnels FoxPro
Pour un développement durable...
http://www.atoutfox.org
--
"Bernhard Sander" <fuchs@no.spam> a écrit dans le message de news:
%23KolpPGvGHA.1504@TK2MSFTNGP03.phx.gbl...
> Hi tham,
>
>> I have a PC with a barcode scanner and keyboard attached to its PS/2 plug
>> using the Y cable.
>> In my VFP8 application, I want to control the type of input method for a
>> textbox control in a form.
>> That means that I want the data to be input to a textbox control ONLY
>> from the barcode scanner, NOT from the keyboard.
>>
>> Is there a way to determine or control the input method for textbox
>> control?
>
> The barcode scanner is connected to your PC with an Y cable and simulates
> keyboard input. On first hand it is not possible to check whether the
> input comes from real keyboard or from the "simulated keyboard" of the
> scanner.
>
> I once made something like this (back in FP DOS) by checking, whether the
> keystrokes arrive within short time (coming from barcode) or within longer
> time (human mostly do not type very fast). It worked good enough for that
> special case.
>
> To really distinguish between the two input devices, you should not
> connect the barcode scanner with an Y cable but use a separate connection
> to the PC. Ask the manufacturer of your the barcode scanner.
>
> Regards
> Bernhard Sander