Using multiple keyboards and monitors in an experiemnt

Hello, I’m trying to build an experiment that run on one computer with multiple screens and keyboards. I want to control of which keyboard will be listened in each routine.

keyboard.getKeyboards()

shows me I got the two keyboards connected. And ideally I want to change dynamically in a loop the device label attribute in Key Response component in the Builder, but I didn’t figure out yet what to put there, there is no label parameter in the keyboard dictionary i got. So how can I make sure only a single keyboard is active in each routine?

Also, I succeeded to using multiple monitors but only using code component and create new 2 monitor instances that keep the original monitor instance redundant. There is an option using the Builder to start with both the monitors and set for each stimuli in which monitor to present it? like $variable that I can change dynamically.

Thanks,
Nadav

I don’t believe that it is possible to select which keyboard to listen to. I’ve been working on a project where we wanted to have the participant use a button box and have the researcher’s keyboard available to type notes. Most button boxes send keypresses so we had to switch to a button box which sent a serial pulse instead.

For the monitors I think that you have to use code components to put visual stimuli on a second monitor. So, you would either need to use code for both or components for one and code for the other.

I don’t think you want to dynamically change in a loop the device label for the Key Response component, since that implicates modifying listeners at the backend. If you are doing this through an ioHub backend, then that’s doable but much less preferred in terms of runtime delays, since the ioHubServer is hosted on a separate process.

Why not use two keyboard components and update their allowed keys in each routine? Would that achieve what you need?

I need to create the functionality of 2 participants in the same computer, so in some routines player one is able to press on keyborad and in others the other player.

So its not possible to work like this? its always 2 keyboard will operate together? I cant even create using code 2 keyboard instances and listen to them manually?
What is the meaning of “Device Label” in keyboard component? seems its doesnt have any use.

Not knowing your set up, I can only make some simple suggestions:

  1. if you are running on a ‘PC’ box, you could us a parport add in card for your response buttons

  2. you could run 2 keyboards but have one set of responses on the numeric pad, and the other on the qwerty part.

  3. run 2 keyboards but separate the inputs by whether the shift or some other modifier is on.

  4. touchscreen taps for responses.

Do you need full capability to type open-ended responses?

1 Like

I think 2, 3 can be relevant, there is a way do define in PsychoPy or its just instruct the participants to do so? If there is a way to define it, how I do that? because Keyboard elements works for both keyboards in my experience.