Keyboard - several keys pressed simultaneously

In Python…

Something like this would tell you if > 1 press event has occurred since the last screen retrace / call to event.getKeys():

from psychopy import visual, event, core

win = visual.Window([800, 400])  # , fullscr=True, allowGUI=False)
msg = visual.TextStim(win, text="No keys pressed.")
stime = core.getTime()
while core.getTime() - stime < 5:
    key_events = event.getKeys()
    if len(key_events) > 0:
        msg.setText("%d keys were pressed at about the same time: %s"%(len(key_events), str(key_events)))
    msg.draw()
    win.flip()

You could do a similar type thing using the psychopy.hardware.keyboard.Keyboard() class as well.

If you want to know if > 1 key is being pressed down, regardless of when each key was first pressed, you could use iohub keyboard:

from psychopy import visual, iohub, core

keyboard = iohub.launchHubServer().devices.keyboard

win = visual.Window([800, 400])  # , fullscr=True, allowGUI=False)
msg = visual.TextStim(win, text="No keys pressed.")

stime = core.getTime()
while core.getTime() - stime < 5:
    pressed_keys = keyboard.state
    if len(pressed_keys) > 0:
        msg.setText("%d keys are currently pressed: %s"%(len(pressed_keys), str(pressed_keys.keys())))
    else:
        msg.setText("No keys pressed.")
    msg.draw()
    win.flip()

core.quit()