From: Mario <ml@kernelobjects.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Request for comment - dynamic VNC keyboard mapping
Date: Fri, 3 May 2019 13:47:15 +0200 [thread overview]
Message-ID: <8C02D03E-96CD-414F-BC2C-C59972B26F94@kernelobjects.org> (raw)
Hi all,
I have a question related to the VNC server keyboard settings. Currently the user of qemu has to decide before VM startup which language is used for VNC keyboard mapping. If no keyboard is configured, the en-us keyboard will be loaded for keysym to scancode conversion. A later reconfiguration of the keyboard is not possible at present.
So here is my idea:
The VNC Display context stores a list of loaded keyboards (like vs->vd->kbds). If no keyboard was specified, at least the default will be added to the list ("en-us"?). If a client connects, a copy of the (latest configured) pointer will be stored within the VncState structure. For any keys sent by this client the own keyboard reference will be used.
As (in theory) every VNC client may have a differen keyboard layout, in my point of view it makes sense to attach the keyboard used for keysym2scancode() to the client context rather to the VNC server context. However as (most likely) all clients do have the same keyboard mapping it would be an overhead to parse and store the mapping list each time the client connects.
Now in my idea two mechanisms may change the behavior of the client keyboard.
1.) a qmp command was sent, that sets /configures for a particular/default keyboard.
2.) within the VNC protocol a "VNC_MSG_CLIENT_QEMU/VNC_MSG_CLIENT_QEMU_EXT_KEYBOARD_LAYOUT" message arrives
If the new keyboard was not already loaded and stored inside vs->vd->kbds , qemu initializes the new mapping. The affected VNC client (VncState) again stores the reference only.
This enables switching the keyboard layout during runtime as well as using multiple different keyboard layouts at atime.
Together with a corresponding patch I would also add a patch for libvncclient to have a reference implmentation for the integrated keyboard layout switching.
What are your thoughts about this kind of improvement?
Thanks,
Mario
next reply other threads:[~2019-05-03 11:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 11:47 Mario [this message]
2019-05-03 11:47 ` [Qemu-devel] Request for comment - dynamic VNC keyboard mapping Mario
2019-05-03 12:08 ` Daniel P. Berrangé
2019-05-03 12:08 ` Daniel P. Berrangé
2019-05-09 18:02 ` Daniel Henrique Barboza
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8C02D03E-96CD-414F-BC2C-C59972B26F94@kernelobjects.org \
--to=ml@kernelobjects.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).