VirtualBox

Ignore:
Timestamp:
Oct 12, 2010 12:42:20 PM (14 years ago)
Author:
vboxsync
Message:

Main, vboxshell: implemented support for user activity capturing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/KeyboardImpl.cpp

    r32718 r33061  
    111111    unconst(mParent) = aParent;
    112112
     113    unconst(mEventSource).createObject();
     114    HRESULT rc = mEventSource->init(static_cast<IKeyboard*>(this));
     115    AssertComRCReturnRC(rc);
     116
    113117    /* Confirm a successful initialization */
    114118    autoInitSpan.setSucceeded();
     
    141145
    142146    unconst(mParent) = NULL;
     147    unconst(mEventSource).setNull();
    143148}
    144149
     
    238243    if (codesStored)
    239244        *codesStored = (uint32_t)keys.size();
     245#if 1
     246    VBoxEventDesc evDesc;
     247    evDesc.init(mEventSource, VBoxEventType_OnGuestKeyboardEvent,
     248#ifdef RT_OS_WINDOWS
     249                scancodes
     250#else
     251                scancodesSize, scancodes
     252#endif
     253                );
     254    evDesc.fire(0);
     255#endif
    240256
    241257    return rc;
     
    261277
    262278    return PutScancodes(ComSafeArrayAsInParam(cadSequence), NULL);
     279}
     280
     281STDMETHODIMP Keyboard::COMGETTER(EventSource)(IEventSource ** aEventSource)
     282{
     283    CheckComArgOutPointerValid(aEventSource);
     284
     285    AutoCaller autoCaller(this);
     286    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     287
     288    // no need to lock - lifetime constant
     289    mEventSource.queryInterfaceTo(aEventSource);
     290
     291    return S_OK;
    263292}
    264293
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