From nobody Sat Feb 7 08:13:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678811160; cv=none; d=zohomail.com; s=zohoarc; b=j0z8eb5PqANIM2FVAtNslN8QEg5D5i+i7gn2r98PrnIoE/xqGF/oh3KNdrmmv0ESo0wcThhmkXuBLgPMk9QHtJAs6mWat+KUYP48Kd+YusXEcPS7ad4dWZ7+XApg7QAKXOe0K73lBVU4f8AGTeGUGqPzz22wPmRHacza6MkiX4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678811160; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ih/6w4H6hHD/iCx/AvfJuJXmZZOwNOu437gWviSPGp0=; b=WbVqT28QQ6NmC71zy+EvWvn0+3/qm1cQKMPSj9TghXxmAndnqjsZFWAtlvOs/H+HPbIl5Xrz962z3vUovc0pzXHCPrvb3uqbWb6hCzbfW8a2An6Dn7nmGP+X+uXNJL+TItaKdKWdfpU4IMw6JQUkJ8k1ln18Y7bv+lT2POjeJMI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1678811160905302.91227643398884; Tue, 14 Mar 2023 09:26:00 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-369-k9UtUmEPP_K1lryvbPT6iA-1; Tue, 14 Mar 2023 12:25:55 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B1AC802D2E; Tue, 14 Mar 2023 16:25:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3887251FF; Tue, 14 Mar 2023 16:25:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 100B019465A2; Tue, 14 Mar 2023 16:25:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 894D519465A0 for ; Tue, 14 Mar 2023 16:25:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6FAA64042AC6; Tue, 14 Mar 2023 16:25:48 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 616C14042AC2; Tue, 14 Mar 2023 16:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678811159; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Ih/6w4H6hHD/iCx/AvfJuJXmZZOwNOu437gWviSPGp0=; b=U9DmXRUwWsBUPyRvjmOkbEMuAj3oniT5VPyITpJkYaZRjxqAQq7yt+sfIikCkKLr3ucw0K u6otRcKrb5vHlv565FB7vJTD04SAXCvFZTSAOSVHcrDHDwBVVgEkE6ABUz/tfSoCkoivDt ImYlHRXwlZIsBvP49FuV0oS/nomzv3I= X-MC-Unique: k9UtUmEPP_K1lryvbPT6iA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 2/3] ps2: Don't send key release event for Lang1, Lang2 keys Date: Tue, 14 Mar 2023 16:25:39 +0000 Message-Id: <20230314162540.385954-3-berrange@redhat.com> In-Reply-To: <20230314162540.385954-1-berrange@redhat.com> References: <20230314162540.385954-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, libvir-list@redhat.com, Peter Lieven , Markus Armbruster , Ross Lagerwall , Hanna Reitz , Gerd Hoffmann , Ronnie Sahlberg , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678811162477100001 From: Ross Lagerwall The scancodes for the Lang1 and Lang2 keys (i.e. Hangeul, Hanja) are special since they already have the 0x80 bit set which is commonly used to indicate a key release in AT set 1. Reportedly, real hardware does not send a key release scancode. So, skip sending a release for these keys. This ensures that Windows behaves correctly and interprets it as a single keypress rather than two consecutive keypresses. Signed-off-by: Ross Lagerwall Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/input/ps2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 3253ab6a92..45af76a837 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -402,6 +402,9 @@ static void ps2_keyboard_event(DeviceState *dev, QemuCo= nsole *src, ps2_put_keycode(s, 0xaa); } } + } else if ((qcode =3D=3D Q_KEY_CODE_LANG1 || qcode =3D=3D Q_KEY_CO= DE_LANG2) + && !key->down) { + /* Ignore release for these keys */ } else { if (qcode < qemu_input_map_qcode_to_atset1_len) { keycode =3D qemu_input_map_qcode_to_atset1[qcode]; @@ -497,6 +500,9 @@ static void ps2_keyboard_event(DeviceState *dev, QemuCo= nsole *src, ps2_put_keycode(s, 0x12); } } + } else if ((qcode =3D=3D Q_KEY_CODE_LANG1 || qcode =3D=3D Q_KEY_CO= DE_LANG2) && + !key->down) { + /* Ignore release for these keys */ } else { if (qcode < qemu_input_map_qcode_to_atset2_len) { keycode =3D qemu_input_map_qcode_to_atset2[qcode]; --=20 2.39.2