linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] menuconfig: basic string editing in inputbox support
@ 2012-01-09 11:36 Paulius Zaleckas
  2012-01-09 11:36 ` [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox Paulius Zaleckas
  0 siblings, 1 reply; 11+ messages in thread
From: Paulius Zaleckas @ 2012-01-09 11:36 UTC (permalink / raw)
  To: mmarek, linux-kbuild, linux-kernel

For me the most irritating thing in linux kernel was absence
of string editing in menuconfig's inputbox. If you wanted to
change first symbol you had to delete all string and then type
it all again.
New implementation handles right/left cursor, backspace and
delete keys. It does a little bit more terminal manipulations
as string area is fully redrawn on each event.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
---

 scripts/kconfig/lxdialog/inputbox.c |   87 +++++++++++++++++++++--------------
 1 files changed, 53 insertions(+), 34 deletions(-)

diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
index dd8e587..834eee9 100644
--- a/scripts/kconfig/lxdialog/inputbox.c
+++ b/scripts/kconfig/lxdialog/inputbox.c
@@ -44,7 +44,7 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
 int dialog_inputbox(const char *title, const char *prompt, int height, int width,
                     const char *init)
 {
-	int i, x, y, box_y, box_x, box_width;
+	int i, len, x, y, box_y, box_x, box_width;
 	int input_x = 0, scroll = 0, key = 0, button = -1;
 	char *instr = dialog_input_result;
 	WINDOW *dialog;
@@ -54,6 +54,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
 	else
 		strcpy(instr, init);
 
+	len = strlen(instr);
+
 do_resize:
 	if (getmaxy(stdscr) <= (height - 2))
 		return -ERRDISPLAYTOOSMALL;
@@ -97,14 +99,13 @@ do_resize:
 	wmove(dialog, box_y, box_x);
 	wattrset(dialog, dlg.inputbox.atr);
 
-	input_x = strlen(instr);
-
-	if (input_x >= box_width) {
-		scroll = input_x - box_width + 1;
+	if (len >= box_width) {
+		scroll = len - box_width + 1;
 		input_x = box_width - 1;
 		for (i = 0; i < box_width - 1; i++)
 			waddch(dialog, instr[scroll + i]);
 	} else {
+		input_x = len;
 		waddstr(dialog, instr);
 	}
 
@@ -121,50 +122,68 @@ do_resize:
 			case KEY_UP:
 			case KEY_DOWN:
 				break;
-			case KEY_LEFT:
-				continue;
 			case KEY_RIGHT:
+				if (scroll + input_x < len) {
+					if (input_x == box_width - 1)
+						scroll++;
+					else
+						input_x++;
+					goto redraw;
+				}
 				continue;
+			case KEY_LEFT:
 			case KEY_BACKSPACE:
 			case 127:
 				if (input_x || scroll) {
-					wattrset(dialog, dlg.inputbox.atr);
-					if (!input_x) {
-						scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1);
-						wmove(dialog, box_y, box_x);
-						for (i = 0; i < box_width; i++)
-							waddch(dialog,
-							       instr[scroll + input_x + i] ?
-							       instr[scroll + input_x + i] : ' ');
-						input_x = strlen(instr) - scroll;
-					} else
+					/* 
+					 * Some fancy scrolling, so you can see what
+					 * you will be deleting with backspace
+					 */
+					if (!input_x || (input_x < box_width / 4 && scroll))
+						scroll--;
+					else
 						input_x--;
-					instr[scroll + input_x] = '\0';
-					mvwaddch(dialog, box_y, input_x + box_x, ' ');
-					wmove(dialog, box_y, input_x + box_x);
-					wrefresh(dialog);
+
+					if (key != KEY_LEFT) {
+						int pos = scroll + input_x;
+						memmove(&instr[pos], &instr[pos + 1], len-- - pos + 1);
+					}
+					goto redraw;
+				}
+				continue;
+			case KEY_DC:
+				if (scroll + input_x < len) {
+					int pos = scroll + input_x;
+					memmove(&instr[pos], &instr[pos + 1], len-- - pos + 1);
+					goto redraw;
 				}
 				continue;
 			default:
 				if (key < 0x100 && isprint(key)) {
-					if (scroll + input_x < MAX_LEN) {
-						wattrset(dialog, dlg.inputbox.atr);
-						instr[scroll + input_x] = key;
-						instr[scroll + input_x + 1] = '\0';
-						if (input_x == box_width - 1) {
+					if (len < MAX_LEN) {
+						int pos = scroll + input_x;
+						memmove(&instr[pos + 1], &instr[pos], len++ - pos + 1);
+						instr[pos] = key;
+						if (input_x == box_width - 1)
 							scroll++;
-							wmove(dialog, box_y, box_x);
-							for (i = 0; i < box_width - 1; i++)
-								waddch(dialog, instr [scroll + i]);
-						} else {
-							wmove(dialog, box_y, input_x++ + box_x);
-							waddch(dialog, key);
-						}
-						wrefresh(dialog);
+						else
+							input_x++;
+						goto redraw;
 					} else
 						flash();	/* Alarm user about overflow */
 					continue;
 				}
+				break;
+			redraw:
+				wattrset(dialog, dlg.inputbox.atr);
+				wmove(dialog, box_y, box_x);
+				for (i = 0; i < box_width - 1; i++)
+					waddch(dialog,
+					       scroll + i < len ?
+					       instr[scroll + i] : ' ');
+				wmove(dialog, box_y, input_x + box_x);
+				wrefresh(dialog);
+				continue;
 			}
 		}
 		switch (key) {


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-09 11:36 [PATCH v2 1/2] menuconfig: basic string editing in inputbox support Paulius Zaleckas
@ 2012-01-09 11:36 ` Paulius Zaleckas
  2012-01-09 22:20   ` Randy Dunlap
  0 siblings, 1 reply; 11+ messages in thread
From: Paulius Zaleckas @ 2012-01-09 11:36 UTC (permalink / raw)
  To: mmarek, linux-kbuild, linux-kernel

Makes long string editing easier.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
---

 scripts/kconfig/lxdialog/inputbox.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
index 834eee9..0d9cacc 100644
--- a/scripts/kconfig/lxdialog/inputbox.c
+++ b/scripts/kconfig/lxdialog/inputbox.c
@@ -158,6 +158,16 @@ do_resize:
 					goto redraw;
 				}
 				continue;
+			case KEY_HOME:
+				scroll = input_x = 0;
+				goto redraw;
+			case KEY_END:
+				if (len >= box_width) {
+					scroll = len - box_width + 1;
+					input_x = box_width - 1;
+				} else
+					input_x = len;
+				goto redraw;
 			default:
 				if (key < 0x100 && isprint(key)) {
 					if (len < MAX_LEN) {


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-09 11:36 ` [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox Paulius Zaleckas
@ 2012-01-09 22:20   ` Randy Dunlap
  2012-01-10 11:50     ` Paulius Zaleckas
  0 siblings, 1 reply; 11+ messages in thread
From: Randy Dunlap @ 2012-01-09 22:20 UTC (permalink / raw)
  To: Paulius Zaleckas; +Cc: mmarek, linux-kbuild, linux-kernel

On 01/09/2012 03:36 AM, Paulius Zaleckas wrote:
> Makes long string editing easier.
> 
> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>

Hi,

Does "default hostname" in the "General setup" menu use an inputbox?
If so, I can't get Home and End keys to work for it.

If not, please tell me a field that uses an inputbox so that I can test it.

Thanks.

> ---
> 
>  scripts/kconfig/lxdialog/inputbox.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
> index 834eee9..0d9cacc 100644
> --- a/scripts/kconfig/lxdialog/inputbox.c
> +++ b/scripts/kconfig/lxdialog/inputbox.c
> @@ -158,6 +158,16 @@ do_resize:
>  					goto redraw;
>  				}
>  				continue;
> +			case KEY_HOME:
> +				scroll = input_x = 0;
> +				goto redraw;
> +			case KEY_END:
> +				if (len >= box_width) {
> +					scroll = len - box_width + 1;
> +					input_x = box_width - 1;
> +				} else
> +					input_x = len;
> +				goto redraw;
>  			default:
>  				if (key < 0x100 && isprint(key)) {
>  					if (len < MAX_LEN) {
> 
> --


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-09 22:20   ` Randy Dunlap
@ 2012-01-10 11:50     ` Paulius Zaleckas
  2012-01-10 17:30       ` Randy Dunlap
  0 siblings, 1 reply; 11+ messages in thread
From: Paulius Zaleckas @ 2012-01-10 11:50 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: mmarek, linux-kbuild, linux-kernel

On Tue, Jan 10, 2012 at 12:20 AM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> On 01/09/2012 03:36 AM, Paulius Zaleckas wrote:
>> Makes long string editing easier.
>>
>> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
>
> Hi,
>
> Does "default hostname" in the "General setup" menu use an inputbox?

Yes, it does.

> If so, I can't get Home and End keys to work for it.

Strange. It works for me. Have you applied both patches?

> If not, please tell me a field that uses an inputbox so that I can test it.
>
> Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-10 11:50     ` Paulius Zaleckas
@ 2012-01-10 17:30       ` Randy Dunlap
  2012-01-11  9:21         ` Paulius Zaleckas
  0 siblings, 1 reply; 11+ messages in thread
From: Randy Dunlap @ 2012-01-10 17:30 UTC (permalink / raw)
  To: Paulius Zaleckas; +Cc: mmarek, linux-kbuild, linux-kernel

On 01/10/2012 03:50 AM, Paulius Zaleckas wrote:
> On Tue, Jan 10, 2012 at 12:20 AM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>> On 01/09/2012 03:36 AM, Paulius Zaleckas wrote:
>>> Makes long string editing easier.
>>>
>>> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
>>
>> Hi,
>>
>> Does "default hostname" in the "General setup" menu use an inputbox?
> 
> Yes, it does.
> 
>> If so, I can't get Home and End keys to work for it.
> 
> Strange. It works for me. Have you applied both patches?

Yes, I have both patches applied.

>> If not, please tell me a field that uses an inputbox so that I can test it.


Thanks.

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-10 17:30       ` Randy Dunlap
@ 2012-01-11  9:21         ` Paulius Zaleckas
  2012-01-11 19:12           ` Randy Dunlap
  0 siblings, 1 reply; 11+ messages in thread
From: Paulius Zaleckas @ 2012-01-11  9:21 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: mmarek, linux-kbuild, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 931 bytes --]

On Tue, Jan 10, 2012 at 7:30 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> On 01/10/2012 03:50 AM, Paulius Zaleckas wrote:
>> On Tue, Jan 10, 2012 at 12:20 AM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>> On 01/09/2012 03:36 AM, Paulius Zaleckas wrote:
>>>> Makes long string editing easier.
>>>>
>>>> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
>>>
>>> Hi,
>>>
>>> Does "default hostname" in the "General setup" menu use an inputbox?
>>
>> Yes, it does.
>>
>>> If so, I can't get Home and End keys to work for it.
>>
>> Strange. It works for me. Have you applied both patches?
>
> Yes, I have both patches applied.

Ok this is really very strange, but I have made debug patch. See attachement.
It will print octal pressed key value just below the text field.

>From curses.h:
#define KEY_HOME	0406		/* home key */
#define KEY_END		0550		/* end key */

Do you get the same values for Home and End keys? I do.

[-- Attachment #2: inputbox_debug.patch --]
[-- Type: text/x-diff, Size: 880 bytes --]

Debug inputbox by printing octal key values.

From: Paulius Zaleckas <paulius.zaleckas@gmail.com>


---

 scripts/kconfig/lxdialog/inputbox.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)


diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
index 0d9cacc..ecb778c 100644
--- a/scripts/kconfig/lxdialog/inputbox.c
+++ b/scripts/kconfig/lxdialog/inputbox.c
@@ -114,7 +114,17 @@ do_resize:
 	wrefresh(dialog);
 
 	while (key != KEY_ESC) {
+		char key_num[4];
+
 		key = wgetch(dialog);
+		snprintf(key_num, 4, "%03o", key);
+		wattrset(dialog, dlg.inputbox.atr);
+		wmove(dialog, box_y + 2, box_x);
+		waddch(dialog, key_num[0]);
+		waddch(dialog, key_num[1]);
+		waddch(dialog, key_num[2]);
+		wmove(dialog, box_y, input_x + box_x);
+		wrefresh(dialog);
 
 		if (button == -1) {	/* Input box selected */
 			switch (key) {

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-11  9:21         ` Paulius Zaleckas
@ 2012-01-11 19:12           ` Randy Dunlap
  2012-01-12 14:24             ` Paulius Zaleckas
  0 siblings, 1 reply; 11+ messages in thread
From: Randy Dunlap @ 2012-01-11 19:12 UTC (permalink / raw)
  To: Paulius Zaleckas; +Cc: mmarek, linux-kbuild, linux-kernel

On 01/11/2012 01:21 AM, Paulius Zaleckas wrote:
> On Tue, Jan 10, 2012 at 7:30 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>> On 01/10/2012 03:50 AM, Paulius Zaleckas wrote:
>>> On Tue, Jan 10, 2012 at 12:20 AM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>>> On 01/09/2012 03:36 AM, Paulius Zaleckas wrote:
>>>>> Makes long string editing easier.
>>>>>
>>>>> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
>>>>
>>>> Hi,
>>>>
>>>> Does "default hostname" in the "General setup" menu use an inputbox?
>>>
>>> Yes, it does.
>>>
>>>> If so, I can't get Home and End keys to work for it.
>>>
>>> Strange. It works for me. Have you applied both patches?
>>
>> Yes, I have both patches applied.
> 
> Ok this is really very strange, but I have made debug patch. See attachement.
> It will print octal pressed key value just below the text field.
> 
> From curses.h:
> #define KEY_HOME	0406		/* home key */
> #define KEY_END		0550		/* end key */
> 
> Do you get the same values for Home and End keys? I do.

All that I see in the inputbox when I use Home or End is:

033

(ESCape key)


Could this have anything to do with me using xfce (xfce4)?

thanks,
-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-11 19:12           ` Randy Dunlap
@ 2012-01-12 14:24             ` Paulius Zaleckas
  2012-01-12 17:40               ` Randy Dunlap
  0 siblings, 1 reply; 11+ messages in thread
From: Paulius Zaleckas @ 2012-01-12 14:24 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: mmarek, linux-kbuild, linux-kernel

On Wed, Jan 11, 2012 at 9:12 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> On 01/11/2012 01:21 AM, Paulius Zaleckas wrote:
>> On Tue, Jan 10, 2012 at 7:30 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>> On 01/10/2012 03:50 AM, Paulius Zaleckas wrote:
>>>> On Tue, Jan 10, 2012 at 12:20 AM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>>>> On 01/09/2012 03:36 AM, Paulius Zaleckas wrote:
>>>>>> Makes long string editing easier.
>>>>>>
>>>>>> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
>>>>>
>>>>> Hi,
>>>>>
>>>>> Does "default hostname" in the "General setup" menu use an inputbox?
>>>>
>>>> Yes, it does.
>>>>
>>>>> If so, I can't get Home and End keys to work for it.
>>>>
>>>> Strange. It works for me. Have you applied both patches?
>>>
>>> Yes, I have both patches applied.
>>
>> Ok this is really very strange, but I have made debug patch. See attachement.
>> It will print octal pressed key value just below the text field.
>>
>> From curses.h:
>> #define KEY_HOME      0406            /* home key */
>> #define KEY_END               0550            /* end key */
>>
>> Do you get the same values for Home and End keys? I do.
>
> All that I see in the inputbox when I use Home or End is:
>
> 033
>
> (ESCape key)

Is it working with nconfig?

> Could this have anything to do with me using xfce (xfce4)?

I have xfce at home. Will try it later today.

> thanks,
> --
> ~Randy
> *** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-12 14:24             ` Paulius Zaleckas
@ 2012-01-12 17:40               ` Randy Dunlap
  2012-01-13 15:35                 ` Paulius Zaleckas
  0 siblings, 1 reply; 11+ messages in thread
From: Randy Dunlap @ 2012-01-12 17:40 UTC (permalink / raw)
  To: Paulius Zaleckas; +Cc: mmarek, linux-kbuild, linux-kernel

On 01/12/2012 06:24 AM, Paulius Zaleckas wrote:
> On Wed, Jan 11, 2012 at 9:12 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>> On 01/11/2012 01:21 AM, Paulius Zaleckas wrote:
>>> On Tue, Jan 10, 2012 at 7:30 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>>> On 01/10/2012 03:50 AM, Paulius Zaleckas wrote:
>>>>> On Tue, Jan 10, 2012 at 12:20 AM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>>>>> On 01/09/2012 03:36 AM, Paulius Zaleckas wrote:
>>>>>>> Makes long string editing easier.
>>>>>>>
>>>>>>> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Does "default hostname" in the "General setup" menu use an inputbox?
>>>>>
>>>>> Yes, it does.
>>>>>
>>>>>> If so, I can't get Home and End keys to work for it.
>>>>>
>>>>> Strange. It works for me. Have you applied both patches?
>>>>
>>>> Yes, I have both patches applied.
>>>
>>> Ok this is really very strange, but I have made debug patch. See attachement.
>>> It will print octal pressed key value just below the text field.
>>>
>>> From curses.h:
>>> #define KEY_HOME      0406            /* home key */
>>> #define KEY_END               0550            /* end key */
>>>
>>> Do you get the same values for Home and End keys? I do.
>>
>> All that I see in the inputbox when I use Home or End is:
>>
>> 033
>>
>> (ESCape key)
> 
> Is it working with nconfig?

When I try to edit "Default hostname" in nconfig and press Home or End keys,
nconfig acts like I just pressed F7 and it gives me the "what config file name do I
want to load" prompt.


>> Could this have anything to do with me using xfce (xfce4)?
> 
> I have xfce at home. Will try it later today.

Thanks.

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-12 17:40               ` Randy Dunlap
@ 2012-01-13 15:35                 ` Paulius Zaleckas
  2012-01-13 17:48                   ` Randy Dunlap
  0 siblings, 1 reply; 11+ messages in thread
From: Paulius Zaleckas @ 2012-01-13 15:35 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: mmarek, linux-kbuild, linux-kernel

On Thu, Jan 12, 2012 at 7:40 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> On 01/12/2012 06:24 AM, Paulius Zaleckas wrote:
>> On Wed, Jan 11, 2012 at 9:12 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>> On 01/11/2012 01:21 AM, Paulius Zaleckas wrote:
>>>> On Tue, Jan 10, 2012 at 7:30 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>>>> On 01/10/2012 03:50 AM, Paulius Zaleckas wrote:
>>>>>> On Tue, Jan 10, 2012 at 12:20 AM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>>>>>> On 01/09/2012 03:36 AM, Paulius Zaleckas wrote:
>>>>>>>> Makes long string editing easier.
>>>>>>>>
>>>>>>>> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Does "default hostname" in the "General setup" menu use an inputbox?
>>>>>>
>>>>>> Yes, it does.
>>>>>>
>>>>>>> If so, I can't get Home and End keys to work for it.
>>>>>>
>>>>>> Strange. It works for me. Have you applied both patches?
>>>>>
>>>>> Yes, I have both patches applied.
>>>>
>>>> Ok this is really very strange, but I have made debug patch. See attachement.
>>>> It will print octal pressed key value just below the text field.
>>>>
>>>> From curses.h:
>>>> #define KEY_HOME      0406            /* home key */
>>>> #define KEY_END               0550            /* end key */
>>>>
>>>> Do you get the same values for Home and End keys? I do.
>>>
>>> All that I see in the inputbox when I use Home or End is:
>>>
>>> 033
>>>
>>> (ESCape key)
>>
>> Is it working with nconfig?
>
> When I try to edit "Default hostname" in nconfig and press Home or End keys,
> nconfig acts like I just pressed F7 and it gives me the "what config file name do I
> want to load" prompt.
>
>
>>> Could this have anything to do with me using xfce (xfce4)?
>>
>> I have xfce at home. Will try it later today.
>
> Thanks.

I have just tried with xfce daefault terminal and had no problems.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox
  2012-01-13 15:35                 ` Paulius Zaleckas
@ 2012-01-13 17:48                   ` Randy Dunlap
  0 siblings, 0 replies; 11+ messages in thread
From: Randy Dunlap @ 2012-01-13 17:48 UTC (permalink / raw)
  To: Paulius Zaleckas; +Cc: mmarek, linux-kbuild, linux-kernel

On 01/13/2012 07:35 AM, Paulius Zaleckas wrote:
> On Thu, Jan 12, 2012 at 7:40 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>> On 01/12/2012 06:24 AM, Paulius Zaleckas wrote:
>>> On Wed, Jan 11, 2012 at 9:12 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>>> On 01/11/2012 01:21 AM, Paulius Zaleckas wrote:
>>>>> On Tue, Jan 10, 2012 at 7:30 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>>>>> On 01/10/2012 03:50 AM, Paulius Zaleckas wrote:
>>>>>>> On Tue, Jan 10, 2012 at 12:20 AM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>>>>>>>> On 01/09/2012 03:36 AM, Paulius Zaleckas wrote:
>>>>>>>>> Makes long string editing easier.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Does "default hostname" in the "General setup" menu use an inputbox?
>>>>>>>
>>>>>>> Yes, it does.
>>>>>>>
>>>>>>>> If so, I can't get Home and End keys to work for it.
>>>>>>>
>>>>>>> Strange. It works for me. Have you applied both patches?
>>>>>>
>>>>>> Yes, I have both patches applied.
>>>>>
>>>>> Ok this is really very strange, but I have made debug patch. See attachement.
>>>>> It will print octal pressed key value just below the text field.
>>>>>
>>>>> From curses.h:
>>>>> #define KEY_HOME      0406            /* home key */
>>>>> #define KEY_END               0550            /* end key */
>>>>>
>>>>> Do you get the same values for Home and End keys? I do.
>>>>
>>>> All that I see in the inputbox when I use Home or End is:
>>>>
>>>> 033
>>>>
>>>> (ESCape key)
>>>
>>> Is it working with nconfig?
>>
>> When I try to edit "Default hostname" in nconfig and press Home or End keys,
>> nconfig acts like I just pressed F7 and it gives me the "what config file name do I
>> want to load" prompt.
>>
>>
>>>> Could this have anything to do with me using xfce (xfce4)?
>>>
>>> I have xfce at home. Will try it later today.
>>
>> Thanks.
> 
> I have just tried with xfce daefault terminal and had no problems.


Ah, you nailed it with that comment.  Yes, it works with "Terminal".
I was using rxvt, not Terminal.  Sorry for the confusion.


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-01-13 16:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-09 11:36 [PATCH v2 1/2] menuconfig: basic string editing in inputbox support Paulius Zaleckas
2012-01-09 11:36 ` [PATCH v2 2/2] menuconfig: add Home and End keys support for inputbox Paulius Zaleckas
2012-01-09 22:20   ` Randy Dunlap
2012-01-10 11:50     ` Paulius Zaleckas
2012-01-10 17:30       ` Randy Dunlap
2012-01-11  9:21         ` Paulius Zaleckas
2012-01-11 19:12           ` Randy Dunlap
2012-01-12 14:24             ` Paulius Zaleckas
2012-01-12 17:40               ` Randy Dunlap
2012-01-13 15:35                 ` Paulius Zaleckas
2012-01-13 17:48                   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).