Hi have one question with this function because normally i do this in QT
std::vector<int> keys(256);
int sc = MapVirtualKey(pKeyboardStruct->vkCode, MAPVK_VK_TO_VSC);
int return1 = ToUnicodeEx(pKeyboardStruct->vkCode, sc, keys.data(), buffer, 1, 0,keyboard_layout);
But obviously show me error in keys.data() because i need to use a constant Byte so i change too. But anyways i always can't get to convert in unicode. I always get the same result like 1 or one int nothing related with Unicode. Some idea or some suggestion?
Added after 14 minutes:
I tried to use const byte to solve this issue i use this:
int return1 = ToUnicode(pKeyboardStruct->vkCode, sc, keyboard_state, buffer, 1, 0);
But only show me between 0 and 1. So i think i'm dpoing something wrong.
My const byte will have:
//get the keyboard state
BYTE keyboard_state[256];
GetKeyboardState(keyboard_state);
UpdateKeyState(keyboard_state, VK_SHIFT);
UpdateKeyState(keyboard_state, VK_CAPITAL);
UpdateKeyState(keyboard_state, VK_CONTROL);
UpdateKeyState(keyboard_state, VK_MENU);
Function:
void UpdateKeyState(BYTE *keystate, int keycode)
{
keystate[keycode] = GetKeyState(keycode);
}
So when i press One key in my UpdateKeyState will get the keystate but i only get values between 0 and 1 all time so i want to show my unicode text some suggestion?
Bookmarks