got it working. Ghidra has no idea what my code means, but it works.
Clicking and moving the mouse is properly done now, but the problem is that there's a few points where it clips the mouse to a smaller rectangle, and those rectangles are not calculated correctly now