Response devices cause frame drop on my experiment

Hi, I’m currently testing an experiment in which I present a pair of cues and a pair of target stimuli to two participants (each participant sees only one cue and target). Both cue and target stimuli are flickering at a given rate on each trial(max. 40 Hz on a 165 Hz refresh rate monitor), and participants are instructed to make a button press on a response device when the target stimulus appears.
The routines for the cue and the target are virtually identical, except that the latter has two additional components for the response devices. The flickering on both routines is controlled with the same custom code.

The problem is that the flickering becomes slightly slower during the target routine. After several debugging I noticed that this is not dependent on stimuli size (number of bits) flickering frequency or coding, but is dependent on the presence of the response device components. Furthermore, the flickering gets proportionally slower as the number of response components increases (i tried adding up to 10 components just to test this), regardless of the response decive type.

Does anyone has experienced a similar issue? I’m still uncertain of how the response devices can affect the refresh rate of the screen, so i’m pretty much stuck for the moment.

Thanks in advance