linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Liang Yan <lyan@suse.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] input/xen-kbdfront: Enable auto repeat for xen keyboard frontend driver
Date: Mon, 28 Aug 2017 09:42:26 -0700	[thread overview]
Message-ID: <20170828164226.GC12195@dtor-ws> (raw)
In-Reply-To: <20170824135414.4870-1-lyan@suse.com>

On Thu, Aug 24, 2017 at 09:54:14AM -0400, Liang Yan wrote:
> Long pressed key could not show right in XEN vncviewer after tigervnc
> client changed the way how to send repeat keys, from "Down Up Down Up
> ..." to "Down Down ... Up". This will report autorepeat to input by
> checking if same key being pressed, and let handler process it finally.
> 
> Signed-off-by: Liang Yan <lyan@suse.com>
> ---
> v2:
> - Sending autorepeat event rather than enable EV_REP bit 

Applied, thank you.

> 
> drivers/input/misc/xen-kbdfront.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
> index fa130e7b734c..6bf56bb5f8d9 100644
> --- a/drivers/input/misc/xen-kbdfront.c
> +++ b/drivers/input/misc/xen-kbdfront.c
> @@ -84,17 +84,20 @@ static void xenkbd_handle_key_event(struct xenkbd_info *info,
>  				    struct xenkbd_key *key)
>  {
>  	struct input_dev *dev;
> +	int value = key->pressed;
>  
>  	if (test_bit(key->keycode, info->ptr->keybit)) {
>  		dev = info->ptr;
>  	} else if (test_bit(key->keycode, info->kbd->keybit)) {
>  		dev = info->kbd;
> +		if (key->pressed && test_bit(key->keycode, info->kbd->key))
> +			value = 2; /* Mark as autorepeat */
>  	} else {
>  		pr_warn("unhandled keycode 0x%x\n", key->keycode);
>  		return;
>  	}
>  
> -	input_report_key(dev, key->keycode, key->pressed);
> +	input_event(dev, EV_KEY, key->keycode, value);
>  	input_sync(dev);
>  }
>  
> -- 
> 2.14.1
> 

-- 
Dmitry

      reply	other threads:[~2017-08-28 16:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24 13:54 [PATCH v2] input/xen-kbdfront: Enable auto repeat for xen keyboard frontend driver Liang Yan
2017-08-28 16:42 ` Dmitry Torokhov [this message]

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=20170828164226.GC12195@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyan@suse.com \
    /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).