top: trade just 1 'Ctrl' bottom window key association
I grew tired of inadvertently causing a premature exit from top when all I wanted was to review some process' environment variables. That 'V' key was just too close to the 'C' key so the '^V' attempt became one of '^C'. Well, not any more. Should a user wish to see a task's environment, it will now require the '^N' combination. [ it also now places G/U & N/K on a similar diagonal ] Along the way, lower case Ctrl key combinations on the help screen were all changed into upper case versions. Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
ef27aea6b8
commit
9ff5a4fff0
28
top/top.c
28
top/top.c
@ -5321,6 +5321,19 @@ static void keys_global (int ch) {
|
|||||||
Fieldstab[eu_GENERIC].item = PIDS_extra;
|
Fieldstab[eu_GENERIC].item = PIDS_extra;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kbd_CtrlN:
|
||||||
|
def = PID_VAL(EU_PID, s_int, w->ppt[w->begtask]);
|
||||||
|
// if already targeted, assume user wants to turn it off ...
|
||||||
|
if (Tagged_task && Fieldstab[eu_GENERIC].item == PIDS_ENVIRON) {
|
||||||
|
TAGGED_TOSS;
|
||||||
|
} else {
|
||||||
|
Tagged_task = def;
|
||||||
|
Tagged_enum = eu_GENERIC;
|
||||||
|
Tagged_name = "environment";
|
||||||
|
Tagged_func = wins_tag_generic;
|
||||||
|
Fieldstab[eu_GENERIC].item = PIDS_ENVIRON;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case kbd_CtrlR:
|
case kbd_CtrlR:
|
||||||
if (Secure_mode)
|
if (Secure_mode)
|
||||||
show_msg(N_txt(NOT_onsecure_txt));
|
show_msg(N_txt(NOT_onsecure_txt));
|
||||||
@ -5360,19 +5373,6 @@ static void keys_global (int ch) {
|
|||||||
Fieldstab[eu_GENERIC].item = PIDS_SUPGROUPS;
|
Fieldstab[eu_GENERIC].item = PIDS_SUPGROUPS;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kbd_CtrlV:
|
|
||||||
def = PID_VAL(EU_PID, s_int, w->ppt[w->begtask]);
|
|
||||||
// if already targeted, assume user wants to turn it off ...
|
|
||||||
if (Tagged_task && Fieldstab[eu_GENERIC].item == PIDS_ENVIRON) {
|
|
||||||
TAGGED_TOSS;
|
|
||||||
} else {
|
|
||||||
Tagged_task = def;
|
|
||||||
Tagged_enum = eu_GENERIC;
|
|
||||||
Tagged_name = "environment";
|
|
||||||
Tagged_func = wins_tag_generic;
|
|
||||||
Fieldstab[eu_GENERIC].item = PIDS_ENVIRON;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case kbd_ENTER: // these two have the effect of waking us
|
case kbd_ENTER: // these two have the effect of waking us
|
||||||
case kbd_SPACE: // from 'pselect', refreshing the display
|
case kbd_SPACE: // from 'pselect', refreshing the display
|
||||||
break; // and updating any hot-plugged resources
|
break; // and updating any hot-plugged resources
|
||||||
@ -6213,7 +6213,7 @@ static void do_key (int ch) {
|
|||||||
{ keys_global,
|
{ keys_global,
|
||||||
{ '?', 'B', 'd', 'E', 'e', 'f', 'g', 'H', 'h'
|
{ '?', 'B', 'd', 'E', 'e', 'f', 'g', 'H', 'h'
|
||||||
, 'I', 'k', 'r', 's', 'X', 'Y', 'Z', '0'
|
, 'I', 'k', 'r', 's', 'X', 'Y', 'Z', '0'
|
||||||
, kbd_CtrlE, kbd_CtrlG, kbd_CtrlK, kbd_CtrlR, kbd_CtrlU, kbd_CtrlV
|
, kbd_CtrlE, kbd_CtrlG, kbd_CtrlK, kbd_CtrlN, kbd_CtrlR, kbd_CtrlU
|
||||||
, kbd_ENTER, kbd_SPACE, '\0' } },
|
, kbd_ENTER, kbd_SPACE, '\0' } },
|
||||||
{ keys_summary,
|
{ keys_summary,
|
||||||
{ '!', '1', '2', '3', '4', 'C', 'l', 'm', 't', '\0' } },
|
{ '!', '1', '2', '3', '4', 'C', 'l', 'm', 't', '\0' } },
|
||||||
|
@ -173,10 +173,10 @@ char *strcasestr(const char *haystack, const char *needle);
|
|||||||
#define kbd_CtrlE '\005'
|
#define kbd_CtrlE '\005'
|
||||||
#define kbd_CtrlG '\007'
|
#define kbd_CtrlG '\007'
|
||||||
#define kbd_CtrlK '\013'
|
#define kbd_CtrlK '\013'
|
||||||
|
#define kbd_CtrlN '\016'
|
||||||
#define kbd_CtrlO '\017'
|
#define kbd_CtrlO '\017'
|
||||||
#define kbd_CtrlR '\022'
|
#define kbd_CtrlR '\022'
|
||||||
#define kbd_CtrlU '\025'
|
#define kbd_CtrlU '\025'
|
||||||
#define kbd_CtrlV '\026'
|
|
||||||
|
|
||||||
/* Special value in Pseudo_row to force an additional procs refresh
|
/* Special value in Pseudo_row to force an additional procs refresh
|
||||||
-- used at startup and for task/thread mode transitions */
|
-- used at startup and for task/thread mode transitions */
|
||||||
|
@ -651,8 +651,8 @@ static void build_uniq_nlstab (void) {
|
|||||||
" V,v,F . Toggle: '~1V~2' forest view; '~1v~2' hide/show children; '~1F~2' keep focused\n"
|
" V,v,F . Toggle: '~1V~2' forest view; '~1v~2' hide/show children; '~1F~2' keep focused\n"
|
||||||
"\n"
|
"\n"
|
||||||
"%s"
|
"%s"
|
||||||
" ^G,K,U,V View: ctl groups ~1^g~2; cmdline ~1^k~2; supp groups ~1^u~2; environment ~1^v~2\n"
|
" ^G,K,N,U View: ctl groups ~1^G~2; cmdline ~1^K~2; environment ~1^N~2; supp groups ~1^U~2\n"
|
||||||
" W,Y,!,^E Write cfg '~1W~2'; Inspect '~1Y~2'; Combine Cpus '~1!~2'; Scale time ~1^e~2'\n"
|
" W,Y,!,^E Write cfg '~1W~2'; Inspect '~1Y~2'; Combine Cpus '~1!~2'; Scale time ~1^E~2'\n"
|
||||||
" q Quit\n"
|
" q Quit\n"
|
||||||
" ( commands shown with '.' require a ~1visible~2 task display ~1window~2 ) \n"
|
" ( commands shown with '.' require a ~1visible~2 task display ~1window~2 ) \n"
|
||||||
"Press '~1h~2' or '~1?~2' for help with ~1Windows~2,\n"
|
"Press '~1h~2' or '~1?~2' for help with ~1Windows~2,\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user