From patchwork Fri Jan 30 03:58:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1785 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org Authentication-Results: mail.u-boot.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=DFtbbUeO; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2D24D697E0 for ; Thu, 29 Jan 2026 20:59:35 -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 sYVdWFC5OJg3 for ; Thu, 29 Jan 2026 20:59:35 -0700 (MST) Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1C6D7697CE for ; Thu, 29 Jan 2026 20:59:35 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2C587697E8 for ; Thu, 29 Jan 2026 20:59:32 -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 DzJQOCXf4dO4 for ; Thu, 29 Jan 2026 20:59:32 -0700 (MST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.161.51; helo=mail-oo1-f51.google.com; envelope-from=sjg@chromium.org; receiver=u-boot.org Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) by mail.u-boot.org (Postfix) with ESMTPS id 5C979697CB for ; Thu, 29 Jan 2026 20:59:26 -0700 (MST) Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-6611cab8ca3so989790eaf.3 for ; Thu, 29 Jan 2026 19:59:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1769745565; x=1770350365; darn=u-boot.org; 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=N6hYXefBTtIncmvmAWbpLQLrMp8FxfxXBQq4GLTbeJg=; b=DFtbbUeOlpjUka4WzQ3pNgc7Z2Tl2bjWgW1ouA9W3eOAz7glxzmgfAFiSHH8sUnQre wmZLpB+aThxar+anvH7xDQJkAlZE31uMGQ/o+BLpxmVJUXp3MlZTbcgQ1hmF0IidlrqL IwIiSj8VAQSGzsWmgFmOyGXM1/nCZAMEA1+kE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769745565; x=1770350365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=N6hYXefBTtIncmvmAWbpLQLrMp8FxfxXBQq4GLTbeJg=; b=Z8D7eskDyFb6NXmhtujuK69HXF5wFhUVGEwiB1y8AmGTgz8w3PBgEAOqjjpVOB+i09 PmDuEhbx0LpxwqTYdgVwpO5TDdJzP/+aFtnD73Kbkjzp37w6QM6iKkY66AfWY08ZiSj3 6yiregJfgPc3xbkGzQe4FDirSLnVIRBh0DjjNikKZGSOH/5nqCtDAKUPxVbbNlLyGm4F VNeIKn/fboU7OgLCZdKXmy6OKZXmWrqFrYpm+vg7jvhSBhUz7FAI8sPrQGAyPdf6qml5 gjA5UF/Ojyr+7XkXYrqQbn6WY3s6vuRBTgga0/55N8k6tsXDH7AZM2ixwh2MkrC3Azj8 h0KQ== X-Gm-Message-State: AOJu0Yx3qqkOS7GuWs2U8I/7jmG8vS6AtupZuATIPaGveWpk5BrvbnIk ZJtVkjLK6aLEbkNqqq+dSoAGdpXBTTVQ7VAMx0vk8jjb5SwI8/tPkNtmngAHkJnzlL4kHvwK9S8 2i6Ucbw== X-Gm-Gg: AZuq6aIpbZ+yb6R+M0pYOkQlut7K7duGm46C2x0mc9ArhmJBrHjDjPU/Gk1LhS3GA96 13FRn1Ih3w2h24EtVMpWKahJoOTD0qFTHnDP/NiNwU1AzOOjgx2QebhfLMtC8Jvvj0h7ckURIAb u0zIWEMj2YTfvYPy5bm/GBlDqDFvu/00MWGYiSxPNqGS1ti0SJcE0xNOB2nyxcUlyuR7kjT2heo aXCmeGBU6OYKia7+9MssMDNjvUffsgCCyPuTsOvthE9dUbgdxhq1/uXJ9lE23jw6iZLSsNVYMwX l87Szv5CVSiBuWxFIh3w0efED31MK9/hrtDopYoCKqiyMoW+M07BrgQ3TkM9MdxARUVx247qg8u ochTRsdoHe4aLVsitvmE39ZAuFYCH57Y7GHlNGrb3RT0DvGWnNmRLhaTBri2MiwM+RS5RsWSorz PkncNG4wpgfHSwMSR3 X-Received: by 2002:a05:6820:f024:b0:662:f0cb:84bf with SMTP id 006d021491bc7-6630f05112emr972435eaf.36.1769745565112; Thu, 29 Jan 2026 19:59:25 -0800 (PST) Received: from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-662f9a4e491sm4128687eaf.16.2026.01.29.19.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 19:59:24 -0800 (PST) From: Simon Glass X-Google-Original-From: Simon Glass To: U-Boot Concept Date: Thu, 29 Jan 2026 20:58:33 -0700 Message-ID: <20260130035849.3580212-11-simon.glass@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260130035849.3580212-1-simon.glass@canonical.com> References: <20260130035849.3580212-1-simon.glass@canonical.com> MIME-Version: 1.0 Message-ID-Hash: M2A2Z27VBEORUBEK6OF3E5I67ZRAZTCU X-Message-ID-Hash: M2A2Z27VBEORUBEK6OF3E5I67ZRAZTCU X-MailFrom: sjg@chromium.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: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/19] input: Add Ctrl+Shift+Z support for redo List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add support for detecting Ctrl+Shift+Z key combination in the input driver and generating the escape sequence ESC [ 1 ; 6 z which is then decoded by cli_getch.c to trigger redo. This requires tracking both Ctrl and Shift modifier state, so add MOD_SHIFT to the modifier flags. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/input/input.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 5d265837a25..683569f59a1 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -31,6 +31,7 @@ enum { /* Modifier bits for config->modifiers */ MOD_CTRL = 1 << 0, + MOD_SHIFT = 1 << 1, }; /* @@ -459,6 +460,23 @@ static int input_keycode_to_ansi364(struct input_config *config, } } + /* Handle Ctrl+Shift+Z for redo */ + if ((config->modifiers & (MOD_CTRL | MOD_SHIFT)) == + (MOD_CTRL | MOD_SHIFT) && keycode == KEY_Z) { + /* Generate ESC [ 1 ; 6 z for Ctrl+Shift+Z */ + const char *seq = "[1;6z"; + + ch_count = 0; + output_ch[ch_count++] = 0x1b; + while (*seq) { + if (ch_count < max_chars) + output_ch[ch_count] = *seq; + ch_count++; + seq++; + } + return ch_count; + } + for (i = ch_count = 0; i < ARRAY_SIZE(kbd_to_ansi364); i++) { if (keycode != kbd_to_ansi364[i].kbd_scan_code) continue; @@ -514,9 +532,11 @@ static int input_keycodes_to_ascii(struct input_config *config, table = process_modifier(config, key, keycode[i] & KEY_RELEASE); } - /* Track Ctrl state for special key handling */ + /* Track Ctrl and Shift state for special key handling */ if (key == KEY_LEFTCTRL || key == KEY_RIGHTCTRL) config->modifiers |= MOD_CTRL; + if (key == KEY_LEFTSHIFT || key == KEY_RIGHTSHIFT) + config->modifiers |= MOD_SHIFT; } /* Start conversion by looking for the first new keycode (by same). */