Kodi Community Forum

Full Version: Remote mouse move events
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

I am writing a remote for XBMC in C++ running on Ubuntu 10.04 on the latest source code.
The xbmcclient.h code works well with various buttons that I tried, but the CPacketMOUSE sends the cursor to 0,0 (upper left corner) regardless of the X,Y parameters passed. I tried with and w/o a UID parameter.

Is any initialization required? Is there a bug in the library client code maybe?

Thanks,
Michael



Code:
CPacketHELO HeloPackage("Example Mouse", ICON_PNG, "../../icons/mouse.png");
  HeloPackage.Send(sockfd, my_addr, UID);

  sleep(5);

  for(int i = 0; i < 65536; i+=2000)
  {
    CPacketMOUSE mouse(i,i);
    mouse.Send(sockfd, my_addr, UID);
    sleep(1);
    printf("%d\n",i);
  }

  // BYE is not required since XBMC would have shut down
  CPacketBYE bye; // CPacketPing if you want to ping
  bye.Send(sockfd, my_addr, UID);
bump. any help?
I think I have found the issue.

xbmc/network/EventClient.cpp
CEventClient::GetMousePos() uses g_graphicsContext.GetViewWindow() which is only available while a video is playing, instead of g_Windowing.GetViewPort()

Should I commit the fix?
Sure, commit the fix to your github and send a pull request. Make sure you clearly describe the problem and your chosen solution.

Cheers,
Jonathan