nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH 1/3] options: make -d (--rebinddelete) work without


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH 1/3] options: make -d (--rebinddelete) work without -K (--rebindkeypad)
Date: Sun, 23 Dec 2018 20:10:34 +0100

---
 src/winio.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/winio.c b/src/winio.c
index a4a3df77..02506113 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -724,6 +724,11 @@ int parse_kbinput(WINDOW *win)
 #endif
                case KEY_C3:    /* PageDown (3) on keypad with NumLock off. */
                        return KEY_NPAGE;
+               /* When requested, swap meanings of keycodes for <Bsp> and 
<Del>. */
+               case KEY_BACKSPACE:
+                       return (ISSET(REBIND_DELETE) ? KEY_DC : KEY_BACKSPACE);
+               case KEY_DC:
+                       return (ISSET(REBIND_DELETE) ? KEY_BACKSPACE : KEY_DC);
 #ifdef KEY_SDC  /* Slang doesn't support KEY_SDC. */
                case KEY_SDC:
                        return SHIFT_DELETE;
-- 
2.19.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]