VirtualBox

Changeset 47219 in vbox for trunk


Ignore:
Timestamp:
Jul 17, 2013 2:00:49 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
87333
Message:

Devices/Input: machine configuration for multi-touch device.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/UsbMouse.cpp

    r47208 r47219  
    15741574{
    15751575    PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID);
    1576     bool isAbsolute;
     1576    char szMode[64];
    15771577    LogRelFlow(("usbHidConstruct/#%u:\n", iInstance));
    15781578
     
    15951595     * Validate and read the configuration.
    15961596     */
    1597     rc = CFGMR3ValidateConfig(pCfg, "/", "Absolute|CoordShift", "Config", "UsbHid", iInstance);
     1597    rc = CFGMR3ValidateConfig(pCfg, "/", "Mode|CoordShift", "Config", "UsbHid", iInstance);
    15981598    if (RT_FAILURE(rc))
    15991599        return rc;
    1600     rc = CFGMR3QueryBoolDef(pCfg, "Absolute", &isAbsolute, false);
     1600    rc = CFGMR3QueryStringDef(pCfg, "Mode", szMode, sizeof(szMode), "relative");
    16011601    if (RT_FAILURE(rc))
    16021602        return PDMUsbHlpVMSetError(pUsbIns, rc, RT_SRC_POS, N_("HID failed to query settings"));
    1603     pThis->enmMode = isAbsolute ? USBHIDMODE_ABSOLUTE : USBHIDMODE_RELATIVE;
     1603    if (!RTStrCmp(szMode, "relative"))
     1604        pThis->enmMode = USBHIDMODE_RELATIVE;
     1605    else if (!RTStrCmp(szMode, "absolute"))
     1606        pThis->enmMode = USBHIDMODE_ABSOLUTE;
     1607    else if (!RTStrCmp(szMode, "multitouch"))
     1608        pThis->enmMode = USBHIDMODE_MULTI_TOUCH;
     1609    else
     1610        return PDMUsbHlpVMSetError(pUsbIns, rc, RT_SRC_POS,
     1611                                   N_("Invalid HID device mode"));
    16041612
    16051613    pThis->Lun0.IBase.pfnQueryInterface = usbHidMouseQueryInterface;
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r47117 r47219  
    24272427                    if (aPointingHID == PointingHIDType_USBTablet)
    24282428                    {
    2429                         InsertConfigInteger(pCfg, "Absolute", 1);
     2429                        InsertConfigString(pCfg, "Mode", "absolute");
    24302430                    }
    24312431                    else
    24322432                    {
    2433                         InsertConfigInteger(pCfg, "Absolute", 0);
     2433                        InsertConfigString(pCfg, "Mode", "relative");
    24342434                    }
    24352435                    InsertConfigNode(pInst,    "LUN#0", &pLunL0);
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