-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Keyboard check function (even if TDT is input device) #183
Comments
I would have the quit-key function and this new function both use the same underlying keyboard-checking mechanism, which would probably mean moving most of the code from the quit-key function to a private one. I can't think of a good naming scheme that makes it clear that we're talking about keyboard strokes, given that we already talk about key presses in our button-press functions (I think)... |
@rkmaddox WDYT about just allowing more than one keyboard controller to be used, and keyboard polling functions check all devices? That greatly simplifies the code (I think), and gives the experimenter flexibility about what to call a different type of event. For example, in the booth the TDT button presses 1-8 could mean one thing, and "p" could be used by the experimenter to pause. Eventually we could also pass back what keyboard device gave the event, but I'd assume YAGNI for now. |
I think that makes sense. Does that mean that 1-8 on the keyboard would also be hot? I don't see that as a major problem, I don't think. |
yeah, they would both work |
If that works for your use case, I can probably implement it fairly quickly |
It should, thanks. |
@Eric89GXL could you include in that PR a little cardboard warning sign
|
I'll let @rkmaddox add it as part of his protocol :) It will have to be enabled by any given experiment, the default (use button box only) will not change. |
The ugly thing is that calls that are simply Ross Maddox, Ph.D. On Mon, May 18, 2015 at 8:08 PM, Eric Larson [email protected]
|
Yeah, I think putting users of the fancy functionality through a bit more pain / explicitness in their code is an acceptable side effect :) |
Much like we have a quit key that is for the experimenter's use, it would be good to extend that functionality to an arbitrary key or set of keys and return a logical (rather than throw an error) if it had been pressed. This would allow for things like pausing the experiment by the experimenter.
Is the best way to do this to define a general "was key pressed" private function, then have the quit key checking function use that and make a new function that returns a logical?
The text was updated successfully, but these errors were encountered: