Commit 4d9ef69f authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

various fixes for get_control_kbinput()

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3450 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 21 additions and 11 deletions
+21 -11
...@@ -167,6 +167,11 @@ CVS code - ...@@ -167,6 +167,11 @@ CVS code -
(DLR) (DLR)
- Change all rcfile error messages to refer to commands instead - Change all rcfile error messages to refer to commands instead
of directives, for consistency with nanorc.5. (DLR) of directives, for consistency with nanorc.5. (DLR)
- winio.c:
get_control_kbinput()
- Add Ctrl-/ as an alias for Ctrl-_. (DLR, found by Benno
Schulenberg)
- Simplify the if blocks wherever possible. (DLR)
- configure.ac: - configure.ac:
- Remove old warnings about color support. (DLR) - Remove old warnings about color support. (DLR)
- doc/nano.1, doc/nanorc.5, doc/rnano.1, doc/nano.texi: - doc/nano.1, doc/nanorc.5, doc/rnano.1, doc/nano.texi:
......
...@@ -1406,21 +1406,26 @@ int get_control_kbinput(int kbinput) ...@@ -1406,21 +1406,26 @@ int get_control_kbinput(int kbinput)
{ {
int retval; int retval;
/* Ctrl-2 (Ctrl-Space, Ctrl-@, Ctrl-`) */ /* Ctrl-Space (Ctrl-2, Ctrl-@, Ctrl-`) */
if (kbinput == '2' || kbinput == ' ' || kbinput == '@' || if (kbinput == ' ')
kbinput == '`') retval = kbinput - 32;
retval = NANO_CONTROL_SPACE; /* Ctrl-/ (Ctrl-7, Ctrl-_) */
/* Ctrl-3 (Ctrl-[, Esc) to Ctrl-7 (Ctrl-_) */ else if (kbinput == '/')
retval = kbinput - 16;
/* Ctrl-2 (Ctrl-Space, Ctrl-@, Ctrl-`) */
else if (kbinput == '2')
retval = kbinput - 50;
/* Ctrl-3 (Ctrl-[, Esc) to Ctrl-7 (Ctrl-/, Ctrl-_) */
else if ('3' <= kbinput && kbinput <= '7') else if ('3' <= kbinput && kbinput <= '7')
retval = kbinput - 24; retval = kbinput - 24;
/* Ctrl-8 (Ctrl-?) */ /* Ctrl-8 (Ctrl-?) */
else if (kbinput == '8' || kbinput == '?') else if (kbinput == '8')
retval = NANO_CONTROL_8; retval = kbinput + 71;
/* Ctrl-A to Ctrl-_ */ /* Ctrl-? (Ctrl-8) to Ctrl-_ (Ctrl-/, Ctrl-7) */
else if ('A' <= kbinput && kbinput <= '_') else if ('?' <= kbinput && kbinput <= '_')
retval = kbinput - 64; retval = kbinput - 64;
/* Ctrl-a to Ctrl-~ */ /* Ctrl-` (Ctrl-2, Ctrl-Space, Ctrl-@) to Ctrl-~ (Ctrl-6, Ctrl-^) */
else if ('a' <= kbinput && kbinput <= '~') else if ('`' <= kbinput && kbinput <= '~')
retval = kbinput - 96; retval = kbinput - 96;
else else
retval = kbinput; retval = kbinput;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment