I've once written an inventory that could be controlled with the mouse, keyboard and gamepad. When you did not use the mouse, the mouse cursor was moved manually and I called mouse_event to simulate the left click the following way:

Code:
if(jump && inv_key_released2) {
	inv_key_released2 = 0;
	SetCursorPos((int)mouse_pos.x,(int)mouse_pos.y);
	mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
	wait(1);
	mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}


That has worked without any delay, don't know if this helps you, though.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends