VirtualBox

Changeset 22810 in vbox


Ignore:
Timestamp:
Sep 7, 2009 1:41:45 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52023
Message:

FE/Qt, Devices/Input, Main, FE/*: upgrade mouse device to an MS IntelliMouse Explorer (five buttons and tilt wheel)

Location:
trunk/src/VBox
Files:
11 edited

Legend:

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

    r22793 r22810  
    5757#include "../Builtins.h"
    5858
    59 #define PCKBD_SAVED_STATE_VERSION 2
     59#define PCKBD_SAVED_STATE_VERSION 3
    6060
    6161
     
    171171#define KBD_QUEUE_SIZE 256
    172172
     173#ifdef VBOX
     174# define MOUSE_REPORT_HORIZONTAL  0x01
     175# define MOUSE_OUTSTANDING_CLICK  0x02
     176#endif
     177
    173178typedef struct {
    174179#ifndef VBOX
     
    221226    int32_t mouse_dy;
    222227    int32_t mouse_dz;
     228#ifdef VBOX
     229    int32_t mouse_dw;
     230    int32_t mouse_flags;
     231#endif
    223232    uint8_t mouse_buttons;
    224233
     
    331340
    332341#if defined(DEBUG_MOUSE) || defined(DEBUG_KBD)
    333     if (aux)
    334         Log(("mouse event: 0x%02x\n", b));
     342    if (aux == 1)
     343        LogRel3(("%s: mouse command response: 0x%02x\n", __PRETTY_FUNCTION__, b));
     344    else if (aux == 2)
     345        LogRel3(("%s: mouse event data: 0x%02x\n", __PRETTY_FUNCTION__, b));
    335346#ifdef DEBUG_KBD
    336347    else
    337         Log(("kbd event: 0x%02x\n", b));
     348        LogRel3(("%s: kbd event: 0x%02x\n", __PRETTY_FUNCTION__, b));
    338349#endif
    339350#endif
     
    709720#endif /* VBOX */
    710721    unsigned int b;
    711     int dx1, dy1, dz1;
     722    int dx1, dy1, dz1, dw1;
    712723
    713724    dx1 = s->mouse_dx;
    714725    dy1 = s->mouse_dy;
    715726    dz1 = s->mouse_dz;
     727    dw1 = s->mouse_dw;
     728    LogRel3(("%s: dx=%d, dy=%d, dz=%d, dw=%d\n", __PRETTY_FUNCTION__,
     729             dx1, dy1, dz1, dw1));
    716730    /* XXX: increase range to 8 bits ? */
    717731    if (dx1 > 127)
     
    749763        break;
    750764    case 4:
     765#ifndef VBOX
    751766        if (dz1 > 7)
    752767            dz1 = 7;
    753768        else if (dz1 < -7)
    754769            dz1 = -7;
    755         b = (dz1 & 0x0f) | ((s->mouse_buttons & 0x18) << 1);
    756 #ifdef VBOX
     770#else
     771        if (dz1 > 1)
     772            dz1 = 1;
     773        else if (dz1 < -1)
     774            dz1 = -1;
     775        else if (dw1 > 1)
     776            dw1 = 1;
     777        else if (dw1 < -1)
     778            dw1 = -1;
     779        if (dz1)
     780            dw1 = 0;
     781#endif
     782#ifdef VBOX
     783        if ((s->mouse_flags & MOUSE_REPORT_HORIZONTAL) && dw1)
     784            b = 0x40 | (dw1 & 0x3f);
     785        else
     786        {
     787            b =   (dz1 & 0x0f) | ((dw1 << 1) & 0x0f)
     788                | ((s->mouse_buttons & 0x18) << 1);
     789            s->mouse_flags &= ~MOUSE_OUTSTANDING_CLICK;
     790        }
    757791        kbd_queue(s, b, aux);
    758792#else /* !VBOX */
     793        b = (dz1 & 0x0f) | ((s->mouse_buttons & 0x18) << 1);
    759794        kbd_queue(s, b, 1);
    760795#endif /* !VBOX */
     
    766801    s->mouse_dy -= dy1;
    767802    s->mouse_dz -= dz1;
     803#ifdef VBOX
     804    s->mouse_dw -= dw1;
     805#endif
    768806}
    769807
    770808#ifdef IN_RING3
     809#ifndef VBOX
    771810static void pc_kbd_mouse_event(void *opaque,
    772811                               int dx, int dy, int dz, int buttons_state)
     812#else
     813static void pc_kbd_mouse_event(void *opaque,
     814                               int dx, int dy, int dz, int dw, int buttons_state)
     815#endif
    773816{
    774817    KBDState *s = (KBDState*)opaque;
     
    781824    s->mouse_dy -= dy;
    782825    s->mouse_dz += dz;
     826#ifdef VBOX
     827    s->mouse_dw += dw;
     828#endif
    783829#ifndef VBOX
    784830    /* XXX: SDL sometimes generates nul events: we delete them */
     
    787833        return;
    788834#else
    789     /* This issue does not affect VBox, and under some circumstances (which?)
    790      * we may wish to send null events to make mouse integration work. */
     835    /* The issue described above does not affect VBox, and under some
     836     * circumstances (which?) we may even wish to send null events to make
     837     * mouse integration work. */
     838    /* In horizontal reporting mode, we may need to send an additional packet
     839     * for the forth and fifth buttons, as they can't share a packet with a
     840     * horizontal scroll delta. */
     841    if ((s->mouse_buttons & 0x18) != (buttons_state & 0x18))
     842        s->mouse_flags |= MOUSE_OUTSTANDING_CLICK;
    791843#endif
    792844    s->mouse_buttons = buttons_state;
     
    799851               too big deltas */
    800852            kbd_mouse_send_packet(s, false);
    801             if (s->mouse_dx == 0 && s->mouse_dy == 0 && s->mouse_dz == 0)
     853            if (s->mouse_dx == 0 && s->mouse_dy == 0 && s->mouse_dz == 0 && s->mouse_dw == 0 && !(s->mouse_flags & MOUSE_OUTSTANDING_CLICK))
    802854                break;
    803855        }
     
    821873{
    822874#ifdef DEBUG_MOUSE
    823     Log(("kbd: write mouse 0x%02x\n", val));
     875    LogRelFlowFunc(("kbd: write mouse 0x%02x\n", val));
    824876#endif
    825877#ifdef VBOX
     
    9491001        s->mouse_sample_rate = val;
    9501002        /* detect IMPS/2 or IMEX */
     1003#ifdef VBOX
     1004        /* And enable horizontal scrolling reporting when requested */
     1005#endif
    9511006        switch(s->mouse_detect_state) {
    9521007        default:
     
    9601015            else if (val == 200)
    9611016                s->mouse_detect_state = 3;
     1017#ifdef VBOX
     1018            else if ((val == 80) && s->mouse_type == 4 /* IMEX */)
     1019                /* enable horizontal scrolling, byte two */
     1020                s->mouse_detect_state = 4;
     1021#endif
    9621022            else
    9631023                s->mouse_detect_state = 0;
    9641024            break;
    9651025        case 2:
     1026#ifdef VBOX
     1027            if (val == 80)
     1028            {
     1029                LogRelFlowFunc(("switching mouse device to IMPS/2 mode\n"));
     1030                s->mouse_type = 3; /* IMPS/2 */
     1031            }
     1032#else
    9661033            if (val == 80)
    9671034                s->mouse_type = 3; /* IMPS/2 */
     1035#endif
    9681036            s->mouse_detect_state = 0;
    9691037            break;
    9701038        case 3:
     1039#ifdef VBOX
     1040            if (val == 80)
     1041            {
     1042                LogRelFlowFunc(("switching mouse device to IMEX mode\n"));
     1043                s->mouse_type = 4; /* IMEX */
     1044            }
     1045#else
    9711046            if (val == 80)
    9721047                s->mouse_type = 4; /* IMEX */
     1048#endif
    9731049            s->mouse_detect_state = 0;
    9741050            break;
     1051#ifdef VBOX
     1052        case 4:
     1053            if (val == 40)
     1054            {
     1055                LogFlowFunc(("enabling IMEX horizontal scrolling reporting\n"));
     1056                s->mouse_flags |= MOUSE_REPORT_HORIZONTAL;
     1057            }
     1058            s->mouse_detect_state = 0;
     1059            break;
     1060#endif
    9751061        }
    9761062        kbd_queue(s, AUX_ACK, 1);
     
    10781164    s->mouse_dy = 0;
    10791165    s->mouse_dz = 0;
     1166    s->mouse_dw = 0;
     1167    s->mouse_flags = 0;
    10801168    s->mouse_buttons = 0;
    10811169#endif
     
    11191207    qemu_put_be32s(f, &s->mouse_dy);
    11201208    qemu_put_be32s(f, &s->mouse_dz);
     1209#ifdef VBOX
     1210    qemu_put_be32s(f, &s->mouse_dw);
     1211    qemu_put_be32s(f, &s->mouse_flags);
     1212#endif
    11211213    qemu_put_8s(f, &s->mouse_buttons);
    11221214
     
    11561248    KBDState *s = (KBDState*)opaque;
    11571249
    1158     if (version_id != PCKBD_SAVED_STATE_VERSION)
     1250    if (version_id < 2 || version_id > PCKBD_SAVED_STATE_VERSION)
    11591251#ifndef VBOX
    11601252        return -EINVAL;
     
    11771269    qemu_get_be32s(f, (uint32_t *)&s->mouse_dy);
    11781270    qemu_get_be32s(f, (uint32_t *)&s->mouse_dz);
     1271#ifdef VBOX
     1272    if (version_id > 2)
     1273    {
     1274        qemu_get_be32s(f, (uint32_t *)&s->mouse_dw);
     1275        qemu_get_be32s(f, (uint32_t *)&s->mouse_flags);
     1276    }
     1277#endif
    11791278    qemu_get_8s(f, &s->mouse_buttons);
    11801279#ifdef VBOX
     
    15371636 * @param   fButtonStates   The button states.
    15381637 */
    1539 static DECLCALLBACK(int) kbdMousePutEvent(PPDMIMOUSEPORT pInterface, int32_t i32DeltaX, int32_t i32DeltaY, int32_t i32DeltaZ, uint32_t fButtonStates)
     1638static DECLCALLBACK(int) kbdMousePutEvent(PPDMIMOUSEPORT pInterface, int32_t i32DeltaX, int32_t i32DeltaY, int32_t i32DeltaZ, int32_t i32DeltaW, uint32_t fButtonStates)
    15401639{
    15411640    KBDState *pThis = IMOUSEPORT_2_KBDSTATE(pInterface);
    15421641    int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    15431642    AssertReleaseRC(rc);
    1544     pc_kbd_mouse_event(pThis, i32DeltaX, i32DeltaY, i32DeltaZ, fButtonStates);
     1643    pc_kbd_mouse_event(pThis, i32DeltaX, i32DeltaY, i32DeltaZ, i32DeltaW, fButtonStates);
    15451644    PDMCritSectLeave(&pThis->CritSect);
    15461645    return VINF_SUCCESS;
  • TabularUnified trunk/src/VBox/Devices/Input/DrvMouseQueue.cpp

    r22277 r22810  
    6969    int32_t             i32DeltaY;
    7070    int32_t             i32DeltaZ;
     71    int32_t             i32DeltaW;
    7172    uint32_t            fButtonStates;
    7273} DRVMOUSEQUEUEITEM, *PDRVMOUSEQUEUEITEM;
     
    120121 * @thread  Any thread.
    121122 */
    122 static DECLCALLBACK(int) drvMouseQueuePutEvent(PPDMIMOUSEPORT pInterface, int32_t i32DeltaX, int32_t i32DeltaY, int32_t i32DeltaZ, uint32_t fButtonStates)
     123static DECLCALLBACK(int) drvMouseQueuePutEvent(PPDMIMOUSEPORT pInterface, int32_t i32DeltaX, int32_t i32DeltaY, int32_t i32DeltaZ, int32_t i32DeltaW, uint32_t fButtonStates)
    123124{
    124125    PDRVMOUSEQUEUE pDrv = IMOUSEPORT_2_DRVMOUSEQUEUE(pInterface);
     
    132133        pItem->i32DeltaY = i32DeltaY;
    133134        pItem->i32DeltaZ = i32DeltaZ;
     135        pItem->i32DeltaW = i32DeltaW;
    134136        pItem->fButtonStates = fButtonStates;
    135137        PDMQueueInsert(pDrv->pQueue, &pItem->Core);
     
    154156    PDRVMOUSEQUEUE        pThis = PDMINS_2_DATA(pDrvIns, PDRVMOUSEQUEUE);
    155157    PDRVMOUSEQUEUEITEM    pItem = (PDRVMOUSEQUEUEITEM)pItemCore;
    156     int rc = pThis->pUpPort->pfnPutEvent(pThis->pUpPort, pItem->i32DeltaX, pItem->i32DeltaY, pItem->i32DeltaZ, pItem->fButtonStates);
     158    int rc = pThis->pUpPort->pfnPutEvent(pThis->pUpPort, pItem->i32DeltaX, pItem->i32DeltaY, pItem->i32DeltaZ, pItem->i32DeltaW, pItem->fButtonStates);
    157159    return RT_SUCCESS(rc);
    158160}
  • TabularUnified trunk/src/VBox/Devices/testcase/tstDeviceStructSizeGC.cpp

    r20735 r22810  
    327327    GEN_CHECK_OFF(KBDState, mouse_dy);
    328328    GEN_CHECK_OFF(KBDState, mouse_dz);
     329    GEN_CHECK_OFF(KBDState, mouse_dw);
    329330    GEN_CHECK_OFF(KBDState, mouse_buttons);
    330331    GEN_CHECK_OFF(KBDState, pDevInsR3);
  • TabularUnified trunk/src/VBox/Frontends/VBoxBFE/MouseImpl.cpp

    r22277 r22810  
    109109        fButtons |= PDMIMOUSEPORT_BUTTON_MIDDLE;
    110110
    111     int vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, dx, dy, dz, fButtons);
     111    int vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, dx, dy, dz, 0 /* Horizontal wheel */, fButtons);
    112112    if (RT_FAILURE (vrc))
    113113        return E_FAIL;
     
    166166            fButtons |= PDMIMOUSEPORT_BUTTON_MIDDLE;
    167167
    168         vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, 1, 1, dz, fButtons);
     168        vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, 1, 1, dz, 0 /* Horizontal wheel */, fButtons);
    169169        if (RT_FAILURE (vrc))
    170170            return E_FAIL;
  • TabularUnified trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp

    r21520 r22810  
    152152            if (mouse)
    153153            {
    154                 mouse->PutMouseEventAbsolute(-1, -1, 0, 0);
     154                mouse->PutMouseEventAbsolute(-1, -1, 0, 0 /* Horizontal wheel */, 0);
    155155            }
    156156        }
  • TabularUnified trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r22490 r22810  
    39793979            gMouse->PutMouseEventAbsolute(x + 1 - xMin + xOrigin,
    39803980                                          y + 1 - yMin + yOrigin,
    3981                                           dz, buttons | tmp_button);
     3981                                          dz, 0 /* horizontal scroll wheel */,
     3982                                          buttons | tmp_button);
    39823983        }
    39833984        else
    39843985        {
    3985             gMouse->PutMouseEvent(0, 0, dz, buttons | tmp_button);
     3986            gMouse->PutMouseEvent(0, 0, dz,
     3987                                  0 /* horizontal scroll wheel */,
     3988                                  buttons | tmp_button);
    39863989        }
    39873990    }
     
    39984001        gMouse->PutMouseEventAbsolute(x + 1 - xMin + xOrigin,
    39994002                                      y + 1 - yMin + yOrigin,
    4000                                       dz, buttons);
     4003                                      dz, 0 /* Horizontal wheel */, buttons);
    40014004    }
    40024005    else
    40034006    {
    4004         gMouse->PutMouseEvent(x, y, dz, buttons);
     4007        gMouse->PutMouseEvent(x, y, dz, 0 /* Horizontal wheel */, buttons);
    40054008    }
    40064009}
     
    46274630        if (gfGrabbed)
    46284631            InputGrabEnd();
    4629         gMouse->PutMouseEventAbsolute(-1, -1, 0, 0);
     4632        gMouse->PutMouseEventAbsolute(-1, -1, 0, 0, 0);
    46304633    }
    46314634}
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r22794 r22810  
    13851385                    {
    13861386                        CMouse mouse = mConsole.GetMouse();
    1387                         mouse.PutMouseEventAbsolute (-1, -1, 0, 0);
     1387                        mouse.PutMouseEventAbsolute (-1, -1, 0,
     1388                                                     0 /* Horizontal wheel */,
     1389                                                     0);
    13881390                        captureMouse (false, false);
    13891391                    }
     
    29602962                                  int aWheelDelta, Qt::Orientation aWheelDir)
    29612963{
    2962 #if 0
    2963     char buf [256];
    2964     sprintf (buf,
    2965              "MOUSE: type=%03d x=%03d y=%03d btn=%03d btns=%08X mod=%08X "
    2966              "wdelta=%03d wdir=%03d",
    2967              aType, aPos.x(), aPos.y(), aButtons, aModifiers,
    2968              aWheelDelta, aWheelDir);
    2969     mMainWnd->statusBar()->message (buf);
     2964#if 1
     2965   
     2966    LogRel3(("%s: type=%03d x=%03d y=%03d btns=%08X wdelta=%03d wdir=%s\n",
     2967             __PRETTY_FUNCTION__ , aType, aPos.x(), aPos.y(),
     2968               (aButtons & Qt::LeftButton ? 1 : 0)
     2969             | (aButtons & Qt::RightButton ? 2 : 0)
     2970             | (aButtons & Qt::MidButton ? 4 : 0)
     2971             | (aButtons & Qt::XButton1 ? 8 : 0)
     2972             | (aButtons & Qt::XButton2 ? 16 : 0),
     2973             aWheelDelta,
     2974               aWheelDir == Qt::Horizontal ? "Horizontal"
     2975             : aWheelDir == Qt::Vertical ? "Vertical" : "Unknown"));
     2976    Q_UNUSED (aModifiers);
    29702977#else
    29712978    Q_UNUSED (aModifiers);
     
    29792986    if (aButtons & Qt::MidButton)
    29802987        state |= KMouseButtonState_MiddleButton;
     2988    if (aButtons & Qt::XButton1)
     2989        state |= KMouseButtonState_XButton1;
     2990    if (aButtons & Qt::XButton2)
     2991        state |= KMouseButtonState_XButton2;
    29812992
    29822993#ifdef Q_WS_MAC
     
    29893000#endif /* Q_WS_MAC */
    29903001
    2991     int wheel = 0;
     3002    int wheelVertical = 0;
     3003    int wheelHorizontal = 0;
    29923004    if (aWheelDir == Qt::Vertical)
    29933005    {
     
    29953007         * move; positive deltas correspond to counterclockwize rotations
    29963008         * (usually up), negative -- to clockwize (usually down). */
    2997         wheel = - (aWheelDelta / 120);
    2998     }
     3009        wheelVertical = - (aWheelDelta / 120);
     3010    }
     3011    else if (aWheelDir == Qt::Horizontal)
     3012        wheelHorizontal = aWheelDelta / 120;
    29993013
    30003014    if (mMouseCaptured)
     
    30083022        mouse.PutMouseEvent (aGlobalPos.x() - mLastPos.x(),
    30093023                             aGlobalPos.y() - mLastPos.y(),
    3010                              wheel, state);
     3024                             wheelVertical, wheelHorizontal, state);
    30113025
    30123026#if defined (Q_WS_MAC)
     
    31513165
    31523166            CMouse mouse = mConsole.GetMouse();
    3153             mouse.PutMouseEventAbsolute (cpnt.x(), cpnt.y(), wheel, state);
     3167            mouse.PutMouseEventAbsolute (cpnt.x(), cpnt.y(), wheelVertical,
     3168                                         wheelHorizontal, state);
    31543169            return true; /* stop further event handling */
    31553170        }
     
    34263441        /* release mouse buttons */
    34273442        CMouse mouse = mConsole.GetMouse();
    3428         mouse.PutMouseEvent (0, 0, 0, 0);
     3443        mouse.PutMouseEvent (0, 0, 0, 0 /* Horizontal wheel */, 0);
    34293444    }
    34303445
  • TabularUnified trunk/src/VBox/Main/ConsoleVRDPServer.cpp

    r22663 r22810  
    10261026                if (server->m_fGuestWantsAbsolute)
    10271027                {
    1028                     pConsole->getMouse()->PutMouseEventAbsolute (pInputPoint->x + 1, pInputPoint->y + 1, iWheel, mouseButtons);
     1028                    pConsole->getMouse()->PutMouseEventAbsolute (pInputPoint->x + 1, pInputPoint->y + 1, iWheel, 0 /* Horizontal wheel */, mouseButtons);
    10291029                } else
    10301030                {
    10311031                    pConsole->getMouse()->PutMouseEvent (pInputPoint->x - server->m_mousex,
    10321032                                                         pInputPoint->y - server->m_mousey,
    1033                                                          iWheel, mouseButtons);
     1033                                                         iWheel, 0 /* Horizontal wheel */, mouseButtons);
    10341034                    server->m_mousex = pInputPoint->x;
    10351035                    server->m_mousey = pInputPoint->y;
  • TabularUnified trunk/src/VBox/Main/MouseImpl.cpp

    r22277 r22810  
    198198 * @param buttonState The mouse button state
    199199 */
    200 STDMETHODIMP Mouse::PutMouseEvent(LONG dx, LONG dy, LONG dz, LONG buttonState)
     200STDMETHODIMP Mouse::PutMouseEvent(LONG dx, LONG dy, LONG dz, LONG dw, LONG buttonState)
    201201{
    202202    HRESULT rc = S_OK;
     
    213213
    214214    uint32_t mouseCaps;
     215    LogRel3(("%s: dx=%d, dy=%d, dz=%d, dw=%d\n", __PRETTY_FUNCTION__,
     216             dx, dy, dz, dw));
    215217    mParent->getVMMDev()->getVMMDevPort()
    216218        ->pfnQueryMouseCapabilities(mParent->getVMMDev()->getVMMDevPort(),
     
    234236    if (buttonState & MouseButtonState_MiddleButton)
    235237        fButtons |= PDMIMOUSEPORT_BUTTON_MIDDLE;
    236 
    237     int vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, dx, dy, dz, fButtons);
     238    if (buttonState & MouseButtonState_XButton1)
     239        fButtons |= PDMIMOUSEPORT_BUTTON_X1;
     240    if (buttonState & MouseButtonState_XButton2)
     241        fButtons |= PDMIMOUSEPORT_BUTTON_X2;
     242
     243    int vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, dx, dy, dz, dw, fButtons);
    238244    if (RT_FAILURE(vrc))
    239245        rc = setError (VBOX_E_IPRT_ERROR,
     
    254260 * @param buttonState The mouse button state
    255261 */
    256 STDMETHODIMP Mouse::PutMouseEventAbsolute(LONG x, LONG y, LONG dz,
     262STDMETHODIMP Mouse::PutMouseEventAbsolute(LONG x, LONG y, LONG dz, LONG dw,
    257263                                          LONG buttonState)
    258264{
     
    270276
    271277    uint32_t mouseCaps;
     278    LogRel3(("%s: x=%d, y=%d, dz=%d, dw=%d\n", __PRETTY_FUNCTION__,
     279             x, y, dz, dw));
    272280    mParent->getVMMDev()->getVMMDevPort()
    273281        ->pfnQueryMouseCapabilities(mParent->getVMMDev()->getVMMDevPort(),
     
    316324        if (buttonState & MouseButtonState_MiddleButton)
    317325            fButtons |= PDMIMOUSEPORT_BUTTON_MIDDLE;
     326        if (buttonState & MouseButtonState_XButton1)
     327            fButtons |= PDMIMOUSEPORT_BUTTON_X1;
     328        if (buttonState & MouseButtonState_XButton2)
     329            fButtons |= PDMIMOUSEPORT_BUTTON_X2;
    318330
    319331        /* This is a workaround.  In order to alert the Guest Additions to the
     
    325337        if (   ((mLastAbsX == mouseXAbs) && (mLastAbsY == mouseYAbs))
    326338            || (mouseCaps & VMMDEV_MOUSE_GUEST_USES_VMMDEV))
    327             vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, 0, 0, dz,
     339            vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, 0, 0, dz, dw,
    328340                                              fButtons);
    329341        else
    330             vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, 1, 1, dz,
     342            vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, 1, 1, dz, dw,
    331343                                              fButtons);
    332344        mLastAbsX = mouseXAbs;
  • TabularUnified trunk/src/VBox/Main/idl/VirtualBox.xidl

    r22381 r22810  
    99119911    <const name="WheelUp"           value="0x08"/>
    99129912    <const name="WheelDown"         value="0x10"/>
    9913     <const name="MouseStateMask"    value="0x1F"/>
     9913    <const name="XButton1"          value="0x20"/>
     9914    <const name="XButton2"          value="0x40"/>
     9915    <const name="MouseStateMask"    value="0x7F"/>
    99149916  </enum>
    99159917
     
    99739975          Positive values describe clockwise wheel rotations,
    99749976          negative values describe counterclockwise rotations.
     9977        </desc>
     9978      </param>
     9979      <param name="dw" type="long" dir="in">
     9980        <desc>
     9981          Amount of horizontal mouse wheel moves.
     9982          Positive values describe a movement to the left,
     9983          negative values describe a movement to the right.
    99759984        </desc>
    99769985      </param>
     
    1002710036          Positive values describe clockwise wheel rotations,
    1002810037          negative values describe counterclockwise rotations.
     10038        </desc>
     10039      </param>
     10040      <param name="dw" type="long" dir="in">
     10041        <desc>
     10042          Amount of horizontal mouse wheel moves.
     10043          Positive values describe a movement to the left,
     10044          negative values describe a movement to the right.
    1002910045        </desc>
    1003010046      </param>
  • TabularUnified trunk/src/VBox/Main/include/MouseImpl.h

    r22277 r22810  
    3434{
    3535public:
    36     MouseEvent() : dx(0), dy(0), dz(0), state(-1) {}
    37     MouseEvent(int _dx, int _dy, int _dz, int _state) :
    38         dx(_dx), dy(_dy), dz(_dz), state(_state) {}
     36    MouseEvent() : dx(0), dy(0), dz(0), dw(0), state(-1) {}
     37    MouseEvent(int32_t _dx, int32_t _dy, int32_t _dz, int32_t _dw, int32_t _state) :
     38        dx(_dx), dy(_dy), dz(_dz), dw(_dw), state(_state) {}
    3939    bool isValid()
    4040    {
    4141        return state != -1;
    4242    }
    43     // not logical to be int but that's how it's defined in QEMU
    44     /** @todo r=bird: and what is the logical declaration then? We'll be using int32_t btw. */
    45     int dx, dy, dz;
    46     int state;
     43    /* Note: dw is the horizontal scroll wheel */
     44    int32_t dx, dy, dz, dw;
     45    int32_t state;
    4746};
    4847// template instantiation
     
    8584
    8685    // IMouse methods
    87     STDMETHOD(PutMouseEvent)(LONG dx, LONG dy, LONG dz,
     86    STDMETHOD(PutMouseEvent)(LONG dx, LONG dy, LONG dz, LONG dw,
    8887                             LONG buttonState);
    89     STDMETHOD(PutMouseEventAbsolute)(LONG x, LONG y, LONG dz,
     88    STDMETHOD(PutMouseEventAbsolute)(LONG x, LONG y, LONG dz, LONG dw,
    9089                                     LONG buttonState);
    9190
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