235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
case SDL_QUIT:
[self quit];
break;
case SDL_KEYDOWN:
case SDL_KEYUP:
if (_repeatsKeys || event.key.repeat == 0)
keypress(event.key.keysym.sym,
event.key.state == SDL_PRESSED,
event.key.keysym.sym);
break;
case SDL_MOUSEMOTION:
if (ignore) {
ignore--;
break;
}
mousemove(event.motion.xrel, event.motion.yrel);
break;
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
if (lasttype == event.type &&
lastbut == event.button.button)
// why?? get event twice without it
break;
keypress(-event.button.button,
event.button.state != 0, 0);
lasttype = event.type;
lastbut = event.button.button;
break;
}
}
}
|
|
>
>
>
|
>
|
|
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
|
case SDL_QUIT:
[self quit];
break;
case SDL_KEYDOWN:
case SDL_KEYUP:
if (_repeatsKeys || event.key.repeat == 0)
keypress(event.key.keysym.sym,
event.key.state == SDL_PRESSED);
break;
case SDL_TEXTINPUT:
@autoreleasepool {
input(@(event.text.text));
}
break;
case SDL_MOUSEMOTION:
if (ignore) {
ignore--;
break;
}
mousemove(event.motion.xrel, event.motion.yrel);
break;
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
if (lasttype == event.type &&
lastbut == event.button.button)
// why?? get event twice without it
break;
keypress(-event.button.button,
event.button.state != 0);
lasttype = event.type;
lastbut = event.button.button;
break;
}
}
}
|