0 Replies - 436 Views - Last Post: 06 December 2013 - 07:37 AM Rate Topic: -----

#1 Gabarel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 19-August 13

Mouse events to a client

Posted 06 December 2013 - 07:37 AM

Hi guys, I would need for some advice about the possibility of debbugging a code, I need to test an application which hooks DirectX end streams the video to a client, and it does it pretty well, but in the games, I mean the first person shooter I'm experienced two different behaviours of mouse cursor, everything works fine while you are in the menus screen, but suddenly in the game section I have registered a different response of the mouse as an extrem sensibility occured making it impossible to play.

For sending information about mouse events I'm using the function SendInput() but I don't what is going once I intialized the INPUT structure and send the event to Windows.

here a fragment of the code:
 
.....   
flg = MOUSEEVENTF_VIRTUALDESK | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
  }

  if (flg > 0)
  {
    //logTest("MirrorPoller::handleMouseEvent", "SetCursor - flg > 0");
    //
    //FIXME: move the cursor to the pace the event occurred
    //

    //SetCursorPos(event -> xbutton.x + x_, event -> xbutton.y + y_);

    long int moveX = (long int) ceil(((double)((event -> xmotion.x) + x_)) *
                                        65536 / (double)width_);

    long int moveY = (long int) ceil((double)((event -> xmotion.y) + y_) *
                                        65536 / (double)height_);

    pMouse_ -> mi.dx = moveX;

    pMouse_ -> mi.dy = moveY/;

    //
    // FIXME: Remove me: send the click/release event
    // mouse_event(flg, 0, 0, whl, (ULONG_PTR)NULL);
    //

    pMouse_ -> mi.dwFlags = flg;

    if (eventThreadService_ == 1)
    {
      addInputEvent(pMouse_);
    }
    else if (SendInput(1, pMouse_, sizeof(INPUT)) == 0)
    {
      logTest("MirrorPoller::handleMouseEvent", "Failed SendInput");
    }
.....




Anyone of you have a suggestion on what I should do for testing it, I'm trying to find same code sample on internet but anything came out, except this http://code.msdn.mic...Touch-f98db97e/ but I cannot copile it neither in VS 2013 nor VS 2012.
Or anyone of you can explain me what is going on, if you have an idea as well!

Thank you a lot.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1