All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kdb: fix ctrl+e/a/f/b/d/p/n broken in keyboard mode
@ 2024-11-08 22:11 Nir Lichtman
  2024-11-09  0:31 ` Doug Anderson
  0 siblings, 1 reply; 3+ messages in thread
From: Nir Lichtman @ 2024-11-08 22:11 UTC (permalink / raw)
  To: jason.wessel, daniel.thompson, dianders, linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-09  7:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 22:11 [PATCH] kdb: fix ctrl+e/a/f/b/d/p/n broken in keyboard mode Nir Lichtman
2024-11-09  0:31 ` Doug Anderson
2024-11-09  7:35   ` Nir Lichtman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.