提交 d68e818b 编写于 作者: B Benjamin Poirier 提交者: Michal Marek

nconf: add u, d command keys in scroll windows

They function just like they do in less(1).
Also correct some discrepancy between the help text and the code wrt
function keys.
Signed-off-by: NBenjamin Poirier <bpoirier@suse.de>
Signed-off-by: NMichal Marek <mmarek@suse.cz>
上级 9d4792c9
...@@ -83,10 +83,10 @@ static const char nconf_readme[] = N_( ...@@ -83,10 +83,10 @@ static const char nconf_readme[] = N_(
"Text Box (Help Window)\n" "Text Box (Help Window)\n"
"--------\n" "--------\n"
"o Use the cursor keys to scroll up/down/left/right. The VI editor\n" "o Use the cursor keys to scroll up/down/left/right. The VI editor\n"
" keys h,j,k,l function here as do <SPACE BAR> for those\n" " keys h,j,k,l function here as do <u>, <d> and <SPACE BAR> for\n"
" who are familiar with less and lynx.\n" " those who are familiar with less and lynx.\n"
"\n" "\n"
"o Press <Enter>, <F1>, <F5>, <F7> or <Esc> to exit.\n" "o Press <Enter>, <F1>, <F5>, <F9>, <q> or <Esc> to exit.\n"
"\n" "\n"
"\n" "\n"
"Alternate Configuration Files\n" "Alternate Configuration Files\n"
......
...@@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window, ...@@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window,
switch (res) { switch (res) {
case KEY_NPAGE: case KEY_NPAGE:
case ' ': case ' ':
case 'd':
start_y += text_lines-2; start_y += text_lines-2;
break; break;
case KEY_PPAGE: case KEY_PPAGE:
case 'u':
start_y -= text_lines+2; start_y -= text_lines+2;
break; break;
case KEY_HOME: case KEY_HOME:
...@@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window, ...@@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window,
start_x++; start_x++;
break; break;
} }
if (res == 10 || res == 27 || res == 'q' if (res == 10 || res == 27 || res == 'q' ||
|| res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) { res == KEY_F(F_HELP) || res == KEY_F(F_BACK) ||
res == KEY_F(F_EXIT))
break; break;
}
if (start_y < 0) if (start_y < 0)
start_y = 0; start_y = 0;
if (start_y >= total_lines-text_lines) if (start_y >= total_lines-text_lines)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册