VirtualBox

Changeset 2722 in vbox for trunk/src


Ignore:
Timestamp:
May 18, 2007 4:27:19 PM (18 years ago)
Author:
vboxsync
Message:

FE/Qt: Fixed http://www.virtualbox.org/ticket/346: extended keys were not released in the guest when the console window lost focus.

File:
1 edited

Legend:

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

    r2708 r2722  
    24902490    AssertMsg (attached, ("Console must be attached"));
    24912491
    2492     LONG codes[2];
     2492    LONG codes [2];
    24932493    CKeyboard keyboard = cconsole.GetKeyboard();
    24942494
     
    25052505    for (uint i = 0; i < SIZEOF_ARRAY (keys_pressed); i++)
    25062506    {
    2507         if ( keys_pressed[i] & IsKeyPressed )
     2507        if (keys_pressed [i] & IsKeyPressed)
     2508        {
    25082509            keyboard.PutScancode (i | 0x80);
    2509         if ( keys_pressed[i] & IsKeyPressed )
     2510        }
     2511        else if (keys_pressed [i] & IsExtKeyPressed)
    25102512        {
    25112513            codes[0] = 0xE0;
     
    25132515            keyboard.PutScancodes (codes, 2);
    25142516        }
    2515         keys_pressed[i] = 0;
     2517        keys_pressed [i] = 0;
    25162518    }
    25172519
     
    25212523#ifdef Q_WS_MAC
    25222524    /* clear most of the modifiers. */
    2523     m_darwinKeyModifiers &= alphaLock | kEventKeyModifierNumLockMask
    2524                           | (release_hostkey ? 0 : ::DarwinKeyCodeToDarwinModifierMask (gs.hostKey()));
     2525    m_darwinKeyModifiers &=
     2526        alphaLock | kEventKeyModifierNumLockMask |
     2527        (release_hostkey ? 0 : ::DarwinKeyCodeToDarwinModifierMask (gs.hostKey()));
    25252528#endif
    25262529
     
    25402543    AssertMsg (attached, ("Console must be attached"));
    25412544
    2542     LONG codes[2];
     2545    LONG codes [2];
    25432546    CKeyboard keyboard = cconsole.GetKeyboard();
    2544     for ( uint i = 0; i < SIZEOF_ARRAY( keys_pressed ); i++ ) {
    2545         uint8_t os = keys_pressed_copy[i];
    2546         uint8_t ns = keys_pressed[i];
    2547         if ( (os & IsKeyPressed) != (ns & IsKeyPressed) ) {
    2548             codes[0] = i;
    2549             if ( !(ns & IsKeyPressed) )
     2547    for (uint i = 0; i < SIZEOF_ARRAY (keys_pressed); ++ i)
     2548    {
     2549        uint8_t os = keys_pressed_copy [i];
     2550        uint8_t ns = keys_pressed [i];
     2551        if ((os & IsKeyPressed) != (ns & IsKeyPressed))
     2552        {
     2553            codes [0] = i;
     2554            if (!(ns & IsKeyPressed))
    25502555                codes[0] |= 0x80;
    25512556            keyboard.PutScancode (codes[0]);
    25522557        }
    2553         if ( (os & IsExtKeyPressed) != (ns & IsExtKeyPressed) ) {
    2554             codes[0] = 0xE0;
    2555             codes[1] = i;
    2556             if ( !(ns & IsExtKeyPressed) )
    2557                 codes[1] |= 0x80;
     2558        else if ((os & IsExtKeyPressed) != (ns & IsExtKeyPressed))
     2559        {
     2560            codes [0] = 0xE0;
     2561            codes [1] = i;
     2562            if (!(ns & IsExtKeyPressed))
     2563                codes [1] |= 0x80;
    25582564            keyboard.PutScancodes (codes, 2);
    25592565        }
Note: See TracChangeset for help on using the changeset viewer.

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