From e00b3e85876b6a0cf09d83375631e3c5bdf8ee0b Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Thu, 11 Jun 2015 19:01:28 +0000
Subject: [PATCH] Making it easy to see what codes a key stroke produces when
 debugging.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5245 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   | 4 ++++
 src/winio.c | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index cc00845c..8fba2d56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-06-11  Benno Schulenberg  <bensberg@justemail.net>
+	* src/winio.c (get_key_buffer): Add some debugging code to make it
+	easy to see what codes a key stroke produces.
+
 2015-06-07  Benno Schulenberg  <bensberg@justemail.net>
 	* doc/texinfo/nano.texi: Show the node with the command-line options
 	in the main menu, to make it easy to find.
diff --git a/src/winio.c b/src/winio.c
index d94a5bab..2e56bbf7 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -181,7 +181,13 @@ void get_key_buffer(WINDOW *win)
     nodelay(win, FALSE);
 
 #ifdef DEBUG
-    fprintf(stderr, "get_key_buffer(): key_buffer_len = %lu\n", (unsigned long)key_buffer_len);
+    {
+	size_t i;
+	fprintf(stderr, "get_key_buffer(): the series of codes:");
+	for (i = 0; i < key_buffer_len; i++)
+	    fprintf(stderr, " %3x", key_buffer[i]);
+	fprintf(stderr, "\n");
+    }
 #endif
 }
 
-- 
GitLab