From nobody Tue Feb 10 04:29:45 2026 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523266985528160.37127198398366; Mon, 9 Apr 2018 02:43:05 -0700 (PDT) Received: from localhost ([::1]:51761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5TKK-0006uN-MQ for importer@patchew.org; Mon, 09 Apr 2018 05:43:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5TIP-0005dU-NX for qemu-devel@nongnu.org; Mon, 09 Apr 2018 05:41:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5TIL-0003ar-UO for qemu-devel@nongnu.org; Mon, 09 Apr 2018 05:41:05 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38688 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5TIL-0003aa-Px for qemu-devel@nongnu.org; Mon, 09 Apr 2018 05:41:01 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53E89401CC41 for ; Mon, 9 Apr 2018 09:41:01 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B6282024CA4; Mon, 9 Apr 2018 09:41:01 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 90B853EBB1; Mon, 9 Apr 2018 11:41:00 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 9 Apr 2018 11:40:57 +0200 Message-Id: <20180409094100.27650-4-kraxel@redhat.com> In-Reply-To: <20180409094100.27650-1-kraxel@redhat.com> References: <20180409094100.27650-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 09 Apr 2018 09:41:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 09 Apr 2018 09:41:01 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 3/6] sdl2: track kbd modifier state unconditionally 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" For both grapical and text consoles. Signed-off-by: Gerd Hoffmann Message-id: 20180321135041.15768-3-kraxel@redhat.com Signed-off-by: Gerd Hoffmann --- ui/sdl2-input.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/ui/sdl2-input.c b/ui/sdl2-input.c index 35d35c14c4..8d0d9ba17c 100644 --- a/ui/sdl2-input.c +++ b/ui/sdl2-input.c @@ -60,23 +60,7 @@ void sdl2_process_key(struct sdl2_console *scon, =20 qcode =3D qemu_input_map_usb_to_qcode[ev->keysym.scancode]; =20 - if (!qemu_console_is_graphic(con)) { - if (ev->type =3D=3D SDL_KEYDOWN) { - switch (ev->keysym.scancode) { - case SDL_SCANCODE_RETURN: - kbd_put_keysym_console(con, '\n'); - break; - case SDL_SCANCODE_BACKSPACE: - kbd_put_keysym_console(con, QEMU_KEY_BACKSPACE); - break; - default: - kbd_put_qcode_console(con, qcode, false); - break; - } - } - return; - } - + /* modifier state tracking */ switch (ev->keysym.scancode) { #if 0 case SDL_SCANCODE_NUMLOCKCLEAR: @@ -99,8 +83,27 @@ void sdl2_process_key(struct sdl2_console *scon, } else { modifiers_state[ev->keysym.scancode] =3D 1; } - /* fall though */ + break; default: + /* nothing */ + break; + } + + if (!qemu_console_is_graphic(con)) { + if (ev->type =3D=3D SDL_KEYDOWN) { + switch (ev->keysym.scancode) { + case SDL_SCANCODE_RETURN: + kbd_put_keysym_console(con, '\n'); + break; + case SDL_SCANCODE_BACKSPACE: + kbd_put_keysym_console(con, QEMU_KEY_BACKSPACE); + break; + default: + kbd_put_qcode_console(con, qcode, false); + break; + } + } + } else { qemu_input_event_send_key_qcode(con, qcode, ev->type =3D=3D SDL_KEYDOWN); } --=20 2.9.3