Alright, this **** will work with ALL Keyboards
And you wont need to use a Keyboard Hook, which is, btw., gettin detected by some Anticheats
// Gets the current pressed key by looping thru all fkin vKey Codes
Code:
DWORD FetchKeyCode( )
{
DWORD i = 0x00;
DWORD ret = 0x00;
do
{
if( GetAsyncKeyState(i)&0x1 )
ret = i;
i++;
}
while( !ret && i < 0xFF );
return ret;
}
Code:
char VKtoCHAR(int vk)
{
static UCHAR keyboardState[256];
USHORT asciiVal;
// get layout
static HKL layout = GetKeyboardLayout(0);
// get keyboard state (shift etc)
if( GetKeyboardState(keyboardState) == false )
return 0;
// yup get ASCII codezZz :)
if( ToAsciiEx( vk, MapVirtualKey(vk,0), keyboardState, &asciiVal, 0, layout ) == 0 )
return 0;
return static_cast<char>(asciiVal);
}
// Use this to get final stuff
Code:
int vKey = (int)FetchKeyCode(); char c = VKtoCHAR(vKey);
c is ur single char now.
you can attach it to a string or w.e






