Sie könnten die SendInput-Funktion von der WINAPI (user32.dll) verwenden.
Pseudo
UINT ScrollMouse(int scroll)
{
INPUT input;
POINT pos;
GetCursorPos(&pos);
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_WHEEL;
input.mi.time = NULL; //Windows will do the timestamp
input.mi.mouseData = (DWORD)scroll; //A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is defined as WHEEL_DELTA, which is 120.
input.mi.dx = pos.x;
input.mi.dy = pos.y;
input.mi.dwExtraInfo = GetMessageExtraInfo();
return SendInput(1, &input, sizeof(INPUT));
}
In Windows oder Linux? Und welche Art von Kontrolle? –
In Fenstern. Ich muss nur das Mausrad nach unten und oben scrollen. – Papi44
Versuchen Sie zu reagieren, wenn der Benutzer das Rad scrollt? Oder möchten Sie scrollen, als ob das Rad benutzt wurde, aber wenn es nicht benutzt wurde? Die Antwortenden scheinen dich in diesem Detail anders verstanden zu haben. – Yunnosch