#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
#include <time.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char alphabet[27] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int letter = rand()%26;
srand((unsigned)GetTickCount());
while(!GetAsyncKeyState(VK_F8))
{
keybd_event(alphabet[letter],1,NULL,NULL);
//Uncomment the next line if it doesn't work properly:
keybd_event(alphabet[letter],1,KEYEVENTF_KEYUP,NULL);
letter = rand()%26;
Sleep(50);
}
return 0;
}