"So it seems the system puts a time delay between putting the key code byte sequences in the internal buffer." - tinkeringdude
I think this is due to the web interface. If I press two function keys together on my local build I sometimes see them concatenated:
1b5b31387e
1b5b31387e
1b5b31377e1b5b31
387e
1b5b31377e
"This is just code pasted verbatim (sans line numbers) from this tutorial:"
Thanks! I was on that site a while back when checking out ncurses. I couldn't get a lot of the examples to run, which was discouraging, but I was probably doing something wrong. I couldn't get a good enough feel for ncurses to want to use it, it seems really ancient, like a pile of hacks on top of a hack. And I couldn't tell if it was really, genuinely, truly, airtight, guaranteed, cross-platform. And it takes over the screen, which I didn't want at all. Like all this GUI stuff, you have no idea where you'll finally end up after putting in a lot of time learning how they demand you do things, or even if it's right (or worse, wrong) for your project. And what if after all that it works fine in Win32 but is somehow slightly busted / less than ideal in Linux (or vice versa)?
"Have you tried running that program on you machine as-is?"
Yes. I think the problem is what the OS is doing with the keyboard port in between reads, when the mode is switched back. If you have a tight loop like in the toycode then it spends the vast majority of its time in read mode and doesn't seem to act up. In that scenario, could the mode switching itself be optimized out by the compiler?