VirtualBox

Changeset 47848 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Aug 19, 2013 4:34:02 PM (11 years ago)
Author:
vboxsync
Message:

Main: API event for multitouch input.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/MouseImpl.cpp

    r47841 r47848  
    489489}
    490490
     491void Mouse::fireMultiTouchEvent(uint8_t cContacts,
     492                                const LONG64 *paContacts,
     493                                uint32_t u32ScanTime)
     494{
     495    com::SafeArray<SHORT> xPositions(cContacts);
     496    com::SafeArray<SHORT> yPositions(cContacts);
     497    com::SafeArray<USHORT> contactIds(cContacts);
     498    com::SafeArray<USHORT> contactFlags(cContacts);
     499
     500    uint8_t i;
     501    for (i = 0; i < cContacts; i++)
     502    {
     503        uint32_t u32Lo = RT_LO_U32(paContacts[i]);
     504        uint32_t u32Hi = RT_HI_U32(paContacts[i]);
     505        xPositions[i] = (int16_t)u32Lo;
     506        yPositions[i] = (int16_t)(u32Lo >> 16);
     507        contactIds[i] = RT_BYTE1(u32Hi);
     508        contactFlags[i] = RT_BYTE2(u32Hi);
     509    }
     510
     511    VBoxEventDesc evDesc;
     512    evDesc.init(mEventSource, VBoxEventType_OnGuestMultiTouch,
     513                cContacts, ComSafeArrayAsInParam(xPositions), ComSafeArrayAsInParam(yPositions),
     514                ComSafeArrayAsInParam(contactIds), ComSafeArrayAsInParam(contactFlags), u32ScanTime);
     515    evDesc.fire(0);
     516}
    491517
    492518/**
     
    795821        rc = reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime);
    796822
    797         // @todo Implement using a new TouchEvent rather than extending the mouse event.
    798         // fireMouseEvent(true, x, y, 0, 0, cContact, contactState);
     823        /* Send the original contact information. */
     824        fireMultiTouchEvent(cContacts, cContacts? paContacts: NULL, (uint32_t)aScanTime);
    799825    }
    800826
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