psychopy.org | Reference | Downloads | Github

Two unique keyboard inputs

Hi Folks,

I am in the process of making a multiplayer game in PsychoPy. It’s going well. I have assigned unique keys to each player. The computer running the task will have two keyboards connected to it. I wanted to ensure that player 1 could not accidentally press (and submit) unique keys for player 2. I’ve looked deep into the code, and found that under ioHubKeyboardDevice, it says "Only one keyboard device is supported in an experiment at this time … ".

Is this still the case? I guess at the end of the day I just need unique keys and inputs (i.e., unique keyboards) for each player.

Kind Regards,
David.

Hi David, what version of PsychoPy are you using? From 3.1 onwards I think, the new Keyboard class allows you to distinguish between physical keyboards, on Mac and Linux at least:

https://www.psychopy.org/api/hardware/keyboard.html

i.e. this is the default PsychoPy class, not the ioHub one.

Thanks Michael. I am running the latest version (3.1.5). How did you navigate to that webpage? I can’t find keyboard’ listed under https://www.psychopy.org/api/hardware.html

Looks like the new keyboard implementation is exactly what I am after!

Just an update that on Windows the keyboards are not unique. Looks like I will have to look for alternative solutions. Thanks again Michael.

Yes, as noted in the docs, this works only on Mac and Linux. i.e. this is a limitation of the Windows operating system, and not something that PsychoPy or any other software can get around.