Skip to contentSkip to conversation

kconfig: nconf: Use TAB to cycle thru dialog buttons

PATCH In review Thorsten Blum 2 participants 2 messages Oct 14, 2024 – Oct 18, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kconfig: nconf: Use TAB to cycle thru dialog buttons

Add the ability to cycle through dialog buttons with the TAB key.

---
 scripts/kconfig/nconf.gui.c | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/kconfig/nconf.gui.c +9 -0
index 72b605efe549..aeac9e5b06ee 100644
@@ -277,6 +277,15 @@ int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...)
 		case KEY_RIGHT:
 			menu_driver(menu, REQ_RIGHT_ITEM);
 			break;
+		case 9: /* TAB */
+			if (btn_num > 1) {
+				/* cycle through buttons */
+				if (item_index(current_item(menu)) == btn_num-1)
+					menu_driver(menu, REQ_FIRST_ITEM);
+				else
+					menu_driver(menu, REQ_NEXT_ITEM);
+			}
+			break;
 		case 10: /* ENTER */
 		case 27: /* ESCAPE */
 		case ' ':
Signature · 1 line
2.47.0
#1 lore raw
Quoted 5 lines · Thorsten Blum

Add the ability to cycle through dialog buttons with the TAB key.

---

Applied to linux-kbuild.
Thanks.

Quoted 26 lines
 scripts/kconfig/nconf.gui.c | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/kconfig/nconf.gui.c +9 -1
index 72b605efe549..aeac9e5b06ee 100644
@@ -277,6 +277,15 @@ int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...)
                case KEY_RIGHT:
                        menu_driver(menu, REQ_RIGHT_ITEM);
                        break;
+               case 9: /* TAB */
+                       if (btn_num > 1) {
+                               /* cycle through buttons */
+                               if (item_index(current_item(menu)) == btn_num-1)
+                                       menu_driver(menu, REQ_FIRST_ITEM);
+                               else
+                                       menu_driver(menu, REQ_NEXT_ITEM);
+                       }
+                       break;
                case 10: /* ENTER */
                case 27: /* ESCAPE */
                case ' ':
--

2.47.0

Signature · 2 lines
Best Regards
Masahiro Yamada