summaryrefslogtreecommitdiff
path: root/packages/linux/opensimpad-2.4.25-vrs2-pxa1-jpm1/simpad-switches-input2.diff
blob: 4f9d0bf93a2a6b1c392fc00dd6f7c91c32139668 (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
31
32
33
34
35
36
37
38
39
40
41

#
# Patch managed by http://www.holgerschurig.de/patcher.html
#

--- drivers/misc/switches-core.c~Fooo
+++ drivers/misc/switches-core.c
@@ -66,7 +66,32 @@
 int 
 dummy_k_translate(unsigned char scancode, unsigned char *keycode, char raw_mode)
 {
-	*keycode = scancode;
+	if (scancode == KEY_UP) 
+		*keycode = 144;
+	else if (scancode == KEY_LEFT) 
+		*keycode = 146;
+	else if (scancode == KEY_RIGHT) 
+		*keycode = 151;
+	else if (scancode == KEY_DOWN) 
+		*keycode = 161;
+	else if (scancode == 144) 
+		*keycode = KEY_UP;
+	else if (scancode == 146) 
+		*keycode = KEY_LEFT;
+	else if (scancode == 151) 
+		*keycode = KEY_RIGHT;
+	else if (scancode == 161) 
+		*keycode = KEY_DOWN;
+	else if (scancode == KEY_KP8) 
+		*keycode = KEY_UP;
+	else if (scancode == KEY_KP4) 
+		*keycode = KEY_LEFT;
+	else if (scancode == KEY_KP6) 
+		*keycode = KEY_RIGHT;
+	else if (scancode == KEY_KP2) 
+		*keycode = KEY_DOWN;
+	else
+		*keycode = scancode;
 	return 1;
 }