VirtualBox

Changeset 54289 in vbox for trunk


Ignore:
Timestamp:
Feb 19, 2015 12:57:35 AM (10 years ago)
Author:
vboxsync
Message:

PS2M: Try harder not to leave buttons hanging.

File:
1 edited

Legend:

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

    r54271 r54289  
    242242    /** Instantaneous button data. */
    243243    uint32_t            fCurrB;
     244    /** Button state last sent to the guest. */
     245    uint32_t            fReportedB;
    244246    /** Throttling delay in milliseconds. */
    245247    uint32_t            uThrottleDelay;
    246     uint32_t            Alignment0;
    247248
    248249    /** The device critical section protecting everything - R3 Ptr */
     
    458459    /* Event queue, eccumulators, and button status bits are cleared. */
    459460    ps2kClearQueue((GeneriQ *)&pThis->evtQ);
    460     pThis->iAccumX = pThis->iAccumY = pThis->iAccumZ = pThis->fAccumB = pThis->fCurrB = 0;
     461    pThis->iAccumX = pThis->iAccumY = pThis->iAccumZ = pThis->fAccumB;
    461462}
    462463
     
    541542    }
    542543
    543     /* Clear the movement accumulators. */
     544    /* Clear the movement accumulators, but not necessarily button state. */
    544545    pThis->iAccumX = pThis->iAccumY = pThis->iAccumZ = 0;
    545546    /* Clear accumulated button state only when it's being used. */
    546547    if (fAccumBtns)
    547         pThis->fAccumB = 0;
     548    {
     549        pThis->fReportedB = pThis->fAccumB;
     550        pThis->fAccumB    = 0;
     551    }
    548552}
    549553
     
    778782#else
    779783    /* If more movement is accumulated, report it and restart the timer. */
    780     uHaveEvents = pThis->iAccumX | pThis->iAccumY | pThis->iAccumZ | pThis->fAccumB;
     784    uHaveEvents = pThis->iAccumX | pThis->iAccumY | pThis->iAccumZ | (pThis->fCurrB != pThis->fReportedB);
    781785    LogFlowFunc(("Have%s events\n", uHaveEvents ? "" : " no"));
    782786
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