summaryrefslogtreecommitdiffstats
path: root/patches/kbd-2.0.1/0002-getkeycode-show-reserved-scancode.patch
blob: 91fe8e82be46911a3fa19d7e5b91b43d0ec5d77d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From: Luotao Fu <l.fu@pengutronix.de>
Date: Fri, 4 Jun 2010 10:36:42 +0200
Subject: [PATCH] getkeycode: show reserved scancode

The scancode 0 is usually reserved. Hence the getkeycodes starts scanning at 1.
However, the scancode can still be used in some special cases, e.g. for a matrix
keypad with board specific combination of keycodes and scancodes. This one
change the scan range to start from 0.

probably not for mainline, as far kdb is maintained et all.

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 src/getkeycodes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/getkeycodes.c b/src/getkeycodes.c
index d1fccf90612f..500fc5f1089b 100644
--- a/src/getkeycodes.c
+++ b/src/getkeycodes.c
@@ -44,7 +44,7 @@ main(int argc, char **argv) {
 	if (ioctl(fd, KDGETKEYCODE, &a)) {
 		sc0 = 89;
 	} else
-	for (sc0 = 1; sc0 <= 88; sc0++) {
+	for (sc0 = 0; sc0 <= 88; sc0++) {
 		a.scancode = sc0;
 		a.keycode = 0;
 		if (ioctl(fd, KDGETKEYCODE, &a) || a.keycode != sc0)