keyboard stimulation.
Hello, i use this function to stimulate keyboard to type sentences.
Code:
void Sendtext(char* strn)
{
for(int i=0; i < strlen(strn); i++)
{
INPUT Input;
ZeroMemory(&Input, sizeof(Input));
Input.type = INPUT_KEYBOARD;
Input.ki.dwFlags = KEYEVENTF_EXTENDEDKEY;
Input.ki.wVk = (UCHAR)VkKeyScan(strn[i]);
SendInput(1, &Input, sizeof(INPUT));
}
return;
}
it works but it has a problem which is that it cant type a letter two times. for example Sendtext("dazzle battle"); sends "dazle batle"