log all key presses
Is it possible to log all keypresses on the keyboard? Even those which are not a specific response or occur erroneously.
E.g. participants are instructed to respond to a stimulus with a target button [f,g,h, or j] and simultaneously the SHIFT key. With the SHIFT key of the stimulus dissappears and the next stimulus is presented.
My script already logs the SHIFT presses. But how do i log the other keypresses? (This is important in order to know whether the participants followed the instructions or not.)
seq_B = [1,2,3,4,5,6] for i in range(6): #48 at the end start_time = seq_B[i].show() kb = keyboard(keylist = ['LSHIFT','RSHIFT']) key, time = kb.get_key() #wait for SHIFT key press var.Stim_time = start_time var.Resp_time = time var.Resp= key log.write_vars() #log all defined variables