From patchwork Mon Sep 5 12:47:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 1674246 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=LmzYnpGP; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MLpDm6snvz1yhd for ; Mon, 5 Sep 2022 22:46:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A8B084976; Mon, 5 Sep 2022 14:46:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="LmzYnpGP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A02284904; Mon, 5 Sep 2022 14:46:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (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 3F5C784904 for ; Mon, 5 Sep 2022 14:46:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pj1-x102a.google.com with SMTP id fv3so2228390pjb.0 for ; Mon, 05 Sep 2022 05:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date; bh=nxxHqT3LQmYnOzhmoQJ9it5hG8dE8c8+kpqf94HPN3Y=; b=LmzYnpGPJvn0G/Lh0dnHnw2B9qqMIGIalLJmddn4HGDW2IOte0PX7I1h5k8qg8AkOU TnQcr3/AtRIrwpVLIULrlo4h+1FOJdgyc2FwJ2vOmgyy5Nw1RCEMs2IZcWsVut4Thwpy bMOH6PAeFTesNYWicsy7GjvQx2FXvPzWsBz0jT089iHENVEMKNOOWiNKotne7PggKbwa FQntC1rTy9WSA+dNoPIQ8qGjUWeJUpskcPhuVTKx/H1B3XRX6KYGGZcfMdLkWL0vuy1w twW5pK7oe9tYGjchFXhe9kDPsmqJRo3mR19PSo+muQUFoz8BKygSyjsFpmWr8IChp89o qvHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=nxxHqT3LQmYnOzhmoQJ9it5hG8dE8c8+kpqf94HPN3Y=; b=dMg52DonPSa6GSt3RWQJVmPgCxFZHTx6uE7enaJwUYfa10PHsyh+9CIvpUDSBGH5YK SS5Pdpl6G4Znn0QiBxtWroa4CdJ5VwDezAXQ+NUrxEmRSe7wGPommugf67EvikGebsr7 dSd+ntIZAh9GImt9/VTteXJpQr805QnOt0M6idHdv0GpCiesAKJZClNQZmtfhTkTu5r8 6ICUXWGEAlJowXAb23fG0d4kP0LB4Hx35Q09OlGLeE9O2kbeRNWf2Hfrf6NSMR6zFQGE NqQxOtgrLEkX5FR8+kWvVSpkzJXMUSSNoa+mqLf+XPsK6HPt3OlE3A12mzasFnaku6Xq lOaA== X-Gm-Message-State: ACgBeo3dTOJjQtLK6hXQ36DeUe0jJTpVZn06/xmIcyRn1m7uHEJ4oEfV 2PH/X7tlfkJZMWt7FlkMcXH3Ro5zd0lw1w== X-Google-Smtp-Source: AA6agR7DGGUzUYJZZv9K8Q/TTQBXnZZHjxNRB2RSQjil3zVqOhA1KyTrljZVJVLsVlrdaebuaZEdEw== X-Received: by 2002:a17:902:da8a:b0:174:d3a4:2e41 with SMTP id j10-20020a170902da8a00b00174d3a42e41mr36916203plx.43.1662381972157; Mon, 05 Sep 2022 05:46:12 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id y64-20020a623243000000b0053639773ad8sm7660949pfy.119.2022.09.05.05.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 05:46:11 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Mark Kettenis , Masahisa Kojima Subject: [PATCH v16 03/10] menu: add KEY_PLUS, KEY_MINUS and KEY_SPACE handling Date: Mon, 5 Sep 2022 21:47:55 +0900 Message-Id: <20220905124803.2909-4-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220905124803.2909-1-masahisa.kojima@linaro.org> References: <20220905124803.2909-1-masahisa.kojima@linaro.org> 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.6 at phobos.denx.de X-Virus-Status: Clean This is preparation to support menu-driven UEFI BootOrder variable updated by KEY_PLUS, KEY_MINUS and KEY_SPACE. Signed-off-by: Masahisa Kojima Reviewed-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- No update since v11 Changes in v11: - add SPACE key handling Newly created in v7 common/menu.c | 9 +++++++++ include/menu.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/common/menu.c b/common/menu.c index 3e876b55b3..0d19601cf5 100644 --- a/common/menu.c +++ b/common/menu.c @@ -548,4 +548,13 @@ void bootmenu_loop(struct bootmenu_data *menu, /* ^C was pressed */ if (c == 0x3) *key = KEY_QUIT; + + if (c == '+') + *key = KEY_PLUS; + + if (c == '-') + *key = KEY_MINUS; + + if (c == ' ') + *key = KEY_SPACE; } diff --git a/include/menu.h b/include/menu.h index e74616cae8..702aacb170 100644 --- a/include/menu.h +++ b/include/menu.h @@ -48,6 +48,9 @@ enum bootmenu_key { KEY_DOWN, KEY_SELECT, KEY_QUIT, + KEY_PLUS, + KEY_MINUS, + KEY_SPACE, }; void bootmenu_autoboot_loop(struct bootmenu_data *menu,