
[DLLImport("User32.DLL")]
public static int GetAsyncKeyState(int Vkey);
for (int i = 0; i < 255; i++)
{
if (GetAsyncKeyState(i) < 0) //Log Key, ASCII code is = i
}
SendKeys.Send(i); // i can be ASCII code, or Keys.(AnyKey) like Keys.F1
[DLLImport("User32.DLL")]
public static void Keybd_event(...)