PageRenderTime 228ms CodeModel.GetById 23ms app.highlight 194ms RepoModel.GetById 2ms app.codeStats 0ms

/t/core_events.t

http://github.com/PerlGameDev/SDL
Perl | 1031 lines | 952 code | 73 blank | 6 comment | 42 complexity | b7fb50b29d242365ac5c394f2ded7f8f MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1#!/usr/bin/perl -w
  2use strict;
  3use warnings;
  4use SDL;
  5use SDL::Event;
  6use SDL::Events;
  7use SDL::Surface;
  8use SDL::Video;
  9use Devel::Peek;
 10use Test::More;
 11use lib 't/lib';
 12use SDL::TestTool;
 13
 14my $videodriver = $ENV{SDL_VIDEODRIVER};
 15$ENV{SDL_VIDEODRIVER} = 'dummy' unless $ENV{SDL_RELEASE_TESTING};
 16
 17if ( !SDL::TestTool->init(SDL_INIT_VIDEO) ) {
 18	plan( skip_all => 'Failed to init video' );
 19}
 20
 21my @done = qw/
 22	pump_events
 23	peep_events
 24	push_event
 25	poll_event
 26	wait_event
 27	set_event_filter
 28	event_state
 29	get_key_state
 30	get_key_name
 31	get_mod_state
 32	set_mod_state
 33	enable_unicode
 34	enable_key_repeat
 35	get_mouse_state
 36	get_relative_mouse_state
 37	get_app_state
 38	joystick_event_state
 39	/;
 40
 41my @done_event = qw/
 42	type
 43	active
 44	key
 45	motion
 46	button
 47	jaxis
 48	jball
 49	jhat
 50	jbutton
 51	resize
 52	expose
 53	quit
 54	user
 55	syswm
 56	/;
 57
 58can_ok( 'SDL::Events', @done );
 59can_ok( 'SDL::Event',  @done_event );
 60
 61is( SDL_ACTIVEEVENT,   1, 'SDL_ACTIVEEVENT should be imported' );
 62is( SDL_ACTIVEEVENT(), 1, 'SDL_ACTIVEEVENT() should also be available' );
 63is( SDL_ACTIVEEVENTMASK,
 64	SDL_EVENTMASK(SDL_ACTIVEEVENT),
 65	'SDL_ACTIVEVENTMASK should be imported'
 66);
 67is( SDL_ACTIVEEVENTMASK(),
 68	SDL_EVENTMASK(SDL_ACTIVEEVENT),
 69	'SDL_ACTIVEVENTMASK() should also be available'
 70);
 71is( SDL_ADDEVENT,    0,          'SDL_ADDEVENT should be imported' );
 72is( SDL_ADDEVENT(),  0,          'SDL_ADDEVENT() should also be available' );
 73is( SDL_ALLEVENTS,   0xFFFFFFFF, 'SDL_ALLEVENTS should be imported' );
 74is( SDL_ALLEVENTS(), 0xFFFFFFFF, 'SDL_ALLEVENTS() should also be available' );
 75
 76is( SDL_APPACTIVE,       4, 'SDL_APPACTIVE should be imported' );
 77is( SDL_APPACTIVE(),     4, 'SDL_APPACTIVE() should also be available' );
 78is( SDL_APPINPUTFOCUS,   2, 'SDL_APPINPUTFOCUS should be imported' );
 79is( SDL_APPINPUTFOCUS(), 2, 'SDL_APPINPUTFOCUS() should also be available' );
 80is( SDL_APPMOUSEFOCUS,   1, 'SDL_APPMOUSEFOCUS should be imported' );
 81is( SDL_APPMOUSEFOCUS(), 1, 'SDL_APPMOUSEFOCUS() should also be available' );
 82
 83is( SDL_BUTTON_LEFT,      1, 'SDL_BUTTON_LEFT should be imported' );
 84is( SDL_BUTTON_LEFT(),    1, 'SDL_BUTTON_LEFT() should also be available' );
 85is( SDL_BUTTON_MIDDLE,    2, 'SDL_BUTTON_MIDDLE should be imported' );
 86is( SDL_BUTTON_MIDDLE(),  2, 'SDL_BUTTON_MIDDLE() should also be available' );
 87is( SDL_BUTTON_RIGHT,     3, 'SDL_BUTTON_RIGHT should be imported' );
 88is( SDL_BUTTON_RIGHT(),   3, 'SDL_BUTTON_RIGHT() should also be available' );
 89is( SDL_BUTTON_WHEELUP,   4, 'SDL_BUTTON_WHEELUP should be imported' );
 90is( SDL_BUTTON_WHEELUP(), 4, 'SDL_BUTTON_WHEELUP() should also be available' );
 91is( SDL_BUTTON_WHEELDOWN, 5, 'SDL_BUTTON_WHEELDOWN should be imported' );
 92is( SDL_BUTTON_WHEELDOWN(), 5,
 93	'SDL_BUTTON_WHEELDOWN() should also be available'
 94);
 95
 96is( SDL_DISABLE,   0, 'SDL_DISABLE should be imported' );
 97is( SDL_DISABLE(), 0, 'SDL_DISABLE() should also be available' );
 98
 99is( SDL_ENABLE,   1, 'SDL_ENABLE should be imported' );
