>From 88a419748c5acfd8723248d993f8de51480b7672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Diego=20Aur=C3=A9lio=20Mesquita?= Date: Sat, 8 Dec 2018 12:57:39 -0200 Subject: [PATCH 2/2] bindings: hardbind prevlint and nextlint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hard binds prevlint and nextlint to, respectively, and . Signed-off-by: Marco Diego Aurélio Mesquita --- src/global.c | 3 +++ src/nano.c | 3 +++ src/nano.h | 2 ++ src/proto.h | 1 + src/winio.c | 4 ++++ 5 files changed, 13 insertions(+) diff --git a/src/global.c b/src/global.c index 736039bc..6f343d8f 100644 --- a/src/global.c +++ b/src/global.c @@ -72,6 +72,7 @@ int controlleft, controlright, controlup, controldown; int controlhome, controlend; #ifndef NANO_TINY int controldelete, controlshiftdelete; +int controlaltpageup, controlaltpagedown; int shiftleft, shiftright, shiftup, shiftdown; int shiftcontrolleft, shiftcontrolright, shiftcontrolup, shiftcontroldown; int shiftcontrolhome, shiftcontrolend; @@ -1156,6 +1157,8 @@ void shortcut_init(void) add_to_sclist(MMAIN, "Sh-^Del", CONTROL_SHIFT_DELETE, do_cut_prev_word, 0); add_to_sclist(MMAIN, "^Del", CONTROL_DELETE, do_cut_next_word, 0); add_to_sclist(MMAIN, "M-Del", ALT_DELETE, zap_text, 0); + add_to_sclist(MMAIN, "^M-PgUp", CONTROL_ALT_PAGEUP, prev_lint, 0); + add_to_sclist(MMAIN, "^M-PgDn", CONTROL_ALT_PAGEDOWN, next_lint, 0); #endif #ifdef ENABLE_WORDCOMPLETION add_to_sclist(MMAIN, "^]", 0, complete_a_word, 0); diff --git a/src/nano.c b/src/nano.c index e121722a..87721d41 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2579,6 +2579,9 @@ int main(int argc, char **argv) controldelete = get_keycode("kDC5", CONTROL_DELETE); controlshiftdelete = get_keycode("kDC6", CONTROL_SHIFT_DELETE); + controlaltpageup = get_keycode("kPRV7", CONTROL_ALT_PAGEUP); + controlaltpagedown = get_keycode("kNXT7", CONTROL_ALT_PAGEDOWN); + shiftup = get_keycode("kUP", SHIFT_UP); shiftdown = get_keycode("kDN", SHIFT_DOWN); diff --git a/src/nano.h b/src/nano.h index 04aa3150..72bbe1d4 100644 --- a/src/nano.h +++ b/src/nano.h @@ -590,6 +590,8 @@ enum #define SHIFT_CONTROL_HOME 0x415 #define SHIFT_CONTROL_END 0x416 #define CONTROL_SHIFT_DELETE 0x41D +#define CONTROL_ALT_PAGEDOWN 0x41E +#define CONTROL_ALT_PAGEUP 0x41F #define ALT_LEFT 0x421 #define ALT_RIGHT 0x422 #define ALT_UP 0x423 diff --git a/src/proto.h b/src/proto.h index d65cd6d1..d5603d44 100644 --- a/src/proto.h +++ b/src/proto.h @@ -60,6 +60,7 @@ extern int controlup, controldown; extern int controlhome, controlend; #ifndef NANO_TINY extern int controldelete, controlshiftdelete; +extern int controlaltpageup, controlaltpagedown; extern int shiftleft, shiftright; extern int shiftup, shiftdown; extern int shiftcontrolleft, shiftcontrolright; diff --git a/src/winio.c b/src/winio.c index a4a3df77..c8fd7cd1 100644 --- a/src/winio.c +++ b/src/winio.c @@ -538,6 +538,10 @@ int parse_kbinput(WINDOW *win) return CONTROL_DELETE; else if (retval == controlshiftdelete) return CONTROL_SHIFT_DELETE; + else if (retval == controlaltpageup) + return the_code_for(prev_lint, CONTROL_ALT_PAGEUP); + else if (retval == controlaltpagedown) + return the_code_for(next_lint, CONTROL_ALT_PAGEDOWN); else if (retval == shiftup) { shift_held = TRUE; return KEY_UP; -- 2.11.0