From: Chris Allegretta Date: Sat, 28 Apr 2001 16:31:19 +0000 (+0000) Subject: ABCD(), main() - Add Alt-whatever-[a-d] support as well as Alt-whatever-[A-D]. X-Git-Tag: v1.1.0~76 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=316e4d9a67e75e2207b28e0013d498acda837afd;p=nano.git ABCD(), main() - Add Alt-whatever-[a-d] support as well as Alt-whatever-[A-D]. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@615 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 68a94a98..ba853fc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,8 @@ Cvs code - - nano.c: do_alt_speller() - Reposition cursor on same line as before ^T was called (Rocco) + ABCD(), main() + - Add Alt-whatever-[a-d] support as well as Alt-whatever-[A-D]. main() - Code to silently process "-g" and "-j" (Rocco) - nano.h: diff --git a/nano.c b/nano.c index 054775f7..809d7f6b 100644 --- a/nano.c +++ b/nano.c @@ -2178,12 +2178,16 @@ int ABCD(int input) { switch (input) { case 'A': + case 'a': return (KEY_UP); case 'B': + case 'b': return (KEY_DOWN); case 'C': + case 'c': return (KEY_RIGHT); case 'D': + case 'd': return (KEY_LEFT); default: return 0; @@ -2454,7 +2458,8 @@ int main(int argc, char *argv[]) /* Alt-O, suddenly very important ;) */ case 79: kbinput = wgetch(edit); - if (kbinput <= 'D' && kbinput >= 'A') + if ((kbinput <= 'D' && kbinput >= 'A') || + (kbinput <= 'd' && kbinput >= 'a')) kbinput = ABCD(kbinput); else if (kbinput <= 'z' && kbinput >= 'j') print_numlock_warning(); @@ -2554,6 +2559,10 @@ int main(int argc, char *argv[]) case 'B': case 'C': case 'D': + case 'a': + case 'b': + case 'c': + case 'd': kbinput = ABCD(kbinput); break; case 'H':