[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] loss of rapidly repeated keypresses (from a barcode gun keyboard)



I am writing a pygame application that uses a USB barcode gun which
behaves as a keyboard. (AFAIK most barcode scanners behave as
keyboards)

When you scan a barcode, it rapidly types the text it reads from the barcode.

My application is listening for this keyboard input as pygame events,
and appending them to a string. This *mostly* works great.

The problem I am having is with input that has a lot of repeated
characters, such as "9999999" If such a barcode is the FIRST one I
scan, I usally only get "9" or "99" instead of the whole string. If I
have scanned other things, then I *usually* get the whole "9999999".

I am guessing that somehow pygame is throwing away key input events
because they are coming too fast and look like duplicates.

Has anybody else experienced a problem like this? Does anybody have
any ideas for workarounds or further avenues of testing?

I should note that when I use this same barcode scanner to scan the
same repetitious barcodes into a terminal, or a text editor, or a word
processor, I NEVER lose characters, so I am pretty sure this is not a
hardware issue with the scanner itself.

---
James Paige