Custom Mouse using Builder

PsychoPy version: 2022.2.5 Py 3.8
Standard Standalone Installation? Y
Do you want it to also run online? N
What are you trying to achieve?: My cursor is difficult to see on my stimulus background and I just really want to make the mouse a different color or shape. The issue is I can’t lose the builder version of the experiment so I want to implement this in code snippets, but I just can’t figure out when and where to add these components.

What did you try to make it work?: I have tried adding the custom mouse class into code snippets in the builder in the “Before Experiment” but I just can’t figure out how to tell psychopy that the custom mouse I define should replace the mouse component during the routine.

Link to the most relevant existing thread you have found: See bottom of this topic.

What specifically went wrong when you tried that?:
I really need to figure out how to implement this in code snippets in the builder so that I don’t lose the graphical interface.

I’ve previously written an experiment where I hid the mouse cursor and then had an image of a mouse cursor tied to the mouse position (in my case slightly rotated so hand movements didn’t match mouse movements).

Thanks for your reply! How would I go about doing that?

Have a look at my mouse tracking online demo. I’ve also attached a small mouse pointer image. I hide the mouse with document.body.style.cursor=‘none’; and have the following Each Frame code:

[realmousex,realmousey] = mouse.getPos()
mousex = realmousex+7
mousey = realmousey-11
if mouse.isPressedIn(target_dot):
    continueRoutine = False

Where the mouse pointer is set to location [mousex,mousey] each frame. I think in a later version of this I just added transparent background to the mouse pointer image to put the point in the centre so I didn’t need to offset the image.

Mouse_pointer_small