SendInput()

Posts 1–6 of 6 · Page 1 of 1
SendInput()
Ok, so i have been googling and msdning(msdning, lol) about this function but i still don't understand it. Can somebody just post example code of how to use sendinput for let's say the shift key. i know it goes something like :

Code:
SendInput(1, VK_SHIFT, ???????)
is this correct? well, your help is appreciated.
Code:
(GetAsyncKeyState(VK_SPACE)<0)
Are you talking about that?

Like log key strides?
Here:

Code:
void LeftClix() 
{
MessageBox(NULL, "Greetings, mortal", "free", MB_SETFOREGROUND); INPUT Input={0}; Input.type = INPUT_MOUSE;

Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN; SendInput(1,&Input,sizeof(INPUT));
Input.mi.dwFlags  = MOUSEEVENTF_LEFTUP; SendInput(1,&Input,sizeof(INPUT)); 
}
happy?

Quote Originally Posted by CodingTerror View Post
Code:
(GetAsyncKeyState(VK_SPACE)<0)
Are you talking about that?

Like log key strides?
Obviously he's trying to SEND input. --"
lol, no, but thanks i just used keybd_event(); it works better than sendinput(), thanks for ur reply though. I appreciate it.
Hmmm MSDN says:

SendInput, sends synthesized input directly into the keyboard or mouse stream.

the first parameter is the number of inputs your synthesizing.
the second is an array of INPUT structs

and the last parameter is the size in bytes of an INPUT structure, which is (size of INPUT)

Freedom listed an example so I won't, but if any particular part is troubling to you please let us know.
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us