From patchwork Thu Nov 2 17:18:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang Yan X-Patchwork-Id: 10039049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C48A3600C5 for ; Thu, 2 Nov 2017 17:19:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABA9E29211 for ; Thu, 2 Nov 2017 17:19:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA6862923B; Thu, 2 Nov 2017 17:19:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5907B29211 for ; Thu, 2 Nov 2017 17:19:51 +0000 (UTC) Received: from localhost ([::1]:33245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAJ9i-00080T-4K for patchwork-qemu-devel@patchwork.kernel.org; Thu, 02 Nov 2017 13:19:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAJ90-00080B-2S for qemu-devel@nongnu.org; Thu, 02 Nov 2017 13:19:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eAJ8v-0006ib-Ok for qemu-devel@nongnu.org; Thu, 02 Nov 2017 13:19:05 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:56657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eAJ8v-0006gu-ET; Thu, 02 Nov 2017 13:19:01 -0400 Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Thu, 02 Nov 2017 18:18:58 +0100 Received: from linux-cj2a.gns.novell.com (nwb-a10-snat.microfocus.com [10.120.13.202]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Thu, 02 Nov 2017 17:18:52 +0000 From: Liang Yan To: sstabellini@kernel.org, anthony.perard@citrix.com, xen-devel@lists.xenproject.org, qemu-devel@nongnu.org Date: Thu, 2 Nov 2017 13:18:46 -0400 Message-Id: <20171102171846.21445-1-lyan@suse.com> X-Mailer: git-send-email 2.14.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.135.221.5 Subject: [Qemu-devel] [PATCH v2] hw/display/xenfb: Simulate auto-repeat key events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP New tigervnc changes the way to send long pressed key, from "down up down up ..." to "down down ... up", it only affects xen pv console mode. I send a patch to latest kernel side, but it may have a fix in qemu backend for back compatible becase guest VMs may use very old kernel. This patch inserts an up event after each regular key down event to simulate an auto-repeat key event for xen keyboard frontend driver. Signed-off-by: Liang Yan --- v2: - exclude extended key - change log comment hw/display/xenfb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 8e2547ac05..1bc5b41ab7 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -292,6 +292,11 @@ static void xenfb_key_event(void *opaque, int scancode) } trace_xenfb_key_event(opaque, scancode2linux[scancode], down); xenfb_send_key(xenfb, down, scancode2linux[scancode]); + + /* insert an up event for regular down key event */ + if (down && !xenfb->extended) { + xenfb_send_key(xenfb, 0, scancode2linux[scancode]); + } } /*