Allow for mouse movement in only one direction

I want to make it so that the cursor only moves in the X direction, but maintains a consistent Y position. Here is my code in a custom code element:

In “Begin Routine”:
mousePicCont = event.Mouse(visible = True, win = win)

And then in “Each Frame”:
mousePicCont.setPos(newPos = [mousePicCont.getPos()[0], -.2])

I would have assumed, since it’s updating each frame, this would dynamically get the X position of the mouse as it moves, but keep it in a Y position of -.2. But instead, it simply grabs the mouse’s X position from when the routine begins, and then is stuck there.

Is there a way to just set the Y position? Or a way to dynamically update the X position while keeping the Y position constant?