我无法理解下面的代码。我不能很好地解释它。我在我有疑问的代码段旁边留下了评论。
void LeftClick ( )
{
INPUT input = {0};
// left down
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
::SendInput(1,&input,sizeof(INPUT));
// left up
::ZeroMemory(&input,sizeof(INPUT)); // why zeroMemory? removing this code changes nothing that i can tell
input.type = INPUT_MOUSE; // why reset this variable? is it not already set?
input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
::SendInput(1,&input,sizeof(INPUT));
}