Skip to main content

Test of flash keypresses

I've written a quick test of key presses and mouse clicks in flash -- does your computer lose any?

We were doing some final (?) testing of my tempo-detection flash game on my mother's computer, but discovered that the computer was failing to detect some key presses. After a bit more testing, I decided it was unlikely that it was a hardware problem. So either my Mom's version of flash can lose some keypresses, or there's something wrong with my program.

I made a simple test that just prints out info for each key press or mouse click. It's mainly so that we can test it on my mother's computer, but I'm including it here in case anybody else feels like being nice and wouldn't mind testing it a bit. :)

The object: tap a key a set number of times. Check if the computer has detected the right number. You could do this by picking a number like 20 and just start tapping... or you could pick a rhythm-saying (like "shave and a haircut, two bits" -- that's 7 taps) and repeating that a few times.

If you discover that the computer's count of the taps doesn't match what you think you did, I'd really like to hear about this. It's possible that something's just wonky on my mom's computer, and that I don't need to scrap this whole research project. However, it's also possible that a typical flash installation doesn't reliably detect key presses. This would cause great problems for me, of course, but knowing about the problem would be better than not knowing about it.

If you discover some missing key presses, please try it with the mouse -- if the mouse is more reliable than the keyboard, I can still go ahead with this (albeit with a few changes).


PS: I'm not finding any blog or forum posts complaining about the reliability of key events in flash, so it might be something weird in my game after all. The real test is to find out if this simple test works on a computer that couldn't handle the actual game, of course.


Later edit: Apparently the keys are reliable when I compile my project for flash 10 instead of flash 9. Maybe the additional optimizations in 10 help? Anyway, things seem to be working now.