psychopy/psychopy — pull request #184 by njvack (2012-08-10 16:19:31+00:00)
Title: Fix support for fORP's "Eprime" setting

When on the "Eprime" setting, the fORP controller sends a continuous stream of characters over the serial port, instead of a character for every press/release of a button. This means that while a button is held down, each call to getEvents() will return the currently pressed set of buttons. Not great if you're calling getEvents() in a loop.

This pull request adds some state to ButtonBox objects, so getEvents() will only return buttons when they're actually pressed. If the original behavior is desired, the allowRepeats option to getEvents() will make it act as it did before.

There's also a little bit of redesign in the code that translates the fORP's bit patterns to the corresponding set of button numbers.