You can apply mouse movement before launching the joystick using the Windows API:
POINT p; GetCursorPos(&p); MOUSEINPUT mi; mi.dx = (LONG) ((px * 65535) / screen_width); mi.dy = (LONG) ((py * 65535) / screen_height); mi.mouseData = 0; mi.dwFlags = type | MOUSEEVENTF_ABSOLUTE; mi.time = 0; mi.dwExtraInfo = NULL; INPUT input; input.type = INPUT_MOUSE; input.mi = mi; SendInput(1, &input, sizeof(INPUT));
source share