From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ee0-f46.google.com ([74.125.83.46]:49357 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932726Ab2AEQJB (ORCPT ); Thu, 5 Jan 2012 11:09:01 -0500 From: Paulius Zaleckas Subject: [PATCH 2/2] menuconfig: add Home and End keys support for inputbox Date: Thu, 05 Jan 2012 18:08:59 +0200 Message-ID: <20120105160859.7543.67706.stgit@localhost6.localdomain6> In-Reply-To: <20120105160852.7543.76603.stgit@localhost6.localdomain6> References: <20120105160852.7543.76603.stgit@localhost6.localdomain6> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: mmarek@suse.cz, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Makes long string editing easier. Signed-off-by: Paulius Zaleckas --- 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 3bd7111..ad31bec 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 (scroll + input_x < MAX_LEN) {