i-search functionality for mconf
v4 cover i-search functionality for mconf
Hello,
this version is a prototype of the idea, Sam suggested -- I hope I undestood it correctly.
This is a remarkable change to mconf in it's behavior; mainly it now differentiates two focuses and operates differently, depending on the focus. When the focus is on the menu, mconf is in i-search mode, for a detailed description see 1/1.
As stated earlier, this is just a prototype, documentation is missing and the code is not ready for a real commit.
Dirk
Dirk Gouders (1):
Isearch functionality for mconf
scripts/kconfig/lxdialog/dialog.h | 3 + scripts/kconfig/lxdialog/menubox.c | 207 +++++++++++++++++++++++++++++++++---- 2 files changed, 189 insertions(+), 21 deletions(-)
Signature · 1 line
2.16.4
RFC v4 1/1 i-search functionality for mconf
This patch prototypes isearch functionality for mconf based on an idea of Sam Ravnborg:
* mconf now distinguishes if the focus is on the menu items or the buttons below it.
* At startup focus is on the menu items and alphanumeric characters or space entered are used to form a string that is searched for.
* BACKSPACE is used to remove the last character of the search string.
* ENTER can be used to enter a submenu.
* Horizontal arrow keys put focus on the buttons with the known behavior.
* The TAB key is now exclusively used to toggle the focus.
* Vertical arrow keys work anywhere.
* When the focus is on the buttons, all keys (e.g. hotkeys) work the same as before this change.
* '\' can be used to search for other occurences of an already entered string.
* To use y|n|m on an item, focus has to be on the buttons.
An example to navigate into the USB support menu under Device Drivers:
1) de # Navigates to the item "Device Drivers"
2) ENTER # Enter the submenu
3) USB # Navigate to the item "USB support"
4) ENTER # Enter the submenu
--- scripts/kconfig/lxdialog/dialog.h | 3 + scripts/kconfig/lxdialog/menubox.c | 207 +++++++++++++++++++++++++++++++++---- 2 files changed, 189 insertions(+), 21 deletions(-)
scripts/kconfig/lxdialog/dialog.h +3 -0
@@ -50,6 +50,8 @@#define TR (params) _tracef params#define KEY_ESC 27 +#define KEY_CTRL_S 19 +#define KEY_ENTR 10#define TAB 9#define MAX_LEN 2048#define BUF_SIZE (10*1024)
@@ -238,6 +240,7 @@ int dialog_checklist(const char *title, const char *prompt, int height, int width, int list_height);int dialog_inputbox (const char *title,const char *prompt,int height,int width,const char *init); +int do_isearch (char *str,int choice,int scroll);/* * This is the base for fictitious keys, which activate
scripts/kconfig/lxdialog/menubox.c +186 -21
285 lines not on this page · raw message
Signature · 1 line
2.16.4
Quoted 27 lines · Dirk Gouders
This patch prototypes isearch functionality for mconf based on an idea of Sam Ravnborg:
* mconf now distinguishes if the focus is on the menu items or the buttons below it.
* At startup focus is on the menu items and alphanumeric characters or space entered are used to form a string that is searched for.
* BACKSPACE is used to remove the last character of the search string.
* ENTER can be used to enter a submenu.
* Horizontal arrow keys put focus on the buttons with the known behavior.
* The TAB key is now exclusively used to toggle the focus.
* Vertical arrow keys work anywhere.
* When the focus is on the buttons, all keys (e.g. hotkeys) work the same as before this change.
* '\' can be used to search for other occurences of an already entered string.
Quoted 8 lines
* To use y|n|m on an item, focus has to be on the buttons.
An example to navigate into the USB support menu under Device Drivers:
1) de # Navigates to the item "Device Drivers"
2) ENTER # Enter the submenu
3) USB # Navigate to the item "USB support"
4) ENTER # Enter the submenu
Hi Dirk,
Much like Sam, I got locked in isearch mode. The TAB key would not switch into the buttons focus. I had to kill it.
Signature · 1 line
~Randy
Hi Dirk.
Quoted 5 lines · Dirk Gouders
Hello,
this version is a prototype of the idea, Sam suggested -- I hope I undestood it correctly.
Quoted 7 lines
This is a remarkable change to mconf in it's behavior; mainly it now differentiates two focuses and operates differently, depending on the focus. When the focus is on the menu, mconf is in i-search mode, for a detailed description see 1/1.
As stated earlier, this is just a prototype, documentation is missing and the code is not ready for a real commit.
When trying this out it started to work as envisioned. But somehw I manage to get stuck in the menus and cannot navigate to the buttons.
Consider to remove the old short-cut for the menus. (Most/all the first_alph thingy in menubox.c)
That will avoid two confliting navigations principles and likely make the code simpler to read.
I am not sure, but maybe you can get rid of all the hotkey support in print_item with this change too.
Sam
Quoted 20 lines · Sam Ravnborg
Hi Dirk.
Quoted 5 lines · Dirk Gouders
Hello,
this version is a prototype of the idea, Sam suggested -- I hope I undestood it correctly.
Quoted 7 lines
This is a remarkable change to mconf in it's behavior; mainly it now differentiates two focuses and operates differently, depending on the focus. When the focus is on the menu, mconf is in i-search mode, for a detailed description see 1/1.
As stated earlier, this is just a prototype, documentation is missing and the code is not ready for a real commit.
When trying this out it started to work as envisioned. But somehw I manage to get stuck in the menus and cannot navigate to the buttons.
Quoted 7 lines
Consider to remove the old short-cut for the menus. (Most/all the
first_alphthingy inmenubox.c)
That will avoid two confliting navigations principles and likely make the code simpler to read.I am not sure, but maybe you can get rid of all the hotkey support in
print_itemwith this change too.
Hi Sam,
thank you (and also to Randy) for having a look at it.
Next, I will prepare a patch, more thorougly tested, documentation included and with hotkey support removed.
You are right, trying to support two navigation principles makes everything too complex and I was too eager to keep as much of today's functionality as possible.
Dirk