LibVNC / libvncserver

LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
GNU General Public License v2.0
1.08k stars 483 forks source link

[Question] Get the client keyboard layout #538

Closed workgroupengineering closed 1 year ago

workgroupengineering commented 1 year ago

Is there any way to retrieve the vnc client keyboard layout information? eg: de,pc105

RokerHRO commented 1 year ago

Not in the standard VNC protocol, and not in the extensions specified in https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst so far. Maybe there is a proprietary VNC implementation that support this feature, but I doubt that.

What is the usecase for the VNC server to know the keyboard layout of the VNC client?

workgroupengineering commented 1 year ago

Thanks for the reply.

What is the usecase for the VNC server to know the keyboard layout of the VNC client?

to make sure the keyboard key pressed on the client side match on the server.

RokerHRO commented 1 year ago

If the user presses a key that is labelled with "@" on his keyboard, the VNC client sends a key-press event with an "@" to the server, no matter whether it is ⌥ + G (as on my Swiss German keyboard), AltGr + Q (normal German keyboard) or the Shift + 2 (US keyboard layout) or some OS-specific magic key sequence to enter an "@" via its ASCII code.

The VNC client has to know the keyboard layout of the machine it is running on, and normally it knows it. So the client's keyboard layout is not the business of the server side.