Subversion Repositories Shiroi

Rev

Rev 3 | Rev 5 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 4
Line 1... Line 1...
1
/* $Id: main.c 3 2024-08-28 09:19:04Z nishi $ */
1
/* $Id: main.c 4 2024-08-28 10:07:23Z nishi $ */
2
 
2
 
3
#include <stdio.h>
3
#include <stdio.h>
4
#include <stdbool.h>
4
#include <stdbool.h>
5
#include <sys/stat.h>
5
#include <sys/stat.h>
6
#include <stdlib.h>
6
#include <stdlib.h>
Line 155... Line 155...
155
		BeginDrawing();
155
		BeginDrawing();
156
 
156
 
157
		ClearBackground(BLACK);
157
		ClearBackground(BLACK);
158
 
158
 
159
		if(text != NULL) {
159
		if(text != NULL) {
-
 
160
			/*
-
 
161
			 * / 1 2 3 4 5 6 7 8 9 10 11 12 13
-
 
162
			 * 1 1 2 3 4 5 6 7 8 9 0  -  =  
-
 
163
			 * 2 q w e r t y u i o p  [  ]  rt
-
 
164
			 * 3 a s d f g h j k l ;  '  \  cl
-
 
165
			 * 4 z x c v b n m , . /  sp
-
 
166
			 */
160
			text->key = GetCharPressed();
167
			int c = GetKeyPressed();
-
 
168
			if(c == 0){
-
 
169
				text->key = 0;
-
 
170
			}else if(KEY_ONE <= c && c <= KEY_NINE){
-
 
171
				text->key = (1 << 4) | (c - KEY_ONE + 1);
-
 
172
			}else if(c == KEY_ZERO){
-
 
173
				text->key = (1 << 4) | 10;
-
 
174
			}else if(c == KEY_MINUS){
-
 
175
				text->key = (1 << 4) | 11;
-
 
176
			}else if(c == KEY_EQUAL){
-
 
177
				text->key = (1 << 4) | 12;
-
 
178
			}else if(c == KEY_LEFT_BRACKET){
-
 
179
				text->key = (2 << 4) | 11;
-
 
180
			}else if(c == KEY_RIGHT_BRACKET){
-
 
181
				text->key = (2 << 4) | 12;
-
 
182
			}else if(c == KEY_ENTER){
-
 
183
				text->key = (2 << 4) | 13;
-
 
184
			}else if(c == KEY_SEMICOLON){
-
 
185
				text->key = (3 << 4) | 10;
-
 
186
			}else if(c == KEY_APOSTROPHE){
-
 
187
				text->key = (3 << 4) | 11;
-
 
188
			}else if(c == KEY_BACKSLASH){
-
 
189
				text->key = (3 << 4) | 12;
-
 
190
			}else if(c == KEY_LEFT_SHIFT || c == KEY_RIGHT_SHIFT){
-
 
191
				text->key = (3 << 4) | 13;
-
 
192
			}else if(c == KEY_COMMA){
-
 
193
				text->key = (4 << 4) | 8;
-
 
194
			}else if(c == KEY_PERIOD){
-
 
195
				text->key = (4 << 4) | 9;
-
 
196
			}else if(c == KEY_SLASH){
-
 
197
				text->key = (4 << 4) | 10;
-
 
198
			}else if(c == KEY_SPACE){
-
 
199
				text->key = (4 << 4) | 11;
-
 
200
			}else if(c == KEY_Q){
-
 
201
				text->key = (2 << 4) | 1;
-
 
202
			}else if(c == KEY_W){
-
 
203
				text->key = (2 << 4) | 2;
-
 
204
			}else if(c == KEY_E){
-
 
205
				text->key = (2 << 4) | 3;
-
 
206
			}else if(c == KEY_R){
-
 
207
				text->key = (2 << 4) | 4;
-
 
208
			}else if(c == KEY_T){
-
 
209
				text->key = (2 << 4) | 5;
-
 
210
			}else if(c == KEY_Y){
-
 
211
				text->key = (2 << 4) | 6;
-
 
212
			}else if(c == KEY_U){
-
 
213
				text->key = (2 << 4) | 7;
-
 
214
			}else if(c == KEY_I){
-
 
215
				text->key = (2 << 4) | 8;
-
 
216
			}else if(c == KEY_O){
-
 
217
				text->key = (2 << 4) | 9;
-
 
218
			}else if(c == KEY_P){
-
 
219
				text->key = (2 << 4) | 10;
-
 
220
			}else if(c == KEY_A){
-
 
221
				text->key = (3 << 4) | 1;
-
 
222
			}else if(c == KEY_S){
-
 
223
				text->key = (3 << 4) | 2;
-
 
224
			}else if(c == KEY_D){
-
 
225
				text->key = (3 << 4) | 3;
-
 
226
			}else if(c == KEY_F){
-
 
227
				text->key = (3 << 4) | 4;
-
 
228
			}else if(c == KEY_G){
-
 
229
				text->key = (3 << 4) | 5;
-
 
230
			}else if(c == KEY_H){
-
 
231
				text->key = (3 << 4) | 6;
-
 
232
			}else if(c == KEY_J){
-
 
233
				text->key = (3 << 4) | 7;
-
 
234
			}else if(c == KEY_K){
-
 
235
				text->key = (3 << 4) | 8;
-
 
236
			}else if(c == KEY_L){
-
 
237
				text->key = (3 << 4) | 9;
-
 
238
			}else if(c == KEY_Z){
-
 
239
				text->key = (4 << 4) | 1;
-
 
240
			}else if(c == KEY_X){
-
 
241
				text->key = (4 << 4) | 2;
-
 
242
			}else if(c == KEY_C){
-
 
243
				text->key = (4 << 4) | 3;
-
 
244
			}else if(c == KEY_V){
-
 
245
				text->key = (4 << 4) | 4;
-
 
246
			}else if(c == KEY_B){
-
 
247
				text->key = (4 << 4) | 5;
-
 
248
			}else if(c == KEY_N){
-
 
249
				text->key = (4 << 4) | 6;
-
 
250
			}else if(c == KEY_M){
-
 
251
				text->key = (4 << 4) | 7;
-
 
252
			}
161
		}
253
		}
162
 
254
 
163
		if(video != NULL) {
255
		if(video != NULL) {
164
			BeginTextureMode(r);
256
			BeginTextureMode(r);
165
 
257