From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76799 invoked by alias); 3 Jun 2015 23:55:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 76786 invoked by uid 89); 3 Jun 2015 23:55:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_05,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-oi0-f41.google.com Received: from mail-oi0-f41.google.com (HELO mail-oi0-f41.google.com) (209.85.218.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 03 Jun 2015 23:55:33 +0000 Received: by oifu123 with SMTP id u123so19797846oif.1 for ; Wed, 03 Jun 2015 16:55:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=jzF4Stn4Twg3dBca+9YyXP3nTHkCINrpEdHeMHElAd0=; b=GzNlL/MDtgMM+4AKaq4/jHna3rU/gzlIDhKfBL4Ap8KkLHp/mrKw1rE/BnmqZoPQHG LUi1pCvRIsoSBIh6P9qqVZmR4BE054PfYVm3YYpFqod5omOw64dL+3LXh963Mrvy5g0K guL6jsWbOHREuC5fORUBxDueJ4hGwojBRLSEpc1yi39Nkkmeufq5YFcT9hu5NNt9hfev i2SB5dX8xIDWy32XaAGRBsX4s/7Mh1RC5IwZp9v/+oNtViPeV2RJcjh9tXldjLoeJami SETp/Q5UHD4dfieHaDkWESCDIR9j78dCEM569XTWBRXDjqduQjDUAe9JriZZWZf5L6tv /FXA== X-Gm-Message-State: ALoCoQnSf9H8VA9aoUsQKfxeVZp/MHx4oprr7Zhp2TkvSAQOODR/aLYWfPkAzgMAy18AG3UI4wY6 X-Received: by 10.202.58.215 with SMTP id h206mr27863968oia.23.1433375731668; Wed, 03 Jun 2015 16:55:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.96.167 with HTTP; Wed, 3 Jun 2015 16:55:11 -0700 (PDT) In-Reply-To: <1433374131-30902-1-git-send-email-patrick@parcs.ath.cx> References: <1433374131-30902-1-git-send-email-patrick@parcs.ath.cx> From: Patrick Palka Date: Wed, 03 Jun 2015 23:55:00 -0000 Message-ID: Subject: Re: [PATCH] Intercept and handle Delete/Home/End keys in the TUI To: "gdb-patches@sourceware.org" Cc: Patrick Palka Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-06/txt/msg00063.txt.bz2 On Wed, Jun 3, 2015 at 7:28 PM, Patrick Palka wrote: > These keys are mapped by wgetch() to special ncurses-specific values and > are otherwise passed through to readline, to no useful effect. > > This patch intercepts these keys in the TUI and gives them their > expected function. The commit message is slightly misleading. These keys work as expected when the command window is in focus. But when another window is in focus, these keys currently have no function. This patch gives them their expected function when the command window is not in focus. Alternatively when the command window is not in focus the Home and Delete keys could be given the function of scrolling the source/disasm windows all the way up or down. Personally I don't think that is very useful. I think the traditional binding would probably see more use. Nonetheless I will reword the commit message to mention the focus aspect. > > gdb/ChangeLog: > > * tui/tui-command.c: Include "readline/readline.h". > (tui_dispatch_ctrl_char): Handle KEY_DC, KEY_HOME and KEY_END. > --- > gdb/tui/tui-command.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c > index 03ec076..84ba2b7 100644 > --- a/gdb/tui/tui-command.c > +++ b/gdb/tui/tui-command.c > @@ -27,6 +27,7 @@ > #include "tui/tui-command.h" > > #include "gdb_curses.h" > +#include "readline/readline.h" > /***************************************** > ** STATIC LOCAL FUNCTIONS FORWARD DECLS ** > ******************************************/ > @@ -76,6 +77,15 @@ tui_dispatch_ctrl_char (unsigned int ch) > case KEY_LEFT: > tui_scroll_right (win_info, 1); > break; > + case KEY_DC: > + rl_delete (1, ch); > + break; > + case KEY_HOME: > + rl_point = 0; > + break; > + case KEY_END: > + rl_point = rl_end; > + break; > case '\f': > break; > default: > -- > 2.4.2.387.gf86f31a.dirty >