problems with unicode mapvirtualkey

Hi i am trying to do one program to trigger key's in one game. But my problem is here when i try to convert my key info:
int result = ToUnicodeEx(pKeyboardStruct->vkCode, pKeyboardStruct->scanCode, keyboard_state, buffer,4,0,keyboard_layout);
I do this to convert my key info. I will repeat what i do to get unicode text:
1
2
3
4
5
BYTE keyboard_state[256];
GetKeyboardState(keyboard_state);
wchar_t buffer[5];
HKL keyboard_layout = GetKeyboardLayout(0);
    int result = ToUnicodeEx(pKeyboardStruct->vkCode, pKeyboardStruct->scanCode, keyboard_state, buffer,4,0,keyboard_layout);

But when i do this show me the next:
key: 76 "l" "L"

So for some reason it doesnt show me the content in unicode must to show in three position where i put "l" like i wrote in my code:
// ascii, key
1
2
 qDebug() << "key:" << pKeyboardStruct->vkCode << " " << QString::fromUtf16((ushort*)buffer) << " " << QString::fromUtf16((ushort*)lpszName);
Some sugestion to get unicode text?
Last edited on
Topic archived. No new replies allowed.