lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1356117145-14158-1-git-send-email-dvv.kernel@gmail.com>
Date:	Fri, 21 Dec 2012 23:12:25 +0400
From:	Dmitry Voytik <dvv.kernel@...il.com>
To:	mmarek@...e.cz
Cc:	linux-kernel@...r.kernel.org, Dmitry Voytik <dvv.kernel@...il.com>
Subject: [PATCH] nconf: add j, k and l keys for menu navigation

Add vi-style keys for menu navigation: press j/k for down/up navigation
and l for entering to a submenu. Unfortantely h key is reserved for
the items help.

Signed-off-by: Dmitry Voytik <dvv.kernel@...il.com>
---
 scripts/kconfig/nconf.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index ce93e87..ccf6766 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -38,10 +38,10 @@ static const char nconf_readme[] = N_(
 "\n"
 "Menus\n"
 "----------\n"
-"o  Use the Up/Down arrow keys (cursor keys) to highlight the item\n"
-"   you wish to change use <Enter> or <Space>. Goto submenu by \n"
-"   pressing <Enter> of <right-arrow>. Use <Esc> or <left-arrow> to go back.\n"
-"   Submenus are designated by \"--->\".\n"
+"o  Use the Up/Down arrow keys (cursor keys) or <j>/<k> to highlight\n"
+"   the item you wish to change use <Enter> or <Space>. Goto submenu by\n"
+"   pressing <Enter>, <right-arrow> or <l>. Use <Esc> or <left-arrow>\n"
+"   to go back. Submenus are designated by \"--->\".\n"
 "\n"
 "   Searching: pressing '/' triggers interactive search mode.\n"
 "              nconfig performs a case insensitive search for the string\n"
@@ -1115,9 +1115,11 @@ static void conf(struct menu *menu)
 						(struct menu *) item_data()))
 				break;
 			switch (res) {
+			case 'j':
 			case KEY_DOWN:
 				menu_driver(curses_menu, REQ_DOWN_ITEM);
 				break;
+			case 'k':
 			case KEY_UP:
 				menu_driver(curses_menu, REQ_UP_ITEM);
 				break;
@@ -1141,7 +1143,7 @@ static void conf(struct menu *menu)
 			if (res == 10 || res == 27 ||
 				res == 32 || res == 'n' || res == 'y' ||
 				res == KEY_LEFT || res == KEY_RIGHT ||
-				res == 'm')
+				res == 'm' || res == 'l')
 				break;
 			refresh_all_windows(main_window);
 		}
@@ -1170,6 +1172,7 @@ static void conf(struct menu *menu)
 			else if (item_is_tag('m'))
 				conf(submenu);
 			break;
+		case 'l':
 		case KEY_RIGHT:
 		case 10: /* ENTER WAS PRESSED */
 			switch (item_tag()) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