From patchwork Wed Aug 31 07:46:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng Renquan X-Patchwork-Id: 1115292 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7V83DL6028481 for ; Wed, 31 Aug 2011 08:03:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750780Ab1HaIDL (ORCPT ); Wed, 31 Aug 2011 04:03:11 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:63581 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751040Ab1HaIDK (ORCPT ); Wed, 31 Aug 2011 04:03:10 -0400 Received: by mail-iy0-f174.google.com with SMTP id u26so511509iab.19 for ; Wed, 31 Aug 2011 01:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=FaR/E2eBYjT4btoMVpyXr/Bd0KQepsuCJ90etMSyDbQ=; b=kmbVV3mS2GJ7PMlaq+ms4x144qawiqSHDIrj3kAKtsOZ5JVF/SHWsTeZr87T1WcSQX 2mn/AqNqbmm9jlZxUIRiTouNb0rcqBT1HeHj/A7LMbCEMIJvQSzqu5Nn2W2HvG6RqjR+ lPUDnJ8dvwtE4DtdyGUUaRlNTr4fBK/dDKKcc= Received: by 10.231.6.159 with SMTP id 31mr260220ibz.17.1314777789870; Wed, 31 Aug 2011 01:03:09 -0700 (PDT) Received: from localhost.localdomain ([67.188.70.153]) by mx.google.com with ESMTPS id m21sm3608665ibf.59.2011.08.31.01.03.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Aug 2011 01:03:08 -0700 (PDT) From: Cheng Renquan To: linux-kbuild@vger.kernel.org, Arnaud Lacombe Cc: Sam Ravnborg , Michal Marek , Nir Tzachar , Randy Dunlap , c.rq541@comcast.net Subject: [PATCH V2 5/6] scripts/kconfig/nconf: add KEY_HOME / KEY_END for dialog_inputbox Date: Wed, 31 Aug 2011 00:46:12 -0700 Message-Id: <1314776773-9560-6-git-send-email-crquan@gmail.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1314776773-9560-5-git-send-email-crquan@gmail.com> References: <1314776773-9560-1-git-send-email-crquan@gmail.com> <1314776773-9560-2-git-send-email-crquan@gmail.com> <1314776773-9560-3-git-send-email-crquan@gmail.com> <1314776773-9560-4-git-send-email-crquan@gmail.com> <1314776773-9560-5-git-send-email-crquan@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 31 Aug 2011 08:03:14 +0000 (UTC) to make it easier to locate begin/end when editing long strings; Signed-off-by: Cheng Renquan --- scripts/kconfig/nconf.gui.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c index a236ae7..1d73897 100644 --- a/scripts/kconfig/nconf.gui.c +++ b/scripts/kconfig/nconf.gui.c @@ -465,6 +465,14 @@ int dialog_inputbox(WINDOW *main_window, cursor_form_win--; } break; + case KEY_HOME: + cursor_position = 0; + cursor_form_win = 0; + break; + case KEY_END: + cursor_position = len; + cursor_form_win = min(cursor_position, prompt_width-1); + break; default: if ((isgraph(res) || isspace(res))) { /* one for new char, one for '\0' */