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

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





3) Reading the SDL Mailing list, I learned that event loss when the
event queue is full is already a topic of discussion for SDL1.3
I wouldn't think this is the issue you're running into, otherwise you'd lose other characters too.  It sounds like there's some debouncing code in the SDL keyboard input handler, which probably shouldn't be there...

I'm sure you've already thought of this, but you could always just open /dev/keyboard or whatever and manually post keyboard events yourself, or just use the keyboard data directly...  And you could even roll this in to a module so other people could use it too.  Might be hard to make it cross-platform though and it sucks to have to completely throw out SDL's keyboard event handling.  Also I don't know how you'd keep SDL from posting repeated events, I guess you'd just create your custom events under a different event ID and just watch for that ID instead.

4) I also discovered, while searching for a workaround, an SDL mailing
list post from Sam Lantinga last January mentioning a "simple callback
mechanism for SDL events that bypasses the event queue". Does anybody
know if there is a pygame way to make event callbacks?

I don't know, but I'd guess it would be possible with Pygame-Ctypes.  But I think Alex is no longer maintaining that module in preference to his Pyglet module.