]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
kconfig: nconf: Use TAB to cycle thru dialog buttons
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 14 Oct 2024 09:18:28 +0000 (11:18 +0200)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 4 Nov 2024 08:53:09 +0000 (17:53 +0900)
Add the ability to cycle through dialog buttons with the TAB key.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/nconf.gui.c

index 72b605efe549d9d82b2e8a0f29bf47036ea07e67..4bfdf8ac2a9a34d077d6ba470ff233ec947d638b 100644 (file)
@@ -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 ' ':