summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-08-24 18:57:47 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-08-24 19:30:54 -0300
commita49853543e04c6309791f013af8da6afb1146783 (patch)
tree49ce945611817fa0ce1c33bd12987f21b37d6ac2
parent28a5859fe889b1c8a100296e09d352d962316e1a (diff)
Change to previous screen using Shift-Tab
-rw-r--r--Action.c11
-rw-r--r--CRT.c5
-rw-r--r--CRT.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/Action.c b/Action.c
index 690ad0b5..84d0864f 100644
--- a/Action.c
+++ b/Action.c
@@ -305,6 +305,16 @@ static Htop_Reaction actionNextScreen(State* st) {
return HTOP_REFRESH;
}
+static Htop_Reaction actionPrevScreen(State* st) {
+ Settings* settings = st->settings;
+ settings->ssIndex--;
+ if (settings->ssIndex == -1) {
+ settings->ssIndex = settings->nScreens - 1;
+ }
+ settings->ss = settings->screens[settings->ssIndex];
+ return HTOP_REFRESH;
+}
+
static Htop_Reaction actionSetAffinity(State* st) {
if (st->pl->cpuCount == 1)
return HTOP_OK;
@@ -610,5 +620,6 @@ void Action_setBindings(Htop_Action* keys) {
keys['c'] = actionTagAllChildren;
keys['e'] = actionShowEnvScreen;
keys['\t'] = actionNextScreen;
+ keys[KEY_SHIFT_TAB] = actionPrevScreen;
}
diff --git a/CRT.c b/CRT.c
index 43ac86b4..15d3c808 100644
--- a/CRT.c
+++ b/CRT.c
@@ -42,6 +42,7 @@ in the source distribution for its full text.
#define KEY_WHEELUP KEY_F(20)
#define KEY_WHEELDOWN KEY_F(21)
#define KEY_RECLICK KEY_F(22)
+#define KEY_SHIFT_TAB KEY_F(23)
//#link curses
@@ -646,12 +647,16 @@ void CRT_init(int delay, int colorScheme) {
define_key("\033[13~", KEY_F(3));
define_key("\033[14~", KEY_F(4));
define_key("\033[17;2~", KEY_F(18));
+ define_key("\033[Z", KEY_SHIFT_TAB);
char sequence[3] = "\033a";
for (char c = 'a'; c <= 'z'; c++) {
sequence[1] = c;
define_key(sequence, KEY_ALT('A' + (c - 'a')));
}
}
+ if (String_startsWith(CRT_termType, "rxvt")) {
+ define_key("\033[Z", KEY_SHIFT_TAB);
+ }
#ifndef DEBUG
signal(11, CRT_handleSIGSEGV);
#endif
diff --git a/CRT.h b/CRT.h
index 2afacfbb..fb9e00a1 100644
--- a/CRT.h
+++ b/CRT.h
@@ -31,6 +31,7 @@ in the source distribution for its full text.
#define KEY_WHEELUP KEY_F(20)
#define KEY_WHEELDOWN KEY_F(21)
#define KEY_RECLICK KEY_F(22)
+#define KEY_SHIFT_TAB KEY_F(23)
//#link curses

© 2014-2024 Faster IT GmbH | imprint | privacy policy