Parsing the keyboard buffer.

Parsing the keyboard buffer.

am 18.04.2008 05:35:06 von pesobol

I am using a wedge barcode scanner to enter data in an access
database, but for certain combinations of characters I want to parse
the input in code and react accordingly. The keypress event on the
form only gives me access to the first character in the string, is
there some way to access the keyboard buffer during the keypress event
and get the rest of the string? The only way I have found to do this
is write the data to a field on the form and then parse it in the
after_update event. Is there another way?

Thanks in advance.

Re: Parsing the keyboard buffer.

am 19.04.2008 04:40:21 von deluxeinformation

On Apr 17, 10:35 pm, peso...@gmail.com wrote:
> I am using a wedge barcode scanner to enter data in an access
> database, but for certain combinations of characters I want to parse
> the input in code and react accordingly. The keypress event on the
> form only gives me access to the first character in the string, is
> there some way to access the keyboard buffer during the keypress event
> and get the rest of the string? The only way I have found to do this
> is write the data to a field on the form and then parse it in the
> after_update event. Is there another way?
>
> Thanks in advance.

Have you looked at the keydown (not keypress) and change events? Both
of these react to individually typed characters. How they would react
to entry from a barcode scanner, I don't know, but it's worth looking
into. Are you saying that you want there to be a reaction prior to
all of the barcode characters from a single barcode being read? If
not, then you're probably taking the right approach by using the
afterupdate event to parse the input (or beforeupdate if you need to
do some kind of validation before accepting the input).

Bruce

Re: Parsing the keyboard buffer.

am 19.04.2008 05:30:32 von Lyle Fairfield

pesobol@gmail.com wrote in news:65af1f53-527d-47ae-ac1c-
597aadefe16a@d45g2000hsc.googlegroups.com:

> I am using a wedge barcode scanner to enter data in an access
> database, but for certain combinations of characters I want to parse
> the input in code and react accordingly. The keypress event on the
> form only gives me access to the first character in the string, is
> there some way to access the keyboard buffer during the keypress event
> and get the rest of the string? The only way I have found to do this
> is write the data to a field on the form and then parse it in the
> after_update event. Is there another way?

The GetKeyboardState API function should captures key presses.

You can see an example at

http://www.ffdba.com/downloads/Interrupt_Loop_With_Escape_Ke y.htm

Of course, that would need considerable modification to capture and
interpret the keypresses that are significant to you.