VirtualBox

Ignore:
Timestamp:
Aug 26, 2008 12:01:22 PM (16 years ago)
Author:
vboxsync
Message:

Modified IKeyboard::PutScancodes to use SafeArray

File:
1 edited

Legend:

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

    r11574 r11655  
    13881388                    if (ke->key() >= Key_F1 && ke->key() <= Key_F12)
    13891389                    {
    1390                         LONG combo [6];
     1390                        QValueVector <LONG> combo (6);
    13911391                        combo [0] = 0x1d; /* Ctrl down */
    13921392                        combo [1] = 0x38; /* Alt  down */
     
    14081408
    14091409                        CKeyboard keyboard = mConsole.GetKeyboard();
    1410                         keyboard.PutScancodes (combo, 6);
     1410                        keyboard.PutScancodes (combo);
    14111411                    }
    14121412                    else if (ke->key() == Key_Home)
     
    26152615#endif
    26162616
    2617     keyboard.PutScancodes (codes, count);
     2617    std::vector <LONG> tmp(codes, &codes[count]);
     2618    QValueVector <LONG> scancodes (tmp);
     2619    keyboard.PutScancodes (scancodes);
    26182620
    26192621    /* grab the key from Qt */
     
    31853187                fSentRESEND = true;
    31863188            }
    3187             LONG codes [2];
     3189            QValueVector <LONG> codes (2);
    31883190            codes[0] = 0xE0;
    31893191            codes[1] = i | 0x80;
    3190             keyboard.PutScancodes (codes, 2);
     3192            keyboard.PutScancodes (codes);
    31913193        }
    31923194        mPressedKeys [i] = 0;
     
    32153217    AssertMsg (mAttached, ("Console must be attached"));
    32163218
    3217     LONG codes [2];
     3219    QValueVector <LONG> codes (2);
    32183220    CKeyboard keyboard = mConsole.GetKeyboard();
    32193221    for (uint i = 0; i < SIZEOF_ARRAY (mPressedKeys); ++ i)
     
    32343236            if (!(ns & IsExtKeyPressed))
    32353237                codes [1] |= 0x80;
    3236             keyboard.PutScancodes (codes, 2);
     3238            keyboard.PutScancodes (codes);
    32373239        }
    32383240    }
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