From nobody Wed May 1 04:51:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501246875886198.50702799059025; Fri, 28 Jul 2017 06:01:15 -0700 (PDT) Received: from localhost ([::1]:48239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db4tF-0006Yu-EM for importer@patchew.org; Fri, 28 Jul 2017 09:01:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db4rw-0005ml-Av for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:59:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db4rl-0008Ku-Eu for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:59:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db4rl-0008KD-5j for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:59:41 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3F81ADA1F for ; Fri, 28 Jul 2017 12:59:39 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-225.ams2.redhat.com [10.36.116.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8F2E6F42B; Fri, 28 Jul 2017 12:59:37 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 639433B2; Fri, 28 Jul 2017 14:59:35 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F3F81ADA1F Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 28 Jul 2017 14:59:33 +0200 Message-Id: <20170728125935.18167-2-kraxel@redhat.com> In-Reply-To: <20170728125935.18167-1-kraxel@redhat.com> References: <20170728125935.18167-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 28 Jul 2017 12:59:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/3] ui: correctly detect spice PAUSE scancode sequence 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: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" The SPICE input code is currently detcting 0xe1 0x1d 0x45 as the PAUSE key make sequence and 0xe1 0x9d 0xc5 as the break sequence. This is incorrect, because all 6 scancodes together are the make sequence, and there is no break sequence. Signed-off-by: Daniel P. Berrange Message-id: 20170727174640.30359-1-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- ui/spice-input.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/ui/spice-input.c b/ui/spice-input.c index cda9976469..3d41aa1831 100644 --- a/ui/spice-input.c +++ b/ui/spice-input.c @@ -50,6 +50,7 @@ static const SpiceKbdInterface kbd_interface =3D { =20 static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode) { + static const uint8_t pauseseq[] =3D { 0xe1, 0x1d, 0x45, 0xe1, 0x9d, 0x= c5 }; QemuSpiceKbd *kbd =3D container_of(sin, QemuSpiceKbd, sin); int keycode; bool up; @@ -58,6 +59,18 @@ static void kbd_push_key(SpiceKbdInstance *sin, uint8_t = scancode) kbd->emul0 =3D true; return; } + + if (scancode =3D=3D pauseseq[kbd->pauseseq]) { + kbd->pauseseq++; + if (kbd->pauseseq =3D=3D G_N_ELEMENTS(pauseseq)) { + qemu_input_event_send_key_qcode(NULL, Q_KEY_CODE_PAUSE, true); + kbd->pauseseq =3D 0; + } + return; + } else { + kbd->pauseseq =3D 0; + } + keycode =3D scancode & ~SCANCODE_UP; up =3D scancode & SCANCODE_UP; if (kbd->emul0) { @@ -65,25 +78,6 @@ static void kbd_push_key(SpiceKbdInstance *sin, uint8_t = scancode) keycode |=3D SCANCODE_GREY; } =20 - if (scancode =3D=3D SCANCODE_EMUL1) { - kbd->pauseseq++; - return; - } else if (kbd->pauseseq =3D=3D 1) { - if (keycode =3D=3D 0x1d) { - kbd->pauseseq++; - return; - } else { - kbd->pauseseq =3D 0; - } - } else if (kbd->pauseseq =3D=3D 2) { - if (keycode =3D=3D 0x45) { - qemu_input_event_send_key_qcode(NULL, Q_KEY_CODE_PAUSE, !up); - kbd->pauseseq =3D 0; - return; - } - kbd->pauseseq =3D 0; - } - qemu_input_event_send_key_number(NULL, keycode, !up); } =20 --=20 2.9.3 From nobody Wed May 1 04:51:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501246977987606.3710708128732; Fri, 28 Jul 2017 06:02:57 -0700 (PDT) Received: from localhost ([::1]:48254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db4us-0007fP-Jf for importer@patchew.org; Fri, 28 Jul 2017 09:02:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db4rw-0005mm-BN for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db4rm-0008Lb-CV for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:59:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54864) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db4rm-0008Kj-0L for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:59:42 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7C848E386 for ; Fri, 28 Jul 2017 12:59:40 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-225.ams2.redhat.com [10.36.116.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBB317767A; Fri, 28 Jul 2017 12:59:37 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6C3303B8; Fri, 28 Jul 2017 14:59:35 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D7C848E386 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 28 Jul 2017 14:59:34 +0200 Message-Id: <20170728125935.18167-3-kraxel@redhat.com> In-Reply-To: <20170728125935.18167-1-kraxel@redhat.com> References: <20170728125935.18167-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 28 Jul 2017 12:59:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/3] ui: drop ac_search and ac_stop 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: Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Both keys exist already: "ac_search" is "find" and "ac_stop" is "stop". Fixes: 37810e80553c19f0dac3644924895a9bf5c70785 Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrange Message-id: 20170728063415.27480-1-kraxel@redhat.com --- hw/input/ps2.c | 8 ++++---- ui/input-keymap.c | 8 ++++---- qapi-schema.json | 5 +---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 9f057e46ea..77906d5f46 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -239,11 +239,11 @@ static const uint16_t qcode_to_keycode_set1[Q_KEY_COD= E__MAX] =3D { [Q_KEY_CODE_MAIL] =3D 0xe06c, [Q_KEY_CODE_CALCULATOR] =3D 0xe021, [Q_KEY_CODE_COMPUTER] =3D 0xe06b, - [Q_KEY_CODE_AC_SEARCH] =3D 0xe065, + [Q_KEY_CODE_FIND] =3D 0xe065, [Q_KEY_CODE_AC_HOME] =3D 0xe032, [Q_KEY_CODE_AC_BACK] =3D 0xe06a, [Q_KEY_CODE_AC_FORWARD] =3D 0xe069, - [Q_KEY_CODE_AC_STOP] =3D 0xe068, + [Q_KEY_CODE_STOP] =3D 0xe068, [Q_KEY_CODE_AC_REFRESH] =3D 0xe067, [Q_KEY_CODE_AC_BOOKMARKS] =3D 0xe066, =20 @@ -379,11 +379,11 @@ static const uint16_t qcode_to_keycode_set2[Q_KEY_COD= E__MAX] =3D { [Q_KEY_CODE_MAIL] =3D 0xe048, [Q_KEY_CODE_CALCULATOR] =3D 0xe02b, [Q_KEY_CODE_COMPUTER] =3D 0xe040, - [Q_KEY_CODE_AC_SEARCH] =3D 0xe010, + [Q_KEY_CODE_FIND] =3D 0xe010, [Q_KEY_CODE_AC_HOME] =3D 0xe03a, [Q_KEY_CODE_AC_BACK] =3D 0xe038, [Q_KEY_CODE_AC_FORWARD] =3D 0xe030, - [Q_KEY_CODE_AC_STOP] =3D 0xe028, + [Q_KEY_CODE_STOP] =3D 0xe028, [Q_KEY_CODE_AC_REFRESH] =3D 0xe020, [Q_KEY_CODE_AC_BOOKMARKS] =3D 0xe018, =20 diff --git a/ui/input-keymap.c b/ui/input-keymap.c index 0d9ddde9c9..cdad5652d3 100644 --- a/ui/input-keymap.c +++ b/ui/input-keymap.c @@ -123,13 +123,13 @@ static int linux_to_qcode[KEY_CNT] =3D { [KEY_MAIL] =3D Q_KEY_CODE_MAIL, [KEY_COMPUTER] =3D Q_KEY_CODE_COMPUTER, =20 - [KEY_STOP] =3D Q_KEY_CODE_AC_STOP, + [KEY_STOP] =3D Q_KEY_CODE_STOP, [KEY_BOOKMARKS] =3D Q_KEY_CODE_AC_BOOKMARKS, [KEY_BACK] =3D Q_KEY_CODE_AC_BACK, [KEY_FORWARD] =3D Q_KEY_CODE_AC_FORWARD, [KEY_HOMEPAGE] =3D Q_KEY_CODE_AC_HOME, [KEY_REFRESH] =3D Q_KEY_CODE_AC_REFRESH, - [KEY_FIND] =3D Q_KEY_CODE_AC_SEARCH, + [KEY_FIND] =3D Q_KEY_CODE_FIND, =20 [KEY_NEXTSONG] =3D Q_KEY_CODE_AUDIONEXT, [KEY_PREVIOUSSONG] =3D Q_KEY_CODE_AUDIOPREV, @@ -279,13 +279,13 @@ static const int qcode_to_number[] =3D { [Q_KEY_CODE_MAIL] =3D 0xec, [Q_KEY_CODE_COMPUTER] =3D 0xeb, =20 - [Q_KEY_CODE_AC_STOP] =3D 0xe8, + [Q_KEY_CODE_STOP] =3D 0xe8, [Q_KEY_CODE_AC_BOOKMARKS] =3D 0xe6, [Q_KEY_CODE_AC_BACK] =3D 0xea, [Q_KEY_CODE_AC_FORWARD] =3D 0xe9, [Q_KEY_CODE_AC_HOME] =3D 0xb2, [Q_KEY_CODE_AC_REFRESH] =3D 0xe7, - [Q_KEY_CODE_AC_SEARCH] =3D 0xe5, + [Q_KEY_CODE_FIND] =3D 0xe5, =20 [Q_KEY_CODE_AUDIONEXT] =3D 0x99, [Q_KEY_CODE_AUDIOPREV] =3D 0x90, diff --git a/qapi-schema.json b/qapi-schema.json index dcc12c83a9..c96f0a26f6 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4856,11 +4856,9 @@ # @mail: since 2.10 # @calculator: since 2.10 # @computer: since 2.10 -# @ac_search: since 2.10 # @ac_home: since 2.10 # @ac_back: since 2.10 # @ac_forward: since 2.10 -# @ac_stop: since 2.10 # @ac_refresh: since 2.10 # @ac_bookmarks: since 2.10 # altgr, altgr_r: dropped in 2.10 @@ -4890,8 +4888,7 @@ 'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute= ', 'volumeup', 'volumedown', 'mediaselect', 'mail', 'calculator', 'computer', - 'ac_search', 'ac_home', 'ac_back', 'ac_forward', 'ac_stop', - 'ac_refresh', 'ac_bookmarks' ] } + 'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmark= s' ] } =20 ## # @KeyValue: --=20 2.9.3 From nobody Wed May 1 04:51:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501246978956920.8433615426765; Fri, 28 Jul 2017 06:02:58 -0700 (PDT) Received: from localhost ([::1]:48256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db4ut-0007gE-Ir for importer@patchew.org; Fri, 28 Jul 2017 09:02:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db4ry-0005nn-0f for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:59:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db4ro-0008Oy-Ls for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:59:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51452) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db4ro-0008NQ-CS for qemu-devel@nongnu.org; Fri, 28 Jul 2017 08:59:44 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3730CB7CC2 for ; Fri, 28 Jul 2017 12:59:43 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-225.ams2.redhat.com [10.36.116.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id 702E470919; Fri, 28 Jul 2017 12:59:42 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 730063B9; Fri, 28 Jul 2017 14:59:35 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3730CB7CC2 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 28 Jul 2017 14:59:35 +0200 Message-Id: <20170728125935.18167-4-kraxel@redhat.com> In-Reply-To: <20170728125935.18167-1-kraxel@redhat.com> References: <20170728125935.18167-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 28 Jul 2017 12:59:43 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/3] ui: add pause key to linux_to_qcode 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: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrange Message-id: 20170728063432.27578-1-kraxel@redhat.com --- ui/input-keymap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/input-keymap.c b/ui/input-keymap.c index cdad5652d3..cf979c2ce9 100644 --- a/ui/input-keymap.c +++ b/ui/input-keymap.c @@ -116,6 +116,7 @@ static int linux_to_qcode[KEY_CNT] =3D { [KEY_LEFTMETA] =3D Q_KEY_CODE_META_L, [KEY_RIGHTMETA] =3D Q_KEY_CODE_META_R, [KEY_MENU] =3D Q_KEY_CODE_MENU, + [KEY_PAUSE] =3D Q_KEY_CODE_PAUSE, =20 [KEY_SLEEP] =3D Q_KEY_CODE_SLEEP, [KEY_WAKEUP] =3D Q_KEY_CODE_WAKE, --=20 2.9.3