Right click screen showing constantly during experiment

I am using Windows 11 Psychopy v2024.1.5.

My study is all working find but when going through the experiment the first trial is a blank screen but the sound is audible. Then it goes on to the next trial but with a grey menu for adding in a new routine (i.e., it names new and a list of all the routines within the experiment). I have tried:
import pyglet
from pyglet.window import mouse

def disable_right_click(window):
def on_mouse_press(x, y, button, modifiers):
if button == mouse.RIGHT:
return pyglet.event.EVENT_HANDLED


but that doesn’t work. I am using builder and that is just a bit of code in python.

Any help would be appreciated.