Kodi Community Forum
Remote mouse move events - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: Remote mouse move events (/showthread.php?tid=98677)



Remote mouse move events - xmichaelm - 2011-04-06

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);



- xmichaelm - 2011-04-13

bump. any help?


- xmichaelm - 2011-04-13

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?


- jmarshall - 2011-04-13

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