VirtualBox

Changeset 45873 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 2, 2013 10:48:59 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85464
Message:

FE/Qt: hopefully support AltGr correctly in the host combination editor on Windows hosts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHostComboEditor.cpp

    r45871 r45873  
    393393 * RAlt key event matching this LCtrl event (i.e. both key up or both key down)
    394394 * and if there is, we check whether the current layout has an AltGr key.  We
    395  * check this by looking to see if any of the number keys has a symbol
    396  * associated when AltGr is pressed.  Let's see how well this works!
     395 * check this by looking to see if any of the layout-dependent keys has a symbol
     396 * associated when AltGr is pressed.
    397397 */
    398398static bool isSyntheticLCtrl(MSG *pMsg)
     
    407407    if ((pMsg->lParam & 0x01FF0000) >> 16 != 0x1d /* LCtrl */)
    408408        return false;
    409     LogRel(("Got an LCtrl event.\n"));
     409    if (!PeekMessage(&peekMsg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE))
     410        return false;
     411    if (   (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN)
     412        && (peekMsg.message != WM_KEYDOWN && peekMsg.message != WM_SYSKEYDOWN))
     413        return false;
     414    if (   (pMsg->message == WM_KEYUP || pMsg->message == WM_SYSKEYUP)
     415        && (peekMsg.message != WM_KEYUP && peekMsg.message != WM_SYSKEYUP))
     416        return false;
     417    if ((peekMsg.lParam & 0x01FF0000) >> 16 != 0x138 /* RAlt */)
     418        return false;
    410419    for (i = '0'; i <= VK_OEM_102; ++i)
    411420    {
     
    424433    if (i > VK_OEM_102)
    425434        return false;
    426     LogRel(("Virtual key %d has an AltGr state.\n", i));
    427     if (!PeekMessage(&peekMsg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE))
    428         return false;
    429     LogRel(("Another keyboard event follows.\n"));
    430     if (pMsg->time != peekMsg.time)
    431        return false;
    432     LogRel(("Both events have the same time stamp.\n"));
    433     if (   (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN)
    434         && (peekMsg.message != WM_KEYDOWN && peekMsg.message != WM_SYSKEYDOWN))
    435         return false;
    436     if (   (pMsg->message == WM_KEYUP || pMsg->message == WM_SYSKEYUP)
    437         && (peekMsg.message != WM_KEYUP && peekMsg.message != WM_SYSKEYUP))
    438         return false;
    439     LogRel((  (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN)
    440             ? "Both are KEYDOWN events.\n"
    441             : "Both are KEYUP events.\n"));
    442     if ((peekMsg.lParam & 0x01FF0000) >> 16 != 0x138 /* RAlt */)
    443         return false;
    444     LogRel(("The next keyboard event is RAlt.\n"));
    445435    return true;
    446436}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette