I wouldn't normally recommend simulating a mouse with a gamepad, it is very clunky for the user. A more common gamepad system will snap to points of interest, like menu buttons or interactable objects.
Otherwise if you insist, you'll just want to have an intermediate variable store the position of the simulated pointer. If using mouse/keyboard, set those variables to mouse.x, mouse.y, and set the pointer position to the variables. If using a gamepad, adjust the variable accordingly depending on the input.