From patchwork Thu Aug 24 13:54:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang Yan X-Patchwork-Id: 110911 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp5709412qge; Thu, 24 Aug 2017 06:54:36 -0700 (PDT) X-Received: by 10.99.140.74 with SMTP id q10mr6216328pgn.419.1503582876858; Thu, 24 Aug 2017 06:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503582876; cv=none; d=google.com; s=arc-20160816; b=r7/aVciKhu+9MLXFvI1Lply6TXkQHltleQlr8HbWowiscbhCgh8j+09Ox+Z/UCUi07 20uY6hhSJKlZ6AP20DuwlR9U9LrSoSSrWNGEIayZlxLR/056k+dPIRPp72aNNnQ1oa2A qe6NeYMnYYm/rAm3xoUoIbRm6QPPmu4NrRoPUJCK6fhtUkirIDWK37Etb+WmGnCl06pm Fftfq/5yWesLpKAThhPGxx9Jg731B2mRiTrJoo2zPDsYy2LBEdmNfJRGpI/U1rnx+LDd 2/eU4YGPcyvMQ0rDNq8GKcdW4piGI84s2G+heMIrAYv41I9YTs+CAZW1aAaUf1FmBa9h fJsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=VWzs382nodK9SAyXIfFsITs8Ii+vSr2tf12d3Ig55Fk=; b=MMnVD99sW4c2IWtdLwV/H7jCpvJcsVt22r94npBnP3D0W2fWf6xvpViBWBQttFSPpu qppgLarXTlvflztrRv5OfixRv3bCLm0EBXAxJRUmD2dUE3BaVDM9cb7FL1togvHlYSag wm2FWHb5hKaWTRGr6MdJ5eebqOhm24EwWU4HHgSsaBZi7eCnY8mJVXd8sB+ProcY8QVB +TI1jEhFOz+jxhgSAtdgnKDj9NgxKuWIJBza2dfBdC+Yb1H6c2JsiGJPP7QE0mco7muz zTGx0KjX8r0rDn/uOI480KlmY4vl6hUEb/CWMkMUfisQK5FgM5Nt4/pEwt889cCQcUib kHYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s137si2793050pgs.419.2017.08.24.06.54.36 for ; Thu, 24 Aug 2017 06:54:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752634AbdHXNyf (ORCPT ); Thu, 24 Aug 2017 09:54:35 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:59567 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbdHXNye (ORCPT ); Thu, 24 Aug 2017 09:54:34 -0400 Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Thu, 24 Aug 2017 15:54:33 +0200 Received: from linux-gp66.suse.de (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Thu, 24 Aug 2017 14:54:23 +0100 From: Liang Yan To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] input/xen-kbdfront: Enable auto repeat for xen keyboard frontend driver Date: Thu, 24 Aug 2017 09:54:14 -0400 Message-Id: <20170824135414.4870-1-lyan@suse.com> X-Mailer: git-send-email 2.14.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- v2: - Sending autorepeat event rather than enable EV_REP bit drivers/input/misc/xen-kbdfront.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); }