From: Amos Kong <akong@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PULL 2/7] input: use kbd delays for send_key monitor command
Date: Fri, 26 Sep 2014 13:59:09 +0800 [thread overview]
Message-ID: <20140926055909.GB9752@air> (raw)
In-Reply-To: <1401867851-30064-3-git-send-email-kraxel@redhat.com>
On Wed, Jun 04, 2014 at 09:44:06AM +0200, Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> ui/input-legacy.c | 45 ++++++---------------------------------------
> 1 file changed, 6 insertions(+), 39 deletions(-)
>
> diff --git a/ui/input-legacy.c b/ui/input-legacy.c
> index 2a53860..3025f50 100644
> --- a/ui/input-legacy.c
> +++ b/ui/input-legacy.c
> @@ -74,27 +74,6 @@ int index_from_key(const char *key)
> return i;
> }
>
> -static KeyValue **keyvalues;
> -static int keyvalues_size;
> -static QEMUTimer *key_timer;
> -
> -static void free_keyvalues(void)
> -{
> - g_free(keyvalues);
> - keyvalues = NULL;
> - keyvalues_size = 0;
> -}
> -
> -static void release_keys(void *opaque)
> -{
> - while (keyvalues_size > 0) {
> - qemu_input_event_send_key(NULL, keyvalues[--keyvalues_size],
> - false);
> - }
> -
> - free_keyvalues();
> -}
> -
> static KeyValue *copy_key_value(KeyValue *src)
> {
> KeyValue *dst = g_new(KeyValue, 1);
> @@ -107,30 +86,18 @@ void qmp_send_key(KeyValueList *keys, bool has_hold_time, int64_t hold_time,
> {
> KeyValueList *p;
>
> - if (!key_timer) {
> - key_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, release_keys, NULL);
> - }
> -
> - if (keyvalues != NULL) {
> - timer_del(key_timer);
> - release_keys(NULL);
> - }
> -
> if (!has_hold_time) {
> - hold_time = 100;
> + hold_time = 0; /* use default */
> }
>
> for (p = keys; p != NULL; p = p->next) {
> qemu_input_event_send_key(NULL, copy_key_value(p->value), true);
> -
> - keyvalues = g_realloc(keyvalues, sizeof(KeyValue *) *
> - (keyvalues_size + 1));
> - keyvalues[keyvalues_size++] = copy_key_value(p->value);
> + qemu_input_event_send_key_delay(hold_time);
> + }
> + for (p = keys; p != NULL; p = p->next) {
Hi Gerd,
This patch caused a regression, it changed the releasing order
When we send a serial keys together, the right order should be:
press key1
press key2
press key3
release key3
release key2
release key1
We can check the events by shokey command in Linux.
This regression will caused "sendkey Alt-Ctrl-Delete" doesn't work on some guests.
Thanks, Amos
> + qemu_input_event_send_key(NULL, copy_key_value(p->value), false);
> + qemu_input_event_send_key_delay(hold_time);
> }
> -
> - /* delayed key up events */
> - timer_mod(key_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
> - muldiv64(get_ticks_per_sec(), hold_time, 1000));
> }
>
> static void legacy_kbd_event(DeviceState *dev, QemuConsole *src,
> --
> 1.8.3.1
>
--
Amos.
next prev parent reply other threads:[~2014-09-26 5:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 7:44 [Qemu-devel] [PULL 0/7] input patch queue Gerd Hoffmann
2014-06-04 7:44 ` [Qemu-devel] [PULL 1/7] input: add support for kbd delays Gerd Hoffmann
2014-06-04 7:44 ` [Qemu-devel] [PULL 2/7] input: use kbd delays for send_key monitor command Gerd Hoffmann
2014-09-26 5:59 ` Amos Kong [this message]
2014-06-04 7:44 ` [Qemu-devel] [PULL 3/7] input/curses: add kbd delay between keydown and keyup events Gerd Hoffmann
2014-06-04 7:44 ` [Qemu-devel] [PULL 4/7] input/vnc: use kbd delays in press_key Gerd Hoffmann
2014-06-04 7:44 ` [Qemu-devel] [PULL 5/7] docs/multiseat.txt: use autoseat Gerd Hoffmann
2014-06-04 7:44 ` [Qemu-devel] [PULL 6/7] docs/multiseat.txt: gtk joined the party Gerd Hoffmann
2014-06-04 7:44 ` [Qemu-devel] [PULL 7/7] docs/multiseat.txt: add note about spice Gerd Hoffmann
2014-06-05 18:15 ` [Qemu-devel] [PULL 0/7] input patch queue Peter Maydell
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=20140926055909.GB9752@air \
--to=akong@redhat.com \
--cc=aliguori@amazon.com \
--cc=kraxel@redhat.com \
--cc=lcapitulino@redhat.com \
--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).