mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nir Lichtman <nir@lichtman.org>
To: jason.wessel@windriver.com, daniel.thompson@linaro.org,
	dianders@chromium.org, linux-kernel@vger.kernel.org
Subject: [PATCH] kdb: fix ctrl+e/a/f/b/d/p/n broken in keyboard mode
Date: Fri, 8 Nov 2024 22:11:16 +0000	[thread overview]
Message-ID: <20241108221116.GA123748@lichtman.org> (raw)

Problem: When using KDB via keyboard it does not react to control
characters which are supported in serial mode.

Example: Chords such as CTRL+A/E/D/P do not work in keyboard mode

Solution: Before disregarding a non-printable key character, check if it
is one of the supported control characters, I have took the control
characters from the switch case upwards in this function that translates
scan codes of arrow keys/backspace/home/.. to the control characters.
I have took them all besides the TAB control character translation (I am
not sure what that maps to on the keyboard)

---
 kernel/debug/kdb/kdb_keyboard.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/debug/kdb/kdb_keyboard.c b/kernel/debug/kdb/kdb_keyboard.c
index 3c2987f46f6e..2c004abd5375 100644
--- a/kernel/debug/kdb/kdb_keyboard.c
+++ b/kernel/debug/kdb/kdb_keyboard.c
@@ -172,6 +172,9 @@ int kdb_get_kbd_char(void)
 	switch (KTYP(keychar)) {
 	case KT_LETTER:
 	case KT_LATIN:
+		if (keychar == 4 || keychar == 1 || keychar == 5 || keychar == 2 ||
+		    keychar == 16 || keychar == 14 || keychar == 6)
+			return keychar;		/* non-printable supported control characters (e.g. CTRL+A) */
 		if (isprint(keychar))
 			break;		/* printable characters */
 		fallthrough;
-- 
2.39.2


             reply	other threads:[~2024-11-08 22:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 22:11 Nir Lichtman [this message]
2024-11-09  0:31 ` Doug Anderson
2024-11-09  7:35   ` Nir Lichtman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241108221116.GA123748@lichtman.org \
    --to=nir@lichtman.org \
    --cc=daniel.thompson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=jason.wessel@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®