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:

Qt Code:
  1. int result = ToUnicodeEx(pKeyboardStruct->vkCode, pKeyboardStruct->scanCode, keyboard_state, buffer,4,0,keyboard_layout);
To copy to clipboard, switch view to plain text mode 
Here i put the steps to get unicode text:

Qt Code:
  1. BYTE keyboard_state[256];
  2. GetKeyboardState(keyboard_state);
  3. wchar_t buffer[5];
  4. HKL keyboard_layout = GetKeyboardLayout(0);
  5. int result = ToUnicodeEx(pKeyboardStruct->vkCode, pKeyboardStruct->scanCode, keyboard_state, buffer,4,0,keyboard_layout);
To copy to clipboard, switch view to plain text mode 
But for some strange reason works with key modificators:

Qt Code:
  1. UpdateKeyState(keyboard_state, VK_CONTROL);
To copy to clipboard, switch view to plain text mode 

But when i put for text only dont do the conversion:
Qt Code:
  1. GetKeyboardState(keyboard_state);
To copy to clipboard, switch view to plain text mode 

So probably for this happen.
For some reason i can't get the unicode text to use in my game.