Cannot clearing the key buffer in EEG experiment

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Ubuntu 20.04
PsychoPy version (e.g. 1.84.x): 2022.2.4
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?:

I am trying just to control through feedback text that triggers in an EEG experiment are sent correctly. I have created some text word, showing the key of corrected response, the key which has been actually pressed and a no response message. I have used the following code to do this:

What did you try to make it work?:

actualkey = respo.keys
ccc = ''
if responded == 1 and respo.corr == 1:
   ccc = 'corr'
   port.writeRegister(FIO1,65280+ int(block_nr)+4)
elif responded == 1 and respo.corr == 0:        
    ccc = 'inco'
    port.writeRegister(FIO1,65280+ int(block_nr)+5)         
elif responded == 0:     
    ccc = 'noresp'
    port.writeRegister(FIO1,65280+ int(block_nr)+6)

What specifically went wrong when you tried that?:

Anyway, if I press either left or right key and then, in the subsequent trial I provide no response, that response key is saved. How could it be possible to fix it? Thanks for responding
Include pasted full error message if possible. “That didn’t work” is not enough information.

There is a checkbox “discard previous” in a keyboard component. Have you checked this?

Hello, thanks for replying. I will try this way, but as far as I remembred that item was already thicked. I f you might suggest some solution consisting in some code edits, please feel free to recommend it.

As with your other post it’s hard to give recommendations on your code if you don’t show the whole context of it. For example, how is the responded variable defined?

Nonetheless, I don’t really think it’s an issue with code, because as far as I can see you are not doing anything to change the saved key, right?

Hello, thanks for your response. Could you please tell me if you would set something differently?

Probably that ‘Store’ set on fiirst key?

This looks correct.

So does this might depend on something else?

Could you upload your experiment so I can have a look myself?