Added alternative getMousePosition function.