aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/puzzles/stppc2x/generic-keys.patch
blob: ece3c581b9b73a4c5f09039baf5b03664370ab7f (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
diff -ru stppc2x-read-only.orig/sdl.c stppc2x-read-only/sdl.c
--- stppc2x-read-only.orig/sdl.c	2010-10-12 23:33:27.107507323 +0300
+++ stppc2x-read-only/sdl.c	2010-10-12 23:39:15.560805458 +0300
@@ -85,7 +85,6 @@
 // SDL library includes
 // ====================
 #include <SDL/SDL.h>
-#include <SDL/SDL_gp2x.h>
 #include <SDL/SDL_gfxPrimitives.h>
 #include <SDL/SDL_rotozoom.h>
 #include <SDL/SDL_ttf.h>
@@ -3262,43 +3261,43 @@
                 case SDL_KEYDOWN:
                     switch(event.key.keysym.sym)
                     {
-                        case SDLK_z:
+                        case SDLK_BACKSPACE:
                             // Simulate pressing the Select key
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_SELECT);
                             break;
 
-                        case SDLK_y:
+                        case SDLK_w:
                             // Simulate pressing the Y key
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_Y);
                             break;
 
-                        case SDLK_u:
+                        case SDLK_F4:
                             // Simulate pressing the Vol- key
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_VOLDOWN);
                             break;
 
-                        case SDLK_i:
+                        case SDLK_F5:
                             // Simulate pressing the Vol+ key
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_VOLUP);
                             break;
 
-                        case SDLK_p:
+                        case SDLK_RETURN:
                             // Simulate pressing the Start key
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_START);
                             break;
 
-                        case SDLK_q:
+                        case SDLK_F8:
                             clear_statusbar(fe);
                             sdl_status_bar(fe,"Quitting...");
                             cleanup_and_exit(fe, EXIT_SUCCESS);
                             break;
 
-                        case SDLK_e:
+                        case SDLK_z:
                             // Simulate pressing stick-click
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_CLICK);
                             break;
 
-                        case SDLK_s:
+                        case SDLK_F6:
                             // Simulate pressing the Vol+ and Vol- keys
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_VOLUP);
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_VOLDOWN);
@@ -3306,7 +3305,7 @@
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_VOLDOWN);
                             break;
 
-                        case SDLK_l:
+                        case SDLK_q:
                             // Simulate pressing the L key
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_L);
                             break;
@@ -3316,17 +3315,17 @@
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_A);
                             break;
 
-                        case SDLK_b:
+                        case SDLK_s:
                             // Simulate pressing the B key
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_B);
                             break;
 
-                        case SDLK_x:
+                        case SDLK_d:
                             // Simulate pressing the X key
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_X);
                             break;
 
-                        case SDLK_r:
+                        case SDLK_p:
                             // Simulate pressing the R key
                             emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_R);
                             break;
@@ -3359,26 +3358,26 @@
                 case SDL_KEYUP:
                     switch(event.key.keysym.sym)
                     {
-                        case SDLK_z:
+                        case SDLK_BACKSPACE:
                             // Simulate pressing the Select key
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_SELECT);
                             break;
 
-                        case SDLK_p:
+                        case SDLK_RETURN:
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_START);
                             break;
 
-                        case SDLK_u:
+                        case SDLK_F4:
                             // Simulate releasing the Vol- key
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_VOLDOWN);
                             break;
 
-                        case SDLK_i:
+                        case SDLK_F5:
                             // Simulate releasing the Vol+ key
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_VOLUP);
                             break;
 
-                        case SDLK_l:
+                        case SDLK_q:
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_L);
                             break;
 
@@ -3386,19 +3385,19 @@
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_A);
                             break;
 
-                        case SDLK_b:
+                        case SDLK_s:
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_B);
                             break;
 
-                        case SDLK_y:
+                        case SDLK_w:
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_Y);
                             break;
 
-                        case SDLK_x:
+                        case SDLK_d:
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_X);
                             break;
 
-                        case SDLK_r:
+                        case SDLK_p:
                             emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_R);
                             break;
 
diff -ru trunk.orig/sdl.c trunk/sdl.c
--- trunk.orig/sdl.c	2010-10-13 18:49:21.789215058 +0300
+++ trunk/sdl.c	2010-10-13 18:48:03.772555218 +0300
@@ -2981,12 +2981,12 @@
                                         if((digit_to_input > 9) && (digit_to_input < 36))
                                         {
                                             // 65 = ASCII value of "A"
-                                            sprintf(digit_to_input_as_string, "Press X to enter a \'%c\'", digit_to_input + 65 - 10);
+                                            sprintf(digit_to_input_as_string, "Press D to enter a \'%c\'", digit_to_input + 65 - 10);
                                         }
                                         else
                                         {
                                             // 48 = ASCII value of "0"
-                                            sprintf(digit_to_input_as_string, "Press X to enter a \'%c\'", digit_to_input + 48);
+                                            sprintf(digit_to_input_as_string, "Press D to enter a \'%c\'", digit_to_input + 48);
                                         };
                                         sdl_status_bar(fe,digit_to_input_as_string);
                                     }
@@ -3044,11 +3044,11 @@
                                         if((digit_to_input > 9) && (digit_to_input < 36))
                                         {
                                             // 65 = ASCII value of "a"
-                                            sprintf(digit_to_input_as_string, "Press X to enter a \'%c\'", digit_to_input + 65 - 10);
+                                            sprintf(digit_to_input_as_string, "Press D to enter a \'%c\'", digit_to_input + 65 - 10);
                                         }
                                         else
                                         {
-                                            sprintf(digit_to_input_as_string, "Press X to enter a \'%u\'", digit_to_input);
+                                            sprintf(digit_to_input_as_string, "Press D to enter a \'%u\'", digit_to_input);
                                         };
                                         sdl_status_bar(fe,digit_to_input_as_string);
                                     }
diff -ru trunk.orig/sdl.c trunk/sdl.c
--- trunk.orig/sdl.c	2010-10-19 02:26:24.719001658 +0300
+++ trunk/sdl.c	2010-10-19 02:27:37.879000527 +0300
@@ -5449,7 +5449,7 @@
     global_config->screenshots_enabled=FALSE;
     global_config->screenshots_include_cursor=FALSE;
     global_config->screenshots_include_statusbar=FALSE;
-    global_config->control_system=FALSE;
+    global_config->control_system=TRUE;
     global_config->music_volume=MIX_MAX_VOLUME;
     for(i=0;i<10;i++)
         global_config->tracks_to_play[i]=FALSE;