All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Rakesh Iyer <riyer@nvidia.com>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"olofj@chromium.org" <olofj@chromium.org>,
	Andrew Chew <AChew@nvidia.com>
Subject: Re: [PATCH v3] input: tegra-kbc: Add Function keymap.
Date: Wed, 16 Feb 2011 12:03:50 -0800	[thread overview]
Message-ID: <20110216200349.GA31387@core.coreip.homeip.net> (raw)
In-Reply-To: <1FC56210173BB445BD77F608D6FB8D03165A0080DF@HQMAIL03.nvidia.com>

On Wed, Feb 16, 2011 at 11:51:18AM -0800, Rakesh Iyer wrote:
> > 
> > On Wed, Feb 09, 2011 at 11:44:40AM -0800, riyer@nvidia.com wrote:
> > > +
> > > +	/*
> > > +	 * If the platform uses Fn keymaps, translate keys on a Fn keypress.
> > > +	 * Function keycodes are KBC_MAX_COL apart from the plain keycodes.
> > > +	 */
> > > +	for (i = 0; (i < num_down) && fn_keypress; i++) {
> > > +		scancodes[i] += KBC_MAX_COL;
> > 
> > This should be KBC_MAX_KEY, isn't it?
> 
> In my implementation (and in your change) each row contains both Plain and Fn translated keys.
> So Cols 0-7 correspond to the plain keys and Cols 8-15 correspond to the Fn keys.
> That's why we add KBC_MAX_COL to get to the Fn translation.
> 
> This is using the logic from matrix_keypad.h
> 
> keymap[MATRIX_SCAN_CODE(row, col, row_shift)] = code;
> 
> and #define MATRIX_SCAN_CODE(row, col, row_shift)   (((row) << (row_shift)) + (col))
> 
> I will address the latter part after this one is cleared up.
>

Ah, yes. However I think we should change this so that Fn adds more
rows, not columns. This way you can properly limit keymap size and would
not accept/report to userspace (via EVIOCG/SKEYCODE) scancodes that are
not valid for given configuration. Do you agree?

Thanks.

-- 
Dmitry

  reply	other threads:[~2011-02-16 20:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 19:44 [PATCH v3] input: tegra-kbc: Add Function keymap riyer
2011-02-16  8:12 ` Dmitry Torokhov
2011-02-16 19:51   ` Rakesh Iyer
2011-02-16 20:03     ` Dmitry Torokhov [this message]
2011-02-16 20:12       ` Rakesh Iyer
2011-02-16 21:19         ` Dmitry Torokhov
2011-02-16 23:55           ` Rakesh Iyer

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=20110216200349.GA31387@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=AChew@nvidia.com \
    --cc=linux-input@vger.kernel.org \
    --cc=olofj@chromium.org \
    --cc=riyer@nvidia.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.