Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFB3.8 sending cut text fails, Win7 and Win10 using VMware16.1.2 #622

Closed
YFforever2022 opened this issue Jul 4, 2024 · 5 comments
Closed
Labels

Comments

@YFforever2022
Copy link

YFforever2022 commented Jul 4, 2024

Here is my code:

    std::string str = "Hello, World!";
    BOOL ret = SendClientCutText(client, (char*)str.c_str(), str.size());
    std::cout << "[" << str << "] " << ret << std::endl;

    str = "Hello, World!";
    ret = SendClientCutTextUTF8(client, (char*)str.c_str(), str.size());
    std::cout << "[" << str << "(UTF8)]  " << ret << std::endl;

    str = "你好, 世界!";
    ret = SendClientCutText(client, (char*)str.c_str(), str.size());
    std::cout << "[" << str << "]  " << ret << std::endl;

    str = "你好, 世界!";
    ret = SendClientCutTextUTF8(client, (char*)str.c_str(), str.size());
    std::cout << "[" << str << "(UTF8)]  " << ret << std::endl;

    SendKeyEvent(client, XK_Control_L, TRUE);
    Sleep(50);
    SendKeyEvent(client, XK_V, TRUE);
    Sleep(77);
    SendKeyEvent(client, XK_V, FALSE);
    Sleep(66);
    SendKeyEvent(client, XK_Control_L, FALSE);

This is the log:

04/07/2024 19:31:00 VNC server supports protocol version 3.8 (viewer 3.8)
04/07/2024 19:31:00 We have 1 security types to read
04/07/2024 19:31:00 0) Received security type 1
04/07/2024 19:31:00 Selecting security type 1 (0/1 in the list)
04/07/2024 19:31:00 Selected Security Scheme 1
04/07/2024 19:31:00 No authentication needed
04/07/2024 19:31:00 VNC authentication succeeded
04/07/2024 19:31:00 Desktop name "Windows 7 x64"
04/07/2024 19:31:00 Connected to VNC server, using protocol version 3.8
04/07/2024 19:31:00 VNC server default format:
04/07/2024 19:31:00   32 bits per pixel.
04/07/2024 19:31:00   Least significant byte first in each pixel.
04/07/2024 19:31:00   TRUE colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
04/07/2024 19:31:00 Unknown encoding 'tight'
04/07/2024 19:31:00 Unknown encoding 'zrle'
04/07/2024 19:31:00 Unknown encoding 'zlib'
[Hello, World!] 1
[Hello, World!(UTF8)]  0
[你好, 世界!]  1
[你好, 世界!(UTF8)]  0

I haven't figured out how to solve this problem. This problem has troubled me for two or three days. I really need your help.

@YFforever2022
Copy link
Author

a
Even though I set LIBVNCSERVER_HAVE_LIBZ and added zlib, I still cannot run SendClientCutTextUTF8 successfully. SendClientCutText can return 1, but the VNC server clipboard is not successfully set.

@bk138
Copy link
Member

bk138 commented Jul 5, 2024

Please specify if you're trying to code a client or server and what type the remote end is. Are you maybe seeing #592?

@bk138 bk138 added question and removed bug labels Jul 5, 2024
@YFforever2022
Copy link
Author

Please specify if you're trying to code a client or server and what type the remote end is. Are you maybe seeing #592?

Hello, I am trying to write client code to connect to the VNC server that comes with VMware 16.1.2. I can successfully connect and obtain images and keyboard and mouse operations, but I cannot see success in setting the clipboard. I am not thinking about the UTF8 problem for now, and I cannot succeed in just sending English letters.

@bk138
Copy link
Member

bk138 commented Jul 5, 2024

Please use the chat at https://gitter.im/LibVNC/libvncserver for future questions :-)

For this here question; I recommend you take a look at the client examples at https://github.com/LibVNC/libvncserver/tree/master/examples/client

It could also be that the server does not support UTF8 cuttext or no cuttext at all.

@YFforever2022
Copy link
Author

Thank you very much for your suggestion. I referred to the code but still failed. Maybe the VNC server does not support it. I gave up this direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants