指针事件& RFB协议中的DesktopSize

发布于 2024-09-30 20:42:39 字数 321 浏览 7 评论 0原文

我有一个问题,我实际上正在我的软件中重新编码 RFB 协议以与 VNC 服务器通信,并且我想知道如何获取服务器桌面大小的大小。 我已经准备好测试 serverInit 消息中的framebuffer_width,但它并不代表桌面的卷轴大小,我不知道如何获取它?

我的第二个问题是向服务器发送 PointerEvent 消息。 为了移动鼠标,实际上在我的软件中,我将鼠标的 x 和 y 设置为位置 {0, 0},当我将其发送到 VNC 服务器时,它可以成功工作,但是当我将 5 添加到 x 位置时,它不会t 移动 5 像素,它移动得比我想要的大,我不明白为什么???你能帮我吗?

感谢您的回答!

I have a problem I'm actually recoding the RFB protocol in my software to comunicate with a VNC Server, and I want to know how to get the size of the server Desktop Size.
I have allready test the framebuffer_width inside of the serverInit message but it is not representing the reel size of desktop I don't know how to get it ?

My second question is to send a PointerEvent message to the server.
To move the mouse, actually in my software I set the x and y of the mouse to position {0, 0}, when I send this to the VNC server it works successfully, but when I add 5 to the x position it doesn't move 5 pixel it move bigger than what I want, I don't understand why???? can you help me please ?

Thanks for your answers !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小伙你站住 2024-10-07 20:42:39

听起来你的两个问题都可能是你的客户端的扩展问题。

一些问题可能会帮助您回答您自己的问题(因为如果您想要明确的答案,您确实需要发布更多信息):

  • How are you certain that the real size of the Desktop is not that the real size of the Desktop is not What is sent as the width in the serverInit message ?也许您正在启动 VNC 服务器并假设它使用与服务器上当前桌面相同的大小,但实际上它以不同的默认大小启动。对于 *nix 系统上的 VNC 服务器,VNC 服务器通常作为独立于主桌面的桌面运行,并且大小不一定相同。
  • 您确定将 serverInit 宽度和pointerEvent x 和 y 位置视为 16 位值吗?
  • 您是否(广告和)在 ServerInit 之后获得 DesktopSize 伪编码?连接后服务器可能会更改帧缓冲区大小。
  • 您使用什么语言/框架/等来实现客户端。您确定渲染函数没有以某种方式缩放吗?

顺便说一句,我发现 官方 RFB 文档 有点缺乏,我认为这些链接更适合 RFB 参考:

Sounds like both of your problems could be a scaling issue in your client.

Some questions that might help you answer your own question (since you really need to post more information if you want a definitive answer):

  • How are you determining that the real size of the desktop is not what is sent as the width in the serverInit message? Perhaps you are starting the VNC server and assuming that it is using the same size as the current desktop on the server and in fact it is starting with a different default size. With VNC servers on *nix systems, the VNC server generally runs as a separate desktop from the main desktop and the size isn't necessarily the same.
  • Are you certain that you are treating the serverInit width and the pointerEvent x and y position as 16-bit values?
  • Are you (advertising and) getting a DesktopSize pseudo-encoding after the ServerInit? It's possible the server may be changing the frame buffer size after you connect.
  • What language/framework/etc are you using to implement the client. Are you certain the rendering functions aren't being scaled somehow?

BTW, I've found the official RFB documentation to be somewhat lacking and I think these links are better for RFB reference:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文