100is( SDL_ENABLE(), 1, 'SDL_ENABLE() should also be available' );
101
102is( SDL_GETEVENT,   2, 'SDL_GETEVENT should be imported' );
103is( SDL_GETEVENT(), 2, 'SDL_GETEVENT() should also be available' );
104
105is( SDL_HAT_CENTERED,    0,  'SDL_HAT_CENTERED should be imported' );
106is( SDL_HAT_CENTERED(),  0,  'SDL_HAT_CENTERED() should also be available' );
107is( SDL_HAT_DOWN,        4,  'SDL_HAT_DOWN should be imported' );
108is( SDL_HAT_DOWN(),      4,  'SDL_HAT_DOWN() should also be available' );
109is( SDL_HAT_LEFT,        8,  'SDL_HAT_LEFT should be imported' );
110is( SDL_HAT_LEFT(),      8,  'SDL_HAT_LEFT() should also be available' );
111is( SDL_HAT_LEFTDOWN,    12, 'SDL_HAT_LEFTDOWN should be imported' );
112is( SDL_HAT_LEFTDOWN(),  12, 'SDL_HAT_LEFTDOWN() should also be available' );
113is( SDL_HAT_LEFTUP,      9,  'SDL_HAT_LEFTUP should be imported' );
114is( SDL_HAT_LEFTUP(),    9,  'SDL_HAT_LEFTUP() should also be available' );
115is( SDL_HAT_RIGHT,       2,  'SDL_HAT_RIGHT should be imported' );
116is( SDL_HAT_RIGHT(),     2,  'SDL_HAT_RIGHT() should also be available' );
117is( SDL_HAT_RIGHTDOWN,   6,  'SDL_HAT_RIGHTDOWN should be imported' );
118is( SDL_HAT_RIGHTDOWN(), 6,  'SDL_HAT_RIGHTDOWN() should also be available' );
119is( SDL_HAT_RIGHTUP,     3,  'SDL_HAT_RIGHTUP should be imported' );
120is( SDL_HAT_RIGHTUP(),   3,  'SDL_HAT_RIGHTUP() should also be available' );
121is( SDL_HAT_UP,          1,  'SDL_HAT_UP should be imported' );
122is( SDL_HAT_UP(),        1,  'SDL_HAT_UP() should also be available' );
123
124is( SDL_IGNORE,   0, 'SDL_IGNORE should be imported' );
125is( SDL_IGNORE(), 0, 'SDL_IGNORE() should also be available' );
126
127is( SDL_JOYAXISMOTION,   7,  'SDL_JOYAXISMOTION should be imported' );
128is( SDL_JOYAXISMOTION(), 7,  'SDL_JOYAXISMOTION() should also be available' );
129is( SDL_JOYBALLMOTION,   8,  'SDL_JOYBALLMOTION should be imported' );
130is( SDL_JOYBALLMOTION(), 8,  'SDL_JOYBALLMOTION() should also be available' );
131is( SDL_JOYBUTTONDOWN,   10, 'SDL_JOYBUTTONDOWN should be imported' );
132is( SDL_JOYBUTTONDOWN(), 10, 'SDL_JOYBUTTONDOWN() should also be available' );
133is( SDL_JOYBUTTONUP,     11, 'SDL_JOYBUTTONUP should be imported' );
134is( SDL_JOYBUTTONUP(),   11, 'SDL_JOYBUTTONUP() should also be available' );
135is( SDL_JOYHATMOTION,    9,  'SDL_JOYHATMOTION should be imported' );
136is( SDL_JOYHATMOTION(),  9,  'SDL_JOYHATMOTION() should also be available' );
137is( SDL_JOYAXISMOTIONMASK,
138	SDL_EVENTMASK(SDL_JOYAXISMOTION),
139	'SDL_JOYAXISMOTIONMASK should be imported'
140);
141is( SDL_JOYAXISMOTIONMASK(),
142	SDL_EVENTMASK(SDL_JOYAXISMOTION),
143	'SDL_JOYAXISMOTIONMASK() should also be available'
144);
145is( SDL_JOYBALLMOTIONMASK,
146	SDL_EVENTMASK(SDL_JOYBALLMOTION),
147	'SDL_JOYBALLMOTIONMASK should be imported'
148);
149is( SDL_JOYBALLMOTIONMASK(),
150	SDL_EVENTMASK(SDL_JOYBALLMOTION),
151	'SDL_JOYBALLMOTIONMASK() should also be available'
152);
153is( SDL_JOYHATMOTIONMASK,
154	SDL_EVENTMASK(SDL_JOYHATMOTION),
155	'SDL_JOYHATMOTIONMASK should be imported'
156);
157is( SDL_JOYHATMOTIONMASK(),
158	SDL_EVENTMASK(SDL_JOYHATMOTION),
159	'SDL_JOYHATMOTIONMASK() should also be available'
160);
161is( SDL_JOYBUTTONDOWNMASK,
162	SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
163	'SDL_JOYBUTTONDOWNMASK should be imported'
164);
165is( SDL_JOYBUTTONDOWNMASK(),
166	SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
167	'SDL_JOYBUTTONDOWNMASK() should also be available'
168);
169is( SDL_JOYBUTTONUPMASK,
170	SDL_EVENTMASK(SDL_JOYBUTTONUP),
171	'SDL_JOYBUTTONUPMASK should be imported'
172);
173is( SDL_JOYBUTTONUPMASK(),
174	SDL_EVENTMASK(SDL_JOYBUTTONUP),
175	'SDL_JOYBUTTONUPMASK() should also be available'
176);
177is( SDL_JOYEVENTMASK,
178	SDL_EVENTMASK(SDL_JOYAXISMOTION) | SDL_EVENTMASK(SDL_JOYBALLMOTION) |
179		SDL_EVENTMASK(SDL_JOYHATMOTION) | SDL_EVENTMASK(SDL_JOYBUTTONDOWN) |
180		SDL_EVENTMASK(SDL_JOYBUTTONUP),
181	'SDL_JOYEVENTMASK should be imported'
182);
183is( SDL_JOYEVENTMASK(),
184	SDL_EVENTMASK(SDL_JOYAXISMOTION) | SDL_EVENTMASK(SDL_JOYBALLMOTION) |
185		SDL_EVENTMASK(SDL_JOYHATMOTION) | SDL_EVENTMASK(SDL_JOYBUTTONDOWN) |
186		SDL_EVENTMASK(SDL_JOYBUTTONUP),
187	'SDL_JOYEVENTMASK() should also be available'
188);
189
190is( SDL_KEYDOWN,   2, 'SDL_KEYDOWN should be imported' );
191is( SDL_KEYDOWN(), 2, 'SDL_KEYDOWN() should also be available' );
192is( SDL_KEYUP,     3, 'SDL_KEYUP should be imported' );
193is( SDL_KEYUP(),   3, 'SDL_KEYUP() should also be available' );
194is( SDL_KEYDOWNMASK,
195	SDL_EVENTMASK(SDL_KEYDOWN),
196	'SDL_KEYDOWNMASK should be imported'
197);
198is( SDL_KEYDOWNMASK(),
199	SDL_EVENTMASK(SDL_KEYDOWN),
200	'SDL_KEYDOWNMASK() should also be available'
201);
202is( SDL_KEYUPMASK,
203	SDL_EVENTMASK(SDL_KEYUP),
204	'SDL_KEYUPMASK should be imported'
205);
206is( SDL_KEYUPMASK(),
207	SDL_EVENTMASK(SDL_KEYUP),
208	'SDL_KEYUPMASK() should also be available'
209);
210is( SDL_KEYEVENTMASK,
211	SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
212	'SDL_KEYEVENTMASK should be imported'
213);
214is( SDL_KEYEVENTMASK(),
215	SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
216	'SDL_KEYEVENTMASK() should also be available'
217);
218
219is( SDL_MOUSEBUTTONDOWN, 5, 'SDL_MOUSEBUTTONDOWN should be imported' );
220is( SDL_MOUSEBUTTONDOWN(), 5,
221	'SDL_MOUSEBUTTONDOWN() should also be available'
222);
223is( SDL_MOUSEBUTTONUP,   6, 'SDL_MOUSEBUTTONUP should be imported' );
224is( SDL_MOUSEBUTTONUP(), 6, 'SDL_MOUSEBUTTONUP() should also be available' );
225is( SDL_MOUSEMOTION,     4, 'SDL_MOUSEMOTION should be imported' );
226is( SDL_MOUSEMOTION(),   4, 'SDL_MOUSEMOTION() should also be available' );
227is( SDL_MOUSEMOTIONMASK,
228	SDL_EVENTMASK(SDL_MOUSEMOTION),
229	'SDL_MOUSEMOTIONMASK should be imported'
230);
231is( SDL_MOUSEMOTIONMASK(),
232	SDL_EVENTMASK(SDL_MOUSEMOTION),
233	'SDL_MOUSEMOTIONMASK() should also be available'
234);
235is( SDL_MOUSEBUTTONDOWNMASK,
236	SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
237	'SDL_MOUSEBUTTONDOWNMASK should be imported'
238);
239is( SDL_MOUSEBUTTONDOWNMASK(),
240	SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
241	'SDL_MOUSEBUTTONDOWNMASK() should also be available'
242);
243is( SDL_MOUSEBUTTONUPMASK,
244	SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
245	'SDL_MOUSEBUTTONUPMASK should be imported'
246);
247is( SDL_MOUSEBUTTONUPMASK(),
248	SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
249	'SDL_MOUSEBUTTONUPMASK() should also be available'
250);
251is( SDL_MOUSEEVENTMASK,
252	SDL_EVENTMASK(SDL_MOUSEMOTION) | SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) |
253		SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
254	'SDL_MOUSEEVENTMASK should be imported'
255);
256is( SDL_MOUSEEVENTMASK(),
257	SDL_EVENTMASK(SDL_MOUSEMOTION) | SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) |
258		SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
259	'SDL_MOUSEEVENTMASK() should also be available'
260);
261
262is( SDL_NUMEVENTS,   32, 'SDL_NUMEVENTS should be imported' );
263is( SDL_NUMEVENTS(), 32, 'SDL_NUMEVENTS() should also be available' );
264
265is( SDL_PEEKEVENT,   1,                       'SDL_PEEKEVENT should be imported' );
266is( SDL_PEEKEVENT(), 1,                       'SDL_PEEKEVENT() should also be available' );
267is( SDL_PRESSED,     1,                       'SDL_PRESSED should be imported' );
268is( SDL_PRESSED(),   1,                       'SDL_PRESSED() should also be available' );
269is( SDL_QUERY,       -1,                      'SDL_QUERY should be imported' );
270is( SDL_QUERY(),     -1,                      'SDL_QUERY() should also be available' );
271is( SDL_QUIT,        12,                      'SDL_QUIT should be imported' );
272is( SDL_QUIT(),      12,                      'SDL_QUIT() should also be available' );
273is( SDL_QUITMASK,    SDL_EVENTMASK(SDL_QUIT), 'SDL_QUITMASK should be imported' );
274is( SDL_QUITMASK(), SDL_EVENTMASK(SDL_QUIT),
275	'SDL_QUITMASK() should also be available'
276);
277
278is( SDL_RELEASED,   0, 'SDL_RELEASED should be imported' );
279is( SDL_RELEASED(), 0, 'SDL_RELEASED() should also be available' );
280
281is( SDL_SYSWMEVENT,   13, 'SDL_SYSWMEVENT should be imported' );
282is( SDL_SYSWMEVENT(), 13, 'SDL_SYSWMEVENT() should also be available' );
283is( SDL_SYSWMEVENTMASK,
284	SDL_EVENTMASK(SDL_SYSWMEVENT),
285	'SDL_SYSWMEVENTMASK should be imported'
286);
287is( SDL_SYSWMEVENTMASK(),
288	SDL_EVENTMASK(SDL_SYSWMEVENT),
289	'SDL_SYSWMEVENTMASK() should also be available'
290);
291
292is( SDL_USEREVENT,   24, 'SDL_USEREVENT should be imported' );
293is( SDL_USEREVENT(), 24, 'SDL_USEREVENT() should also be available' );
294
295is( SDL_VIDEOEXPOSE,   17, 'SDL_VIDEOEXPOSE should be imported' );
296is( SDL_VIDEOEXPOSE(), 17, 'SDL_VIDEOEXPOSE() should also be available' );
297is( SDL_VIDEOEXPOSEMASK,
298	SDL_EVENTMASK(SDL_VIDEOEXPOSE),
299	'SDL_VIDEOEXPOSEMASK should be imported'
300);
301is( SDL_VIDEOEXPOSEMASK(),
302	SDL_EVENTMASK(SDL_VIDEOEXPOSE),
303	'SDL_VIDEOEXPOSEMASK() should also be available'
304);
305is( SDL_VIDEORESIZE,   16, 'SDL_VIDEORESIZE should be imported' );
306is( SDL_VIDEORESIZE(), 16, 'SDL_VIDEORESIZE() should also be available' );
307is( SDL_VIDEORESIZEMASK,
308	SDL_EVENTMASK(SDL_VIDEORESIZE),
309	'SDL_VIDEORESIZEMASK should be imported'
310);
311is( SDL_VIDEORESIZEMASK(),
312	SDL_EVENTMASK(SDL_VIDEORESIZE),
313	'SDL_VIDEORESIZEMASK() should also be available'
314);
315
316is( KMOD_ALT,        768,             'KMOD_ALT should be imported' );
317is( KMOD_ALT(),      768,             'KMOD_ALT() should also be available' );
318is( KMOD_CAPS,       8192,            'KMOD_CAPS should be imported' );
319is( KMOD_CAPS(),     8192,            'KMOD_CAPS() should also be available' );
320is( KMOD_CTRL,       192,             'KMOD_CTRL should be imported' );
321is( KMOD_CTRL(),     192,             'KMOD_CTRL() should also be available' );
322is( KMOD_LALT,       256,             'KMOD_LALT should be imported' );
323is( KMOD_LALT(),     256,             'KMOD_LALT() should also be available' );
324is( KMOD_LCTRL,      64,              'KMOD_LCTRL should be imported' );
325is( KMOD_LCTRL(),    64,              'KMOD_LCTRL() should also be available' );
326is( KMOD_LMETA,      0x0400,          'KMOD_LMETA should be imported' );
327is( KMOD_LMETA(),    0x0400,          'KMOD_LMETA() should also be available' );
328is( KMOD_LSHIFT,     1,               'KMOD_LSHIFT should be imported' );
329is( KMOD_LSHIFT(),   1,               'KMOD_LSHIFT() should also be available' );
330is( KMOD_META,       0x0400 | 0x0800, 'KMOD_META should be imported' );
331is( KMOD_META(),     0x0400 | 0x0800, 'KMOD_META() should also be available' );
332is( KMOD_MODE,       0x4000,          'KMOD_MODE should be imported' );
333is( KMOD_MODE(),     0x4000,          'KMOD_MODE() should also be available' );
334is( KMOD_NONE,       0,               'KMOD_NONE should be imported' );
335is( KMOD_NONE(),     0,               'KMOD_NONE() should also be available' );
336is( KMOD_NUM,        4096,            'KMOD_NUM should be imported' );
337is( KMOD_NUM(),      4096,            'KMOD_NUM() should also be available' );
338is( KMOD_RESERVED,   0x8000,          'KMOD_RESERVED should be imported' );
339is( KMOD_RESERVED(), 0x8000,          'KMOD_RESERVED() should also be available' );
340is( KMOD_RALT,       512,             'KMOD_RALT should be imported' );
341is( KMOD_RALT(),     512,             'KMOD_RALT() should also be available' );
342is( KMOD_RCTRL,      128,             'KMOD_RCTRL should be imported' );
343is( KMOD_RCTRL(),    128,             'KMOD_RCTRL() should also be available' );
344is( KMOD_RMETA,      0x0800,          'KMOD_RMETA should be imported' );
345is( KMOD_RMETA(),    0x0800,          'KMOD_RMETA() should also be available' );
346is( KMOD_RSHIFT,     2,               'KMOD_RSHIFT should be imported' );
347is( KMOD_RSHIFT(),   2,               'KMOD_RSHIFT() should also be available' );
348is( KMOD_SHIFT,      3,               'KMOD_SHIFT should be imported' );
349is( KMOD_SHIFT(),    3,               'KMOD_SHIFT() should also be available' );
350
351is( SDLK_0,              48,  'SDLK_0 should be imported' );
352is( SDLK_0(),            48,  'SDLK_0() should also be available' );
353is( SDLK_1,              49,  'SDLK_1 should be imported' );
354is( SDLK_1(),            49,  'SDLK_1() should also be available' );
355is( SDLK_2,              50,  'SDLK_2 should be imported' );
356is( SDLK_2(),            50,  'SDLK_2() should also be available' );
357is( SDLK_3,              51,  'SDLK_3 should be imported' );
358is( SDLK_3(),            51,  'SDLK_3() should also be available' );
359is( SDLK_4,              52,  'SDLK_4 should be imported' );
360is( SDLK_4(),            52,  'SDLK_4() should also be available' );
361is( SDLK_5,              53,  'SDLK_5 should be imported' );
362is( SDLK_5(),            53,  'SDLK_5() should also be available' );
363is( SDLK_6,              54,  'SDLK_6 should be imported' );
364is( SDLK_6(),            54,  'SDLK_6() should also be available' );
365is( SDLK_7,              55,  'SDLK_7 should be imported' );
366is( SDLK_7(),            55,  'SDLK_7() should also be available' );
367is( SDLK_8,              56,  'SDLK_8 should be imported' );
368is( SDLK_8(),            56,  'SDLK_8() should also be available' );
369is( SDLK_9,              57,  'SDLK_9 should be imported' );
370is( SDLK_9(),            57,  'SDLK_9() should also be available' );
371is( SDLK_AMPERSAND,      38,  'SDLK_AMPERSAND should be imported' );
372is( SDLK_AMPERSAND(),    38,  'SDLK_AMPERSAND() should also be available' );
373is( SDLK_ASTERISK,       42,  'SDLK_ASTERISK should be imported' );
374is( SDLK_ASTERISK(),     42,  'SDLK_ASTERISK() should also be available' );
375is( SDLK_AT,             64,  'SDLK_AT should be imported' );
376is( SDLK_AT(),           64,  'SDLK_AT() should also be available' );
377is( SDLK_BACKQUOTE,      96,  'SDLK_BACKQUOTE should be imported' );
378is( SDLK_BACKQUOTE(),    96,  'SDLK_BACKQUOTE() should also be available' );
379is( SDLK_BACKSLASH,      92,  'SDLK_BACKSLASH should be imported' );
380is( SDLK_BACKSLASH(),    92,  'SDLK_BACKSLASH() should also be available' );
381is( SDLK_BACKSPACE,      8,   'SDLK_BACKSPACE should be imported' );
382is( SDLK_BACKSPACE(),    8,   'SDLK_BACKSPACE() should also be available' );
383is( SDLK_BREAK,          318, 'SDLK_BREAK should be imported' );
384is( SDLK_BREAK(),        318, 'SDLK_BREAK() should also be available' );
385is( SDLK_CAPSLOCK,       301, 'SDLK_CAPSLOCK should be imported' );
386is( SDLK_CAPSLOCK(),     301, 'SDLK_CAPSLOCK() should also be available' );
387is( SDLK_CARET,          94,  'SDLK_CARET should be imported' );
388is( SDLK_CARET(),        94,  'SDLK_CARET() should also be available' );
389is( SDLK_CLEAR,          12,  'SDLK_CLEAR should be imported' );
390is( SDLK_CLEAR(),        12,  'SDLK_CLEAR() should also be available' );
391is( SDLK_COLON,          58,  'SDLK_COLON should be imported' );
392is( SDLK_COLON(),        58,  'SDLK_COLON() should also be available' );
393is( SDLK_COMMA,          44,  'SDLK_COMMA should be imported' );
394is( SDLK_COMMA(),        44,  'SDLK_COMMA() should also be available' );
395is( SDLK_COMPOSE,        314, 'SDLK_COMPOSE should be imported' );
396is( SDLK_COMPOSE(),      314, 'SDLK_COMPOSE() should also be available' );
397is( SDLK_DELETE,         127, 'SDLK_DELETE should be imported' );
398is( SDLK_DELETE(),       127, 'SDLK_DELETE() should also be available' );
399is( SDLK_DOLLAR,         36,  'SDLK_DOLLAR should be imported' );
400is( SDLK_DOLLAR(),       36,  'SDLK_DOLLAR() should also be available' );
401is( SDLK_DOWN,           274, 'SDLK_DOWN should be imported' );
402is( SDLK_DOWN(),         274, 'SDLK_DOWN() should also be available' );
403is( SDLK_END,            279, 'SDLK_END should be imported' );
404is( SDLK_END(),          279, 'SDLK_END() should also be available' );
405is( SDLK_EQUALS,         61,  'SDLK_EQUALS should be imported' );
406is( SDLK_EQUALS(),       61,  'SDLK_EQUALS() should also be available' );
407is( SDLK_ESCAPE,         27,  'SDLK_ESCAPE should be imported' );
408is( SDLK_ESCAPE(),       27,  'SDLK_ESCAPE() should also be available' );
409is( SDLK_EURO,           321, 'SDLK_EURO should be imported' );
410is( SDLK_EURO(),         321, 'SDLK_EURO() should also be available' );
411is( SDLK_EXCLAIM,        33,  'SDLK_EXCLAIM should be imported' );
412is( SDLK_EXCLAIM(),      33,  'SDLK_EXCLAIM() should also be available' );
413is( SDLK_F1,             282, 'SDLK_F1 should be imported' );
414is( SDLK_F1(),           282, 'SDLK_F1() should also be available' );
415is( SDLK_F10,            291, 'SDLK_F10 should be imported' );
416is( SDLK_F10(),          291, 'SDLK_F10() should also be available' );
417is( SDLK_F11,            292, 'SDLK_F11 should be imported' );
418is( SDLK_F11(),          292, 'SDLK_F11() should also be available' );
419is( SDLK_F12,            293, 'SDLK_F12 should be imported' );
420is( SDLK_F12(),          293, 'SDLK_F12() should also be available' );
421is( SDLK_F13,            294, 'SDLK_F13 should be imported' );
422is( SDLK_F13(),          294, 'SDLK_F13() should also be available' );
423is( SDLK_F14,            295, 'SDLK_F14 should be imported' );
424is( SDLK_F14(),          295, 'SDLK_F14() should also be available' );
425is( SDLK_F15,            296, 'SDLK_F15 should be imported' );
426is( SDLK_F15(),          296, 'SDLK_F15() should also be available' );
427is( SDLK_F2,             283, 'SDLK_F2 should be imported' );
428is( SDLK_F2(),           283, 'SDLK_F2() should also be available' );
429is( SDLK_F3,             284, 'SDLK_F3 should be imported' );
430is( SDLK_F3(),           284, 'SDLK_F3() should also be available' );
431is( SDLK_F4,             285, 'SDLK_F4 should be imported' );
432is( SDLK_F4(),           285, 'SDLK_F4() should also be available' );
433is( SDLK_F5,             286, 'SDLK_F5 should be imported' );
434is( SDLK_F5(),           286, 'SDLK_F5() should also be available' );
435is( SDLK_F6,             287, 'SDLK_F6 should be imported' );
436is( SDLK_F6(),           287, 'SDLK_F6() should also be available' );
437is( SDLK_F7,             288, 'SDLK_F7 should be imported' );
438is( SDLK_F7(),           288, 'SDLK_F7() should also be available' );
439is( SDLK_F8,             289, 'SDLK_F8 should be imported' );
440is( SDLK_F8(),           289, 'SDLK_F8() should also be available' );
441is( SDLK_F9,             290, 'SDLK_F9 should be imported' );
442is( SDLK_F9(),           290, 'SDLK_F9() should also be available' );
443is( SDLK_FIRST,          0,   'SDLK_FIRST should be imported' );
444is( SDLK_FIRST(),        0,   'SDLK_FIRST() should also be available' );
445is( SDLK_GREATER,        62,  'SDLK_GREATER should be imported' );
446is( SDLK_GREATER(),      62,  'SDLK_GREATER() should also be available' );
447is( SDLK_HASH,           35,  'SDLK_HASH should be imported' );
448is( SDLK_HASH(),         35,  'SDLK_HASH() should also be available' );
449is( SDLK_HELP,           315, 'SDLK_HELP should be imported' );
450is( SDLK_HELP(),         315, 'SDLK_HELP() should also be available' );
451is( SDLK_HOME,           278, 'SDLK_HOME should be imported' );
452is( SDLK_HOME(),         278, 'SDLK_HOME() should also be available' );
453is( SDLK_INSERT,         277, 'SDLK_INSERT should be imported' );
454is( SDLK_INSERT(),       277, 'SDLK_INSERT() should also be available' );
455is( SDLK_KP0,            256, 'SDLK_KP0 should be imported' );
456is( SDLK_KP0(),          256, 'SDLK_KP0() should also be available' );
457is( SDLK_KP1,            257, 'SDLK_KP1 should be imported' );
458is( SDLK_KP1(),          257, 'SDLK_KP1() should also be available' );
459is( SDLK_KP2,            258, 'SDLK_KP2 should be imported' );
460is( SDLK_KP2(),          258, 'SDLK_KP2() should also be available' );
461is( SDLK_KP3,            259, 'SDLK_KP3 should be imported' );
462is( SDLK_KP3(),          259, 'SDLK_KP3() should also be available' );
463is( SDLK_KP4,            260, 'SDLK_KP4 should be imported' );
464is( SDLK_KP4(),          260, 'SDLK_KP4() should also be available' );
465is( SDLK_KP5,            261, 'SDLK_KP5 should be imported' );
466is( SDLK_KP5(),          261, 'SDLK_KP5() should also be available' );
467is( SDLK_KP6,            262, 'SDLK_KP6 should be imported' );
468is( SDLK_KP6(),          262, 'SDLK_KP6() should also be available' );
469is( SDLK_KP7,            263, 'SDLK_KP7 should be imported' );
470is( SDLK_KP7(),          263, 'SDLK_KP7() should also be available' );
471is( SDLK_KP8,            264, 'SDLK_KP8 should be imported' );
472is( SDLK_KP8(),          264, 'SDLK_KP8() should also be available' );
473is( SDLK_KP9,            265, 'SDLK_KP9 should be imported' );
474is( SDLK_KP9(),          265, 'SDLK_KP9() should also be available' );
475is( SDLK_KP_DIVIDE,      267, 'SDLK_KP_DIVIDE should be imported' );
476is( SDLK_KP_DIVIDE(),    267, 'SDLK_KP_DIVIDE() should also be available' );
477is( SDLK_KP_ENTER,       271, 'SDLK_KP_ENTER should be imported' );
478is( SDLK_KP_ENTER(),     271, 'SDLK_KP_ENTER() should also be available' );
479is( SDLK_KP_EQUALS,      272, 'SDLK_KP_EQUALS should be imported' );
480is( SDLK_KP_EQUALS(),    272, 'SDLK_KP_EQUALS() should also be available' );
481is( SDLK_KP_MINUS,       269, 'SDLK_KP_MINUS should be imported' );
482is( SDLK_KP_MINUS(),     269, 'SDLK_KP_MINUS() should also be available' );
483is( SDLK_KP_MULTIPLY,    268, 'SDLK_KP_MULTIPLY should be imported' );
484is( SDLK_KP_MULTIPLY(),  268, 'SDLK_KP_MULTIPLY() should also be available' );
485is( SDLK_KP_PERIOD,      266, 'SDLK_KP_PERIOD should be imported' );
486is( SDLK_KP_PERIOD(),    266, 'SDLK_KP_PERIOD() should also be available' );
487is( SDLK_KP_PLUS,        270, 'SDLK_KP_PLUS should be imported' );
488is( SDLK_KP_PLUS(),      270, 'SDLK_KP_PLUS() should also be available' );
489is( SDLK_LALT,           308, 'SDLK_LALT should be imported' );
490is( SDLK_LALT(),         308, 'SDLK_LALT() should also be available' );
491is( SDLK_LCTRL,          306, 'SDLK_LCTRL should be imported' );
492is( SDLK_LCTRL(),        306, 'SDLK_LCTRL() should also be available' );
493is( SDLK_LEFT,           276, 'SDLK_LEFT should be imported' );
494is( SDLK_LEFT(),         276, 'SDLK_LEFT() should also be available' );
495is( SDLK_LEFTBRACKET,    91,  'SDLK_LEFTBRACKET should be imported' );
496is( SDLK_LEFTBRACKET(),  91,  'SDLK_LEFTBRACKET() should also be available' );
497is( SDLK_LEFTPAREN,      40,  'SDLK_LEFTPAREN should be imported' );
498is( SDLK_LEFTPAREN(),    40,  'SDLK_LEFTPAREN() should also be available' );
499is( SDLK_LESS,           60,  'SDLK_LESS should be imported' );
500is( SDLK_LESS(),         60,  'SDLK_LESS() should also be available' );
501is( SDLK_LMETA,          310, 'SDLK_LMETA should be imported' );
502is( SDLK_LMETA(),        310, 'SDLK_LMETA() should also be available' );
503is( SDLK_LSHIFT,         304, 'SDLK_LSHIFT should be imported' );
504is( SDLK_LSHIFT(),       304, 'SDLK_LSHIFT() should also be available' );
505is( SDLK_LSUPER,         311, 'SDLK_LSUPER should be imported' );
506is( SDLK_LSUPER(),       311, 'SDLK_LSUPER() should also be available' );
507is( SDLK_MENU,           319, 'SDLK_MENU should be imported' );
508is( SDLK_MENU(),         319, 'SDLK_MENU() should also be available' );
509is( SDLK_MINUS,          45,  'SDLK_MINUS should be imported' );
510is( SDLK_MINUS(),        45,  'SDLK_MINUS() should also be available' );
511is( SDLK_MODE,           313, 'SDLK_MODE should be imported' );
512is( SDLK_MODE(),         313, 'SDLK_MODE() should also be available' );
513is( SDLK_NUMLOCK,        300, 'SDLK_NUMLOCK should be imported' );
514is( SDLK_NUMLOCK(),      300, 'SDLK_NUMLOCK() should also be available' );
515is( SDLK_PAGEDOWN,       281, 'SDLK_PAGEDOWN should be imported' );
516is( SDLK_PAGEDOWN(),     281, 'SDLK_PAGEDOWN() should also be available' );
517is( SDLK_PAGEUP,         280, 'SDLK_PAGEUP should be imported' );
518is( SDLK_PAGEUP(),       280, 'SDLK_PAGEUP() should also be available' );
519is( SDLK_PAUSE,          19,  'SDLK_PAUSE should be imported' );
520is( SDLK_PAUSE(),        19,  'SDLK_PAUSE() should also be available' );
521is( SDLK_PERIOD,         46,  'SDLK_PERIOD should be imported' );
522is( SDLK_PERIOD(),       46,  'SDLK_PERIOD() should also be available' );
523is( SDLK_PLUS,           43,  'SDLK_PLUS should be imported' );
524is( SDLK_PLUS(),         43,  'SDLK_PLUS() should also be available' );
525is( SDLK_POWER,          320, 'SDLK_POWER should be imported' );
526is( SDLK_POWER(),        320, 'SDLK_POWER() should also be available' );
527is( SDLK_PRINT,          316, 'SDLK_PRINT should be imported' );
528is( SDLK_PRINT(),        316, 'SDLK_PRINT() should also be available' );
529is( SDLK_QUESTION,       63,  'SDLK_QUESTION should be imported' );
530is( SDLK_QUESTION(),     63,  'SDLK_QUESTION() should also be available' );
531is( SDLK_QUOTE,          39,  'SDLK_QUOTE should be imported' );
532is( SDLK_QUOTE(),        39,  'SDLK_QUOTE() should also be available' );
533is( SDLK_QUOTEDBL,       34,  'SDLK_QUOTEDBL should be imported' );
534is( SDLK_QUOTEDBL(),     34,  'SDLK_QUOTEDBL() should also be available' );
535is( SDLK_RALT,           307, 'SDLK_RALT should be imported' );
536is( SDLK_RALT(),         307, 'SDLK_RALT() should also be available' );
537is( SDLK_RCTRL,          305, 'SDLK_RCTRL should be imported' );
538is( SDLK_RCTRL(),        305, 'SDLK_RCTRL() should also be available' );
539is( SDLK_RETURN,         13,  'SDLK_RETURN should be imported' );
540is( SDLK_RETURN(),       13,  'SDLK_RETURN() should also be available' );
541is( SDLK_RIGHT,          275, 'SDLK_RIGHT should be imported' );
542is( SDLK_RIGHT(),        275, 'SDLK_RIGHT() should also be available' );
543is( SDLK_RIGHTBRACKET,   93,  'SDLK_RIGHTBRACKET should be imported' );
544is( SDLK_RIGHTBRACKET(), 93,  'SDLK_RIGHTBRACKET() should also be available' );
545is( SDLK_RIGHTPAREN,     41,  'SDLK_RIGHTPAREN should be imported' );
546is( SDLK_RIGHTPAREN(),   41,  'SDLK_RIGHTPAREN() should also be available' );
547is( SDLK_RMETA,          309, 'SDLK_RMETA should be imported' );
548is( SDLK_RMETA(),        309, 'SDLK_RMETA() should also be available' );
549is( SDLK_RSHIFT,         303, 'SDLK_RSHIFT should be imported' );
550is( SDLK_RSHIFT(),       303, 'SDLK_RSHIFT() should also be available' );
551is( SDLK_RSUPER,         312, 'SDLK_RSUPER should be imported' );
552is( SDLK_RSUPER(),       312, 'SDLK_RSUPER() should also be available' );
553is( SDLK_SCROLLOCK,      302, 'SDLK_SCROLLOCK should be imported' );
554is( SDLK_SCROLLOCK(),    302, 'SDLK_SCROLLOCK() should also be available' );
555is( SDLK_SEMICOLON,      59,  'SDLK_SEMICOLON should be imported' );
556is( SDLK_SEMICOLON(),    59,  'SDLK_SEMICOLON() should also be available' );
557is( SDLK_SLASH,          47,  'SDLK_SLASH should be imported' );
558is( SDLK_SLASH(),        47,  'SDLK_SLASH() should also be available' );
559is( SDLK_SPACE,          32,  'SDLK_SPACE should be imported' );
560is( SDLK_SPACE(),        32,  'SDLK_SPACE() should also be available' );
561is( SDLK_SYSREQ,         317, 'SDLK_SYSREQ should be imported' );
562is( SDLK_SYSREQ(),       317, 'SDLK_SYSREQ() should also be available' );
563is( SDLK_TAB,            9,   'SDLK_TAB should be imported' );
564is( SDLK_TAB(),          9,   'SDLK_TAB() should also be available' );
565is( SDLK_UNDERSCORE,     95,  'SDLK_UNDERSCORE should be imported' );
566is( SDLK_UNDERSCORE(),   95,  'SDLK_UNDERSCORE() should also be available' );
567is( SDLK_UNDO,           322, 'SDLK_UNDO should be imported' );
568is( SDLK_UNDO(),         322, 'SDLK_UNDO() should also be available' );
569is( SDLK_UNKNOWN,        0,   'SDLK_WORLD_95 should be imported' );
570is( SDLK_UNKNOWN(),      0,   'SDLK_WORLD_95() should also be available' );
571is( SDLK_UP,             273, 'SDLK_UP should be imported' );
572is( SDLK_UP(),           273, 'SDLK_UP() should also be available' );
573is( SDLK_WORLD_0,        160, 'SDLK_WORLD_0 should be imported' );
574is( SDLK_WORLD_0(),      160, 'SDLK_WORLD_0() should also be available' );
575is( SDLK_WORLD_1,        161, 'SDLK_WORLD_1 should be imported' );
576is( SDLK_WORLD_1(),      161, 'SDLK_WORLD_1() should also be available' );
577is( SDLK_WORLD_2,        162, 'SDLK_WORLD_2 should be imported' );
578is( SDLK_WORLD_2(),      162, 'SDLK_WORLD_2() should also be available' );
579is( SDLK_WORLD_3,        163, 'SDLK_WORLD_3 should be imported' );
580is( SDLK_WORLD_3(),      163, 'SDLK_WORLD_3() should also be available' );
581is( SDLK_WORLD_4,        164, 'SDLK_WORLD_4 should be imported' );
582is( SDLK_WORLD_4(),      164, 'SDLK_WORLD_4() should also be available' );
583is( SDLK_WORLD_5,        165, 'SDLK_WORLD_5 should be imported' );
584is( SDLK_WORLD_5(),      165, 'SDLK_WORLD_5() should also be available' );
585is( SDLK_WORLD_6,        166, 'SDLK_WORLD_6 should be imported' );
586is( SDLK_WORLD_6(),      166, 'SDLK_WORLD_6() should also be available' );
587is( SDLK_WORLD_7,        167, 'SDLK_WORLD_7 should be imported' );
588is( SDLK_WORLD_7(),      167, 'SDLK_WORLD_7() should also be available' );
589is( SDLK_WORLD_8,        168, 'SDLK_WORLD_8 should be imported' );
590is( SDLK_WORLD_8(),      168, 'SDLK_WORLD_8() should also be available' );
591is( SDLK_WORLD_9,        169, 'SDLK_WORLD_9 should be imported' );
592is( SDLK_WORLD_9(),      169, 'SDLK_WORLD_9() should also be available' );
593is( SDLK_WORLD_10,       170, 'SDLK_WORLD_10 should be imported' );
594is( SDLK_WORLD_10(),     170, 'SDLK_WORLD_10() should also be available' );
595is( SDLK_WORLD_11,       171, 'SDLK_WORLD_11 should be imported' );
596is( SDLK_WORLD_11(),     171, 'SDLK_WORLD_11() should also be available' );
597is( SDLK_WORLD_12,       172, 'SDLK_WORLD_12 should be imported' );
598is( SDLK_WORLD_12(),     172, 'SDLK_WORLD_12() should also be available' );
599is( SDLK_WORLD_13,       173, 'SDLK_WORLD_13 should be imported' );
600is( SDLK_WORLD_13(),     173, 'SDLK_WORLD_13() should also be available' );
601is( SDLK_WORLD_14,       174, 'SDLK_WORLD_14 should be imported' );
602is( SDLK_WORLD_14(),     174, 'SDLK_WORLD_14() should also be available' );
603is( SDLK_WORLD_15,       175, 'SDLK_WORLD_15 should be imported' );
604is( SDLK_WORLD_15(),     175, 'SDLK_WORLD_15() should also be available' );
605is( SDLK_WORLD_16,       176, 'SDLK_WORLD_16 should be imported' );
606is( SDLK_WORLD_16(),     176, 'SDLK_WORLD_16() should also be available' );
607is( SDLK_WORLD_17,       177, 'SDLK_WORLD_17 should be imported' );
608is( SDLK_WORLD_17(),     177, 'SDLK_WORLD_17() should also be available' );
609is( SDLK_WORLD_18,       178, 'SDLK_WORLD_18 should be imported' );
610is( SDLK_WORLD_18(),     178, 'SDLK_WORLD_18() should also be available' );
611is( SDLK_WORLD_19,       179, 'SDLK_WORLD_19 should be imported' );
612is( SDLK_WORLD_19(),     179, 'SDLK_WORLD_19() should also be available' );
613is( SDLK_WORLD_20,       180, 'SDLK_WORLD_20 should be imported' );
614is( SDLK_WORLD_20(),     180, 'SDLK_WORLD_20() should also be available' );
615is( SDLK_WORLD_21,       181, 'SDLK_WORLD_21 should be imported' );
616is( SDLK_WORLD_21(),     181, 'SDLK_WORLD_21() should also be available' );
617is( SDLK_WORLD_22,       182, 'SDLK_WORLD_22 should be imported' );
618is( SDLK_WORLD_22(),     182, 'SDLK_WORLD_22() should also be available' );
619is( SDLK_WORLD_23,       183, 'SDLK_WORLD_23 should be imported' );
620is( SDLK_WORLD_23(),     183, 'SDLK_WORLD_23() should also be available' );
621is( SDLK_WORLD_24,       184, 'SDLK_WORLD_24 should be imported' );
622is( SDLK_WORLD_24(),     184, 'SDLK_WORLD_24() should also be available' );
623is( SDLK_WORLD_25,       185, 'SDLK_WORLD_25 should be imported' );
624is( SDLK_WORLD_25(),     185, 'SDLK_WORLD_25() should also be available' );
625is( SDLK_WORLD_26,       186, 'SDLK_WORLD_26 should be imported' );
626is( SDLK_WORLD_26(),     186, 'SDLK_WORLD_26() should also be available' );
627is( SDLK_WORLD_27,       187, 'SDLK_WORLD_27 should be imported' );
628is( SDLK_WORLD_27(),     187, 'SDLK_WORLD_27() should also be available' );
629is( SDLK_WORLD_28,       188, 'SDLK_WORLD_28 should be imported' );
630is( SDLK_WORLD_28(),     188, 'SDLK_WORLD_28() should also be available' );
631is( SDLK_WORLD_29,       189, 'SDLK_WORLD_29 should be imported' );
632is( SDLK_WORLD_29(),     189, 'SDLK_WORLD_29() should also be available' );
633is( SDLK_WORLD_30,       190, 'SDLK_WORLD_30 should be imported' );
634is( SDLK_WORLD_30(),     190, 'SDLK_WORLD_30() should also be available' );
635is( SDLK_WORLD_31,       191, 'SDLK_WORLD_31 should be imported' );
636is( SDLK_WORLD_31(),     191, 'SDLK_WORLD_31() should also be available' );
637is( SDLK_WORLD_32,       192, 'SDLK_WORLD_32 should be imported' );
638is( SDLK_WORLD_32(),     192, 'SDLK_WORLD_32() should also be available' );
639is( SDLK_WORLD_33,       193, 'SDLK_WORLD_33 should be imported' );
640is( SDLK_WORLD_33(),     193, 'SDLK_WORLD_33() should also be available' );
641is( SDLK_WORLD_34,       194, 'SDLK_WORLD_34 should be imported' );
642is( SDLK_WORLD_34(),     194, 'SDLK_WORLD_34() should also be available' );
643is( SDLK_WORLD_35,       195, 'SDLK_WORLD_35 should be imported' );
644is( SDLK_WORLD_35(),     195, 'SDLK_WORLD_35() should also be available' );
645is( SDLK_WORLD_36,       196, 'SDLK_WORLD_36 should be imported' );
646is( SDLK_WORLD_36(),     196, 'SDLK_WORLD_36() should also be available' );
647is( SDLK_WORLD_37,       197, 'SDLK_WORLD_37 should be imported' );
648is( SDLK_WORLD_37(),     197, 'SDLK_WORLD_37() should also be available' );
649is( SDLK_WORLD_38,       198, 'SDLK_WORLD_38 should be imported' );
650is( SDLK_WORLD_38(),     198, 'SDLK_WORLD_38() should also be available' );
651is( SDLK_WORLD_39,       199, 'SDLK_WORLD_39 should be imported' );
652is( SDLK_WORLD_39(),     199, 'SDLK_WORLD_39() should also be available' );
653is( SDLK_WORLD_40,       200, 'SDLK_WORLD_40 should be imported' );
654is( SDLK_WORLD_40(),     200, 'SDLK_WORLD_40() should also be available' );
655is( SDLK_WORLD_41,       201, 'SDLK_WORLD_41 should be imported' );
656is( SDLK_WORLD_41(),     201, 'SDLK_WORLD_41() should also be available' );
657is( SDLK_WORLD_42,       202, 'SDLK_WORLD_42 should be imported' );
658is( SDLK_WORLD_42(),     202, 'SDLK_WORLD_42() should also be available' );
659is( SDLK_WORLD_43,       203, 'SDLK_WORLD_43 should be imported' );
660is( SDLK_WORLD_43(),     203, 'SDLK_WORLD_43() should also be available' );
661is( SDLK_WORLD_44,       204, 'SDLK_WORLD_44 should be imported' );
662is( SDLK_WORLD_44(),     204, 'SDLK_WORLD_44() should also be available' );
663is( SDLK_WORLD_45,       205, 'SDLK_WORLD_45 should be imported' );
664is( SDLK_WORLD_45(),     205, 'SDLK_WORLD_45() should also be available' );
665is( SDLK_WORLD_46,       206, 'SDLK_WORLD_46 should be imported' );
666is( SDLK_WORLD_46(),     206, 'SDLK_WORLD_46() should also be available' );
667is( SDLK_WORLD_47,       207, 'SDLK_WORLD_47 should be imported' );
668is( SDLK_WORLD_47(),     207, 'SDLK_WORLD_47() should also be available' );
669is( SDLK_WORLD_48,       208, 'SDLK_WORLD_48 should be imported' );
670is( SDLK_WORLD_48(),     208, 'SDLK_WORLD_48() should also be available' );
671is( SDLK_WORLD_49,       209, 'SDLK_WORLD_49 should be imported' );
672is( SDLK_WORLD_49(),     209, 'SDLK_WORLD_49() should also be available' );
673is( SDLK_WORLD_50,       210, 'SDLK_WORLD_50 should be imported' );
674is( SDLK_WORLD_50(),     210, 'SDLK_WORLD_50() should also be available' );
675is( SDLK_WORLD_51,       211, 'SDLK_WORLD_51 should be imported' );
676is( SDLK_WORLD_51(),     211, 'SDLK_WORLD_51() should also be available' );
677is( SDLK_WORLD_52,       212, 'SDLK_WORLD_52 should be imported' );
678is( SDLK_WORLD_52(),     212, 'SDLK_WORLD_52() should also be available' );
679is( SDLK_WORLD_53,       213, 'SDLK_WORLD_53 should be imported' );
680is( SDLK_WORLD_53(),     213, 'SDLK_WORLD_53() should also be available' );
681is( SDLK_WORLD_54,       214, 'SDLK_WORLD_54 should be imported' );
682is( SDLK_WORLD_54(),     214, 'SDLK_WORLD_54() should also be available' );
683is( SDLK_WORLD_55,       215, 'SDLK_WORLD_55 should be imported' );
684is( SDLK_WORLD_55(),     215, 'SDLK_WORLD_55() should also be available' );
685is( SDLK_WORLD_56,       216, 'SDLK_WORLD_56 should be imported' );
686is( SDLK_WORLD_56(),     216, 'SDLK_WORLD_56() should also be available' );
687is( SDLK_WORLD_57,       217, 'SDLK_WORLD_57 should be imported' );
688is( SDLK_WORLD_57(),     217, 'SDLK_WORLD_57() should also be available' );
689is( SDLK_WORLD_58,       218, 'SDLK_WORLD_58 should be imported' );
690is( SDLK_WORLD_58(),     218, 'SDLK_WORLD_58() should also be available' );
691is( SDLK_WORLD_59,       219, 'SDLK_WORLD_59 should be imported' );
692is( SDLK_WORLD_59(),     219, 'SDLK_WORLD_59() should also be available' );
693is( SDLK_WORLD_60,       220, 'SDLK_WORLD_60 should be imported' );
694is( SDLK_WORLD_60(),     220, 'SDLK_WORLD_60() should also be available' );
695is( SDLK_WORLD_61,       221, 'SDLK_WORLD_61 should be imported' );
696is( SDLK_WORLD_61(),     221, 'SDLK_WORLD_61() should also be available' );
697is( SDLK_WORLD_62,       222, 'SDLK_WORLD_62 should be imported' );
698is( SDLK_WORLD_62(),     222, 'SDLK_WORLD_62() should also be available' );
699is( SDLK_WORLD_63,       223, 'SDLK_WORLD_63 should be imported' );
700is( SDLK_WORLD_63(),     223, 'SDLK_WORLD_63() should also be available' );
701is( SDLK_WORLD_64,       224, 'SDLK_WORLD_64 should be imported' );
702is( SDLK_WORLD_64(),     224, 'SDLK_WORLD_64() should also be available' );
703is( SDLK_WORLD_65,       225, 'SDLK_WORLD_65 should be imported' );
704is( SDLK_WORLD_65(),     225, 'SDLK_WORLD_65() should also be available' );
705is( SDLK_WORLD_66,       226, 'SDLK_WORLD_66 should be imported' );
706is( SDLK_WORLD_66(),     226, 'SDLK_WORLD_66() should also be available' );
707is( SDLK_WORLD_67,       227, 'SDLK_WORLD_67 should be imported' );
708is( SDLK_WORLD_67(),     227, 'SDLK_WORLD_67() should also be available' );
709is( SDLK_WORLD_68,       228, 'SDLK_WORLD_68 should be imported' );
710is( SDLK_WORLD_68(),     228, 'SDLK_WORLD_68() should also be available' );
711is( SDLK_WORLD_69,       229, 'SDLK_WORLD_69 should be imported' );
712is( SDLK_WORLD_69(),     229, 'SDLK_WORLD_69() should also be available' );
713is( SDLK_WORLD_70,       230, 'SDLK_WORLD_70 should be imported' );
714is( SDLK_WORLD_70(),     230, 'SDLK_WORLD_70() should also be available' );
715is( SDLK_WORLD_71,       231, 'SDLK_WORLD_71 should be imported' );
716is( SDLK_WORLD_71(),     231, 'SDLK_WORLD_71() should also be available' );
717is( SDLK_WORLD_72,       232, 'SDLK_WORLD_72 should be imported' );
718is( SDLK_WORLD_72(),     232, 'SDLK_WORLD_72() should also be available' );
719is( SDLK_WORLD_73,       233, 'SDLK_WORLD_73 should be imported' );
720is( SDLK_WORLD_73(),     233, 'SDLK_WORLD_73() should also be available' );
721is( SDLK_WORLD_74,       234, 'SDLK_WORLD_74 should be imported' );
722is( SDLK_WORLD_74(),     234, 'SDLK_WORLD_74() should also be available' );
723is( SDLK_WORLD_75,       235, 'SDLK_WORLD_75 should be imported' );
724is( SDLK_WORLD_75(),     235, 'SDLK_WORLD_75() should also be available' );
725is( SDLK_WORLD_76,       236, 'SDLK_WORLD_76 should be imported' );
726is( SDLK_WORLD_76(),     236, 'SDLK_WORLD_76() should also be available' );
727is( SDLK_WORLD_77,       237, 'SDLK_WORLD_77 should be imported' );
728is( SDLK_WORLD_77(),     237, 'SDLK_WORLD_77() should also be available' );
729is( SDLK_WORLD_78,       238, 'SDLK_WORLD_78 should be imported' );
730is( SDLK_WORLD_78(),     238, 'SDLK_WORLD_78() should also be available' );
731is( SDLK_WORLD_79,       239, 'SDLK_WORLD_79 should be imported' );
732is( SDLK_WORLD_79(),     239, 'SDLK_WORLD_79() should also be available' );
733is( SDLK_WORLD_80,       240, 'SDLK_WORLD_80 should be imported' );
734is( SDLK_WORLD_80(),     240, 'SDLK_WORLD_80() should also be available' );
735is( SDLK_WORLD_81,       241, 'SDLK_WORLD_81 should be imported' );
736is( SDLK_WORLD_81(),     241, 'SDLK_WORLD_81() should also be available' );
737is( SDLK_WORLD_82,       242, 'SDLK_WORLD_82 should be imported' );
738is( SDLK_WORLD_82(),     242, 'SDLK_WORLD_82() should also be available' );
739is( SDLK_WORLD_83,       243, 'SDLK_WORLD_83 should be imported' );
740is( SDLK_WORLD_83(),     243, 'SDLK_WORLD_83() should also be available' );
741is( SDLK_WORLD_84,       244, 'SDLK_WORLD_84 should be imported' );
742is( SDLK_WORLD_84(),     244, 'SDLK_WORLD_84() should also be available' );
743is( SDLK_WORLD_85,       245, 'SDLK_WORLD_85 should be imported' );
744is( SDLK_WORLD_85(),     245, 'SDLK_WORLD_85() should also be available' );
745is( SDLK_WORLD_86,       246, 'SDLK_WORLD_86 should be imported' );
746is( SDLK_WORLD_86(),     246, 'SDLK_WORLD_86() should also be available' );
747is( SDLK_WORLD_87,       247, 'SDLK_WORLD_87 should be imported' );
748is( SDLK_WORLD_87(),     247, 'SDLK_WORLD_87() should also be available' );
749is( SDLK_WORLD_88,       248, 'SDLK_WORLD_88 should be imported' );
750is( SDLK_WORLD_88(),     248, 'SDLK_WORLD_88() should also be available' );
751is( SDLK_WORLD_89,       249, 'SDLK_WORLD_89 should be imported' );
752is( SDLK_WORLD_89(),     249, 'SDLK_WORLD_89() should also be available' );
753is( SDLK_WORLD_90,       250, 'SDLK_WORLD_90 should be imported' );
754is( SDLK_WORLD_90(),     250, 'SDLK_WORLD_90() should also be available' );
755is( SDLK_WORLD_91,       251, 'SDLK_WORLD_91 should be imported' );
756is( SDLK_WORLD_91(),     251, 'SDLK_WORLD_91() should also be available' );
757is( SDLK_WORLD_92,       252, 'SDLK_WORLD_92 should be imported' );
758is( SDLK_WORLD_92(),     252, 'SDLK_WORLD_92() should also be available' );
759is( SDLK_WORLD_93,       253, 'SDLK_WORLD_93 should be imported' );
760is( SDLK_WORLD_93(),     253, 'SDLK_WORLD_93() should also be available' );
761is( SDLK_WORLD_94,       254, 'SDLK_WORLD_94 should be imported' );
762is( SDLK_WORLD_94(),     254, 'SDLK_WORLD_94() should also be available' );
763is( SDLK_WORLD_95,       255, 'SDLK_WORLD_95 should be imported' );
764is( SDLK_WORLD_95(),     255, 'SDLK_WORLD_95() should also be available' );
765is( SDLK_a,              97,  'SDLK_a should be imported' );
766is( SDLK_a(),            97,  'SDLK_a() should also be available' );
767is( SDLK_b,              98,  'SDLK_b should be imported' );
768is( SDLK_b(),            98,  'SDLK_b() should also be available' );
769is( SDLK_c,              99,  'SDLK_c should be imported' );
770is( SDLK_c(),            99,  'SDLK_c() should also be available' );
771is( SDLK_d,              100, 'SDLK_d should be imported' );
772is( SDLK_d(),            100, 'SDLK_d() should also be available' );
773is( SDLK_e,              101, 'SDLK_e should be imported' );
774is( SDLK_e(),            101, 'SDLK_e() should also be available' );
775is( SDLK_f,              102, 'SDLK_f should be imported' );
776is( SDLK_f(),            102, 'SDLK_f() should also be available' );
777is( SDLK_g,              103, 'SDLK_g should be imported' );
778is( SDLK_g(),            103, 'SDLK_g() should also be available' );
779is( SDLK_h,              104, 'SDLK_h should be imported' );
780is( SDLK_h(),            104, 'SDLK_h() should also be available' );
781is( SDLK_i,              105, 'SDLK_i should be imported' );
782is( SDLK_i(),            105, 'SDLK_i() should also be available' );
783is( SDLK_j,              106, 'SDLK_j should be imported' );
784is( SDLK_j(),            106, 'SDLK_j() should also be available' );
785is( SDLK_k,              107, 'SDLK_k should be imported' );
786is( SDLK_k(),            107, 'SDLK_k() should also be available' );
787is( SDLK_l,              108, 'SDLK_l should be imported' );
788is( SDLK_l(),            108, 'SDLK_l() should also be available' );
789is( SDLK_m,              109, 'SDLK_m should be imported' );
790is( SDLK_m(),            109, 'SDLK_m() should also be available' );
791is( SDLK_n,              110, 'SDLK_n should be imported' );
792is( SDLK_n(),            110, 'SDLK_n() should also be available' );
793is( SDLK_o,              111, 'SDLK_o should be imported' );
794is( SDLK_o(),            111, 'SDLK_o() should also be available' );
795is( SDLK_p,              112, 'SDLK_p should be imported' );
796is( SDLK_p(),            112, 'SDLK_p() should also be available' );
797is( SDLK_q,              113, 'SDLK_q should be imported' );
798is( SDLK_q(),            113, 'SDLK_q() should also be available' );
799is( SDLK_r,              114, 'SDLK_r should be imported' );
800is( SDLK_r(),            114, 'SDLK_r() should also be available' );
801is( SDLK_s,              115, 'SDLK_s should be imported' );
802is( SDLK_s(),            115, 'SDLK_s() should also be available' );
803is( SDLK_t,              116, 'SDLK_t should be imported' );
804is( SDLK_t(),            116, 'SDLK_t() should also be available' );
805is( SDLK_u,              117, 'SDLK_u should be imported' );
806is( SDLK_u(),            117, 'SDLK_u() should also be available' );
807is( SDLK_v,              118, 'SDLK_v should be imported' );
808is( SDLK_v(),            118, 'SDLK_v() should also be available' );
809is( SDLK_w,              119, 'SDLK_w should be imported' );
810is( SDLK_w(),            119, 'SDLK_w() should also be available' );
811is( SDLK_x,              120, 'SDLK_x should be imported' );
812is( SDLK_x(),            120, 'SDLK_x() should also be available' );
813is( SDLK_y,              121, 'SDLK_y should be imported' );
814is( SDLK_y(),            121, 'SDLK_y() should also be available' );
815is( SDLK_z,              122, 'SDLK_z should be imported' );
816is( SDLK_z(),            122, 'SDLK_z() should also be available' );
817
818my $display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );
819
820is( SDL::Events::pump_events(), undef, '[pump_events] Returns undef' );
821
822my $event = SDL::Event->new();
823
824my $aevent = SDL::Event->new();
825$aevent->type(SDL_ACTIVEEVENT);
826$aevent->active_gain(1);
827$aevent->active_state(SDL_APPINPUTFOCUS);
828
829my $userdata = SDL::Event->new();
830$userdata->type(SDL_USEREVENT);
831my @udata = ( 0 .. 10 );
832$userdata->user_data1( \@udata );
833
834SDL::Events::push_event($aevent);
835pass '[push_event] Event can be pushed';
836SDL::Events::push_event($userdata);
837SDL::Events::pump_events();
838pass '[pump_events] pumping events';
839
840my $got_event = 0;
841
842while (1) {
843	SDL::Events::pump_events();
844
845	my $ret = SDL::Events::poll_event($event);
846	my $r;
847	if (   $event->type == SDL_ACTIVEEVENT
848		&& $event->active_gain == 1
849		&& $event->active_state == SDL_APPINPUTFOCUS )
850	{
851		$got_event = 1;
852		is( $got_event,            1, '[poll_event] Got an Active event back out' );
853		is( $event->active_gain(), 1, '[poll_event] Got right active->gain' );
854		is( $event->active_state(), SDL_APPINPUTFOCUS,
855			'[poll_event] Got right active->state'
856		);
857
858	}
859	if ( $event->type == SDL_USEREVENT ) {
860		$r = $event->user_data1();
861		is( @{$r}, 11, '[user_events] can hold user data now' );
862
863	}
864	last if $r && $got_event;
865	last if ( $ret == 0 );
866}
867
868SDL::Events::push_event($aevent);
869pass '[push_event] ran';
870
871SDL::Events::pump_events();
872
873my $value = SDL::Events::wait_event($event);
874
875is( $value, 1, '[wait_event] waited for event' );
876
877my $num_peep_events = SDL::Events::peep_events( $event, 127, SDL_PEEKEVENT, SDL_ALLEVENTS );
878is( $num_peep_events >= 0,
879	1, '[peep_events] Size of event queue is ' . $num_peep_events
880);
881
882my $callback = sub { return 1; };
883SDL::Events::set_event_filter($callback);
884pass '[set_event_filter] takes a callback';
885
886my $array = SDL::Events::get_key_state();
887isa_ok( $array, 'ARRAY', '[get_key_state] returned and array' );
888
889my @mods = (
890	KMOD_NONE,  KMOD_LSHIFT, KMOD_RSHIFT, KMOD_LCTRL,
891	KMOD_RCTRL, KMOD_LALT,   KMOD_RALT,   KMOD_LMETA,
892	KMOD_RMETA, KMOD_NUM,    KMOD_CAPS,   KMOD_MODE,
893);
894
895foreach (@mods) {
896	SDL::Events::set_mod_state($_);
897	pass '[set_mod_state] set the mod properly';
898	is( SDL::Events::get_mod_state(),
899		$_, '[get_mod_state] got the mod properly'
900	);
901
902}
903
904#SDL::quit();
905
906#SDL::init(SDL_INIT_VIDEO);
907
908$display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );
909
910SDL::Video::get_video_info();
911
912is( SDL::Events::get_key_name(SDLK_ESCAPE),
913	'escape', '[get_key_name] Gets name of key_sym back'
914);
915
916SDL::Events::push_event($aevent);
917my $nevent = SDL::Event->new();
918SDL::Events::event_state( SDL_ACTIVEEVENT, SDL_IGNORE );
919SDL::Events::pump_events();
920
921my $got = 0;
922while ( SDL::Events::poll_event($nevent) ) {
923	$got = 1 if $nevent->type == SDL_ACTIVEEVENT;
924}
925is( $got, 0, '[event_state] works with SDL_IGNORE on SDL_ACTIVEEVENT' );
926
927SDL::Events::event_state( SDL_ACTIVEEVENT, SDL_ENABLE );
928SDL::Events::push_event($aevent);
929SDL::Events::pump_events();
930my $atleast = 0;
931while ( SDL::Events::poll_event($nevent) ) {
932	$atleast = 1 if $nevent->type == SDL_ACTIVEEVENT;
933}
934is( $atleast, 1, '[event_state] works with SDL_ENABLE on SDL_ACTIVEEVENT' );
935
936is( SDL::Events::enable_unicode(1),  0, '[enable_unicode] return 0 took 1' );
937is( SDL::Events::enable_unicode(-1), 1, '[enable_unicode] return 1 took -1' );
938is( SDL::Events::enable_unicode(0),  1,

Large files files are truncated, but you can click here to view the full file