From: Sascha Hauer <s.hauer@pengutronix.de>
To: Peter Mamonov <pmamonov@gmail.com>
Cc: barebox@lists.infradead.org, Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH v2] input: usb keyboard: fix CTRL+C
Date: Wed, 24 Feb 2016 19:12:27 +0100 [thread overview]
Message-ID: <20160224181227.GR3939@pengutronix.de> (raw)
In-Reply-To: <20160224180701.08b3d179@berta>
On Wed, Feb 24, 2016 at 06:07:01PM +0300, Peter Mamonov wrote:
> On Wed, 24 Feb 2016 17:21:48 +0300
> Antony Pavlov <antonynpavlov@gmail.com> wrote:
>
> > On Wed, 24 Feb 2016 13:48:45 +0300
> > Peter Mamonov <pmamonov@gmail.com> wrote:
> >
> > > Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
> > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > > ---
> > > 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?
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
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-02-24 18:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-20 14:27 [PATCH 1/2] input: usb keyboard: fix BACKSPACE Peter Mamonov
2016-02-20 14:27 ` [PATCH 2/2] input: usb keyboard: fix CTRL+C Peter Mamonov
2016-02-20 16:51 ` Sam Ravnborg
2016-02-23 7:55 ` Sascha Hauer
2016-02-24 10:48 ` [PATCH v2] " Peter Mamonov
2016-02-24 14:21 ` Antony Pavlov
2016-02-24 15:07 ` Peter Mamonov
2016-02-24 18:12 ` Sascha Hauer [this message]
2016-02-24 18:53 ` Trent Piepho
2016-02-25 6:05 ` Sascha Hauer
2016-02-25 10:15 ` Peter Mamonov
2016-02-25 10:05 ` [PATCH v3] input: usb keyboard: fix CTRL+ combinations Peter Mamonov
2016-02-26 6:52 ` Sascha Hauer
2016-02-23 7:50 ` [PATCH 1/2] input: usb keyboard: fix BACKSPACE Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160224181227.GR3939@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=pmamonov@gmail.com \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox