Results 1 to 2 of 2

Thread: Conversion unicode only worked with modificators

  1. #1
    Join Date
    Oct 2016
    Posts
    61
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Conversion unicode only worked with modificators

    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.

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Conversion unicode only worked with modificators

    Is there a reason you're using the Windows API instead of something like QKeyEvent?
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

Similar Threads

  1. flickcharms not worked???
    By chandantheracer in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2011, 11:34
  2. QString Unicode conversion
    By user_mail07 in forum Qt Programming
    Replies: 5
    Last Post: 15th April 2010, 23:16
  3. Conversion of Unicode to Japanese
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 16th April 2008, 15:35
  4. Anyone worked with Gui-Artist?
    By ChristianEhrlicher in forum Qt-based Software
    Replies: 2
    Last Post: 16th October 2007, 07:40
  5. qvfb problem- sorry worked out please ignore
    By GW in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 27th September 2007, 13:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.