alright, grabbed that code and used the scancode parameter, too:
Code:
[DllImportAttribute("user32.dll")]
public static extern int ToAscii(int uVirtKey, int uScanCode, byte[] lpbKeyState, byte[] lpChar, int uFlags);
[DllImportAttribute("user32.dll")]
public static extern int GetKeyboardState(byte[] pbKeyState);
public static char GetAsciiCharacter(int uVirtKey, int uScanCode)
{
byte[] lpKeyState = new byte[256];
GetKeyboardState(lpKeyState);
byte[] lpChar = new byte[2];
if (ToAscii(uVirtKey, uScanCode, lpKeyState, lpChar, 0) == 1)
{
return (char)lpChar[0];
}
else
{
return new char();
}
}
oh, did i forget to mention i solved it? i did.