Results 1 to 1 of 1

Thread: Question with mapvirtualkey in QT

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

    Default Question with mapvirtualkey in QT

    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?
    Last edited by SirJonas; 31st October 2016 at 23:18.

Similar Threads

  1. question about xmpp (different question)
    By davinciomar in forum Newbie
    Replies: 9
    Last Post: 6th September 2016, 14:52
  2. css question
    By Hardstyle in forum Newbie
    Replies: 1
    Last Post: 29th June 2010, 06:29
  3. Qt Question
    By brkapadia2003 in forum Qt Programming
    Replies: 2
    Last Post: 28th June 2007, 13:00
  4. map question
    By mickey in forum General Programming
    Replies: 12
    Last Post: 10th June 2006, 19:40
  5. Question
    By KyrinComa in forum General Discussion
    Replies: 5
    Last Post: 19th May 2006, 02:36

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.