Thread (7 messages) 7 messages, 2 authors, 2011-02-16

RE: [PATCH v3] input: tegra-kbc: Add Function keymap.

flat view

From: Rakesh Iyer <hidden>
Date: 2011-02-16 20:12:58

I agree with that, and that was my original plan.

But I saw matrix_keypad.h has the MATRIX_MAX_ROWS defined at 16, and decided to
accommodate for it.

Regards
Rakesh
-----Original Message-----
From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
Sent: Wednesday, February 16, 2011 12:04 PM
To: Rakesh Iyer
Cc: linux-input@vger.kernel.org; olofj@chromium.org; Andrew Chew
Subject: Re: [PATCH v3] input: tegra-kbc: Add Function keymap.

On Wed, Feb 16, 2011 at 11:51:18AM -0800, Rakesh Iyer wrote:
quoted
quoted
On Wed, Feb 09, 2011 at 11:44:40AM -0800, riyer@nvidia.com wrote:
quoted
+
+	/*
+	 * 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.
quoted
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))
quoted
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
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help