Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6F6FEB64D9 for ; Sat, 17 Jun 2023 10:51:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B8F4686306; Sat, 17 Jun 2023 12:50:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Q3zBpzps"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF1CC862FA; Sat, 17 Jun 2023 12:50:23 +0200 (CEST) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0FB1C862F1 for ; Sat, 17 Jun 2023 12:50:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f8d65ecdbbso12255965e9.0 for ; Sat, 17 Jun 2023 03:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1686999020; x=1689591020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ATKENVqgkhfYYW2DieCHQZ8dZA7J5h366yGQwujwv8w=; b=Q3zBpzpsXLB6mZehcqL3zSw2VI56iMW+4F4ogNcCyk/7PzAahlSND5tfot4ZlCPy8b KtGJVTYiWVqKO6tJRUQ17TZHcM+72AsQtSiRQyJMk0pA5gIOH1yGpXVjWqzEygTvW7ML c0FT6hq1AmIuNEmKGHLDrAuvoAGCHAVkG/JIk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686999020; x=1689591020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ATKENVqgkhfYYW2DieCHQZ8dZA7J5h366yGQwujwv8w=; b=jqUFtXHc4VXkDmk0elJVrEWc/NkUIW74d4lVcjVn2M0gx4t5tkjue8t0bNxP38RJho anDakYxINPrxQOfDZvcKbVX5jODpRIlfUnS0nFY4swdDj5UDByLZzIfyhAguTV3mbqIA Z3R3kobEoFAXRLgAk8eqU55CF9tRUInH+AdwmDPItPFsvOmbN7b40GmFiUiPbwFAzZAQ p+dVFL9pUJhQwb/4W7Cno3rCnU+jKsF9cY/pzzejunalQhaLEApSoA0D7tCjyPnb0DZO 1QvDwaDTz2ZlmXNoeOk/MI0if29KgP3WDpwkq6iS7KmX0GJfNKwF2HZAxLAWuvFLisxB 9QRw== X-Gm-Message-State: AC+VfDzq/dwmaS4cW0J5zBZ6GUtn+yBVkMHhc++k+N4a2BJr1po7cxuG lmcw+GJ4v9yXxJe1IiiFn+fxhQnLFmQGvuWf/g4= X-Google-Smtp-Source: ACHHUZ7ReNO7dSCmkEGcMCW5xbP7qUOv93NYo1iV81BPpuGgIeiVb0UwacDy2DP4C6+4nMsMD7dtgQ== X-Received: by 2002:a7b:c3d5:0:b0:3f7:38e1:5e53 with SMTP id t21-20020a7bc3d5000000b003f738e15e53mr3452938wmj.4.1686999020509; Sat, 17 Jun 2023 03:50:20 -0700 (PDT) Received: from sjg1.roam.corp.google.com (79-67-123-132.dynamic.dsl.as9105.com. [79.67.123.132]) by smtp.gmail.com with ESMTPSA id l22-20020a7bc356000000b003f7e4d143cfsm4735171wmj.15.2023.06.17.03.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jun 2023 03:50:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: =?UTF-8?q?Pali=20Roh=C3=A1r?= , Simon Glass Subject: [PATCH 3/6] bootmenu: Cancel delay only when a real key is pressed Date: Sat, 17 Jun 2023 11:49:50 +0100 Message-ID: <20230617104956.1402370-4-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog In-Reply-To: <20230617104956.1402370-1-sjg@chromium.org> References: <20230617104956.1402370-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean We need to decode the input character before deciding if it is a real key, or just part of an escape sequence. Check this. Signed-off-by: Simon Glass --- common/menu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/menu.c b/common/menu.c index b55cf7b99967..c81494b3d1f3 100644 --- a/common/menu.c +++ b/common/menu.c @@ -446,11 +446,14 @@ enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu, continue; } - menu->delay = -1; c = getchar(); ichar = cli_ch_process(cch, c); + if (!ichar) + continue; + menu->delay = -1; + switch (ichar) { case '\0': key = BKEY_NONE; -- 2.41.0.162.gfafddb0af9-goog