From patchwork Sun Dec 7 20:16:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 831 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138688; bh=3wkkZm6km8RHmD7/Ird5j4eL2vM0wuU6efqc/LEqQkI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=n9QsAwczZ467gofMzBxoyaphg2ZLrIWx5DZ3MZFuzpUeC3LPoLY1BsejG51U6bNmf 73a0HNCNfb22Ctypo2P74jca1eW/PC25xpUziV8AzJFEbfevZGCB9nRt5auEciUE/Q kuJMJM6FO/ABuqOg9Fa6SHKM+DykC+IsL1FdY+VLeWiUSGvXykJoiZnkb9Hm1QnTtq ZWYA6S6muD+dSta2ubjLb1MFyG6jfqes6gANpgk+mrpOpaTsVDJy5BzVr6Q6EcNP6l F4IUGA4KVHU8chchLBS7rvHoLE905MLPLOiHCsGprIHIESopKGQ/h8jy//Pc3WzVvq fT9Rlntn/EUAw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 68109689B4 for ; Sun, 7 Dec 2025 13:18:08 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id xp29S08Y-ese for ; Sun, 7 Dec 2025 13:18:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138688; bh=3wkkZm6km8RHmD7/Ird5j4eL2vM0wuU6efqc/LEqQkI=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=n9QsAwczZ467gofMzBxoyaphg2ZLrIWx5DZ3MZFuzpUeC3LPoLY1BsejG51U6bNmf 73a0HNCNfb22Ctypo2P74jca1eW/PC25xpUziV8AzJFEbfevZGCB9nRt5auEciUE/Q kuJMJM6FO/ABuqOg9Fa6SHKM+DykC+IsL1FdY+VLeWiUSGvXykJoiZnkb9Hm1QnTtq ZWYA6S6muD+dSta2ubjLb1MFyG6jfqes6gANpgk+mrpOpaTsVDJy5BzVr6Q6EcNP6l F4IUGA4KVHU8chchLBS7rvHoLE905MLPLOiHCsGprIHIESopKGQ/h8jy//Pc3WzVvq fT9Rlntn/EUAw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 56C0E689A8 for ; Sun, 7 Dec 2025 13:18:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138686; bh=wMHb0QeqFToAiF17wEOm4neqza+IkBHttXU+HG7bic8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SYONwTs8GbZHRzLg2PFtw6oi2PiQCWSj/juOWq2Ml0ZAtVOQZg5iTIRosq+eiFVlg dERvBl6KdORRvjya8kGuE77FZ3Zl/VaDC8PWA3ZAi4EjqLKVdAnKvrUH982lmdbu6D GTOPda/72a6+me9q51tcE2fLKNfGyFSfwggC4zFdZxX2j6tbLQ2hIKSmedeZn2ZTJm 9q19Jqqk9woByVv60Xshe1JJsFVeKwyRM1X1x/zfXIIrrpwQrr7bFLzCg2+Cxxyouj uT18plY+LjXIT/VXsQuBZV3d2jyUrIHtYnuFjGiSgFSAowcE6LXKbegLgg4BBuL+9K u2ptYuWoYE91Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5956D688F6; Sun, 7 Dec 2025 13:18:06 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id bWSZr4vRKuSz; Sun, 7 Dec 2025 13:18:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138681; bh=wWGRxfgivXq+DKb6X3j+uFuSyjAqlewM74pifaUQU1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eu44uIMrN8SxH8kTc37jaRAC2LGbZ/ZTq3RwUt+uwQgN8MyO/vsRoDojA1HTTd9E0 34bw8uMGHFzNk86kKkNwoGyA2MjefBDectCt/Yvk+Ez8dEK9V+XiaUUj2Pha0dinJj 2RayKioUN2Ke4Q5Uemm/WCnBbnfRDE4rrl2JhIU0ofYteMBzaZExFZbwudtpmEPxTx g4SDoxG66Maa97/rlPRF0/HCivaYe2iJt7MWIC1yH3sZwybDTXU7ePdr+GIfGPnEy4 kdy6y2I8bOUO6I5zKhu0F7iIrLzWe1jAOOH6/n9WsCgpybyPAK2VlAsupZXymDuq6a VALfgU8S5jn8Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5EEC05F6BF; Sun, 7 Dec 2025 13:18:01 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:16 -0700 Message-ID: <20251207201628.2882382-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: FA6KQ3JVO5DN7D3VTGFMJL4FS2KNEEHO X-Message-ID-Hash: FA6KQ3JVO5DN7D3VTGFMJL4FS2KNEEHO X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 19/22] menu: Start bootmenu_key values at 0x100 List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass At present the backspace key (Ctrl-B) has the same value as BKEY_UP, which means the keys are ambiguous. This causes problems when trying to edit a textline. The same problem applies to other keys used in cread_line_process_ch() Start the bootmenu_key enum values at 0x100 to avoid this collision. Keep BKEY_NONE as 0, since it is a sentinel value. Co-developed-by: Claude Signed-off-by: Simon Glass --- include/menu.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/menu.h b/include/menu.h index 6cede89b950..9914e680307 100644 --- a/include/menu.h +++ b/include/menu.h @@ -45,10 +45,16 @@ struct bootmenu_data { struct bootmenu_entry *first; /* first menu entry */ }; -/** enum bootmenu_key - keys that can be returned by the bootmenu */ +/** + * enum bootmenu_key - keys that can be returned by the bootmenu + * + * These values start at 0x100 to avoid colliding with ASCII control characters + * (0x01-0x1f) which are used for editing operations in textlines. BKEY_NONE is + * kept at 0 as a sentinel value. + */ enum bootmenu_key { BKEY_NONE = 0, - BKEY_UP, + BKEY_UP = 0x100, BKEY_DOWN, BKEY_SELECT, BKEY_QUIT,