Ah, the problem that has been holding me up for almost a solid week now has been tracked down. It was a lot of sweat to discover this fact so I'm going to use very large text. It is this:
PYGLET IS NOT COMPATIBLE WITH PSYCO
I tried attaching keypress events to the window they became
unreliable. Removing the call to the psyco compiler causes them to
become reliable again.
I feel like I've wasted a week but no matter, I know there isn't some bizarre phantom bug in my code now.
if you only knew the effort I spent on this. The energy I've poured
into this. On looking at every part of my code, of creating test
situations, of slowly going between the test situations and my code
point for point and finding where the differed, of creating MORE tests.
I feel like curling up in a ball on the floor right now.
But at least the problem has been solved. In Profundis is special in
that it's not just the display that's the biggest processor cost, the
program does some heavy calculation behind the scenes. This means I
can't abandon psyco, and that means I must abandon pyglet.
So long, pyglet