From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-lb0-x244.google.com ([2a00:1450:4010:c04::244]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYsus-0001Pq-0U for barebox@lists.infradead.org; Thu, 25 Feb 2016 10:13:02 +0000 Received: by mail-lb0-x244.google.com with SMTP id vk4so681290lbb.1 for ; Thu, 25 Feb 2016 02:12:40 -0800 (PST) Date: Thu, 25 Feb 2016 13:15:42 +0300 From: Peter Mamonov Message-ID: <20160225131542.5d1280ed@berta> In-Reply-To: <20160224181227.GR3939@pengutronix.de> References: <1455978465-28919-2-git-send-email-pmamonov@gmail.com> <1456310925-1057-1-git-send-email-pmamonov@gmail.com> <20160224172148.fd09cf0757b3b52348103638@gmail.com> <20160224180701.08b3d179@berta> <20160224181227.GR3939@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH v2] input: usb keyboard: fix CTRL+C To: Sascha Hauer Cc: barebox@lists.infradead.org, Sam Ravnborg On Wed, 24 Feb 2016 19:12:27 +0100 Sascha Hauer wrote: > On Wed, Feb 24, 2016 at 06:07:01PM +0300, Peter Mamonov wrote: > > On Wed, 24 Feb 2016 17:21:48 +0300 > > Antony Pavlov wrote: > > > > > On Wed, 24 Feb 2016 13:48:45 +0300 > > > Peter Mamonov wrote: > > > > > > > Signed-off-by: Peter Mamonov > > > > Signed-off-by: Sam Ravnborg > > > > --- > > > > drivers/input/input.c | 4 +++- > > > > drivers/input/keymap.c | 4 ++++ > > > > include/input/keyboard.h | 1 + > > > > 3 files changed, 8 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/input/input.c b/drivers/input/input.c > > > > index ad7400f..1c6891c 100644 > > > > --- a/drivers/input/input.c > > > > +++ b/drivers/input/input.c > > > > @@ -164,7 +164,9 @@ static void input_console_notify(struct > > > > input_notifier *in, if (ic->modstate[4] || ic->modstate[5]) > > > > modstate |= 1 << 2; > > > > > > > > - if (modstate & (1 << 0)) > > > > + if (modstate & (1 << 1)) > > > > + ascii = keycode_bb_ctrl_keys[ev->code]; > > > > + else if (modstate & (1 << 0)) > > > > ascii = keycode_bb_shift_keys[ev->code]; > > > > else > > > > ascii = keycode_bb_keys[ev->code]; > > > > diff --git a/drivers/input/keymap.c b/drivers/input/keymap.c > > > > index 79ca461..7e443d1 100644 > > > > --- a/drivers/input/keymap.c > > > > +++ b/drivers/input/keymap.c > > > > @@ -167,3 +167,7 @@ uint8_t keycode_bb_shift_keys[NR_KEYS] = { > > > > [KEY_KPEQUAL] = '=', > > > > [KEY_KPCOMMA] = ',', > > > > }; > > > > + > > > > +uint8_t keycode_bb_ctrl_keys[NR_KEYS] = { > > > > + [KEY_C] = CTL_CH('c'), > > > > +}; > > > > > > > > > It looks like we still have empty array with NR_KEYS bytes in it. > > > > > > Can we just drop it and satisfy with short "special case" C-code > > > for control modifier handling? > > > > Probably I've misunderstood Sasha. > > > > Sasha, did you mean to eliminate the CTRL-keymap completely? > > No, I didn't, although that would be an option aswell. It would safe > us a few more bytes in the binary. The question is, how many more > keys are in the CTRL map that are interesting for us? Are there more > than CTRL-C? The CTRL+D combo is used for "save & quit" in the edit program. > If yes, then it's probably better to keep the map. If > not, a special CTRL-C case in code might be the better option. > > Sascha > _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox