VirtualBox

Changeset 37788 in vbox


Ignore:
Timestamp:
Jul 6, 2011 9:02:42 AM (13 years ago)
Author:
vboxsync
Message:

Tablet: Added a CFGM key to modify coordinate munging.

File:
1 edited

Legend:

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

    r37646 r37788  
    152152    /** Is this an absolute pointing device (tablet)? Relative (mouse) otherwise. */
    153153    bool                isAbsolute;
     154
     155    /** Tablet coordinate shift factor for old and broken operating systems. */
     156    uint8_t             u8CoordShift;
    154157
    155158    /**
     
    803806
    804807        report.btn = pThis->PtrDelta.btn;
    805         report.cx  = u32X / 2;
    806         report.cy  = u32Y / 2;
     808        report.cx  = u32X >> pThis->u8CoordShift;
     809        report.cy  = u32Y >> pThis->u8CoordShift;
    807810        report.dz  = clamp_i8(pThis->PtrDelta.dZ);
    808811
     
    12841287     * Validate and read the configuration.
    12851288     */
    1286     rc = CFGMR3ValidateConfig(pCfg, "/", "Absolute", "Config", "UsbHid", iInstance);
     1289    rc = CFGMR3ValidateConfig(pCfg, "/", "Absolute|CoordShift", "Config", "UsbHid", iInstance);
    12871290    if (RT_FAILURE(rc))
    12881291        return rc;
     
    13051308    if (!pThis->Lun0.pDrv)
    13061309        return PDMUsbHlpVMSetError(pUsbIns, VERR_PDM_MISSING_INTERFACE, RT_SRC_POS, N_("HID failed to query mouse interface"));
     1310
     1311    rc = CFGMR3QueryU8Def(pCfg, "CoordShift", &pThis->u8CoordShift, 1);
     1312    if (RT_FAILURE(rc))
     1313        return PDMUsbHlpVMSetError(pUsbIns, rc, RT_SRC_POS, N_("HID failed to query shift factor"));
    13071314
    13081315    return VINF_SUCCESS;
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