Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 1030 lines (957 sloc) 52.55 kb
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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 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 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
#!/usr/bin/perl -w
use strict;
use SDL;
use SDL::Event;
use SDL::Events;
use SDL::Surface;
use SDL::Video;
use Devel::Peek;
use Test::More;
use lib 't/lib';
use SDL::TestTool;

my $videodriver = $ENV{SDL_VIDEODRIVER};
$ENV{SDL_VIDEODRIVER} = 'dummy' unless $ENV{SDL_RELEASE_TESTING};

if ( !SDL::TestTool->init(SDL_INIT_VIDEO) ) {
plan( skip_all => 'Failed to init video' );
}

my @done = qw/
pump_events
peep_events
push_event
poll_event
wait_event
set_event_filter
event_state
get_key_state
get_key_name
get_mod_state
set_mod_state
enable_unicode
enable_key_repeat
get_mouse_state
get_relative_mouse_state
get_app_state
joystick_event_state
/;

my @done_event = qw/
type
active
key
motion
button
jaxis
jball
jhat
jbutton
resize
expose
quit
user
syswm
/;

can_ok( 'SDL::Events', @done );
can_ok( 'SDL::Event', @done_event );

is( SDL_ACTIVEEVENT, 1, 'SDL_ACTIVEEVENT should be imported' );
is( SDL_ACTIVEEVENT(), 1, 'SDL_ACTIVEEVENT() should also be available' );
is( SDL_ACTIVEEVENTMASK,
SDL_EVENTMASK(SDL_ACTIVEEVENT),
'SDL_ACTIVEVENTMASK should be imported'
);
is( SDL_ACTIVEEVENTMASK(),
SDL_EVENTMASK(SDL_ACTIVEEVENT),
'SDL_ACTIVEVENTMASK() should also be available'
);
is( SDL_ADDEVENT, 0, 'SDL_ADDEVENT should be imported' );
is( SDL_ADDEVENT(), 0, 'SDL_ADDEVENT() should also be available' );
is( SDL_ALLEVENTS, 0xFFFFFFFF, 'SDL_ALLEVENTS should be imported' );
is( SDL_ALLEVENTS(), 0xFFFFFFFF, 'SDL_ALLEVENTS() should also be available' );

is( SDL_APPACTIVE, 4, 'SDL_APPACTIVE should be imported' );
is( SDL_APPACTIVE(), 4, 'SDL_APPACTIVE() should also be available' );
is( SDL_APPINPUTFOCUS, 2, 'SDL_APPINPUTFOCUS should be imported' );
is( SDL_APPINPUTFOCUS(), 2, 'SDL_APPINPUTFOCUS() should also be available' );
is( SDL_APPMOUSEFOCUS, 1, 'SDL_APPMOUSEFOCUS should be imported' );
is( SDL_APPMOUSEFOCUS(), 1, 'SDL_APPMOUSEFOCUS() should also be available' );

is( SDL_BUTTON_LEFT, 1, 'SDL_BUTTON_LEFT should be imported' );
is( SDL_BUTTON_LEFT(), 1, 'SDL_BUTTON_LEFT() should also be available' );
is( SDL_BUTTON_MIDDLE, 2, 'SDL_BUTTON_MIDDLE should be imported' );
is( SDL_BUTTON_MIDDLE(), 2, 'SDL_BUTTON_MIDDLE() should also be available' );
is( SDL_BUTTON_RIGHT, 3, 'SDL_BUTTON_RIGHT should be imported' );
is( SDL_BUTTON_RIGHT(), 3, 'SDL_BUTTON_RIGHT() should also be available' );
is( SDL_BUTTON_WHEELUP, 4, 'SDL_BUTTON_WHEELUP should be imported' );
is( SDL_BUTTON_WHEELUP(), 4, 'SDL_BUTTON_WHEELUP() should also be available' );
is( SDL_BUTTON_WHEELDOWN, 5, 'SDL_BUTTON_WHEELDOWN should be imported' );
is( SDL_BUTTON_WHEELDOWN(), 5,
'SDL_BUTTON_WHEELDOWN() should also be available'
);

is( SDL_DISABLE, 0, 'SDL_DISABLE should be imported' );
is( SDL_DISABLE(), 0, 'SDL_DISABLE() should also be available' );

is( SDL_ENABLE, 1, 'SDL_ENABLE should be imported' );
is( SDL_ENABLE(), 1, 'SDL_ENABLE() should also be available' );

is( SDL_GETEVENT, 2, 'SDL_GETEVENT should be imported' );
is( SDL_GETEVENT(), 2, 'SDL_GETEVENT() should also be available' );

is( SDL_HAT_CENTERED, 0, 'SDL_HAT_CENTERED should be imported' );
is( SDL_HAT_CENTERED(), 0, 'SDL_HAT_CENTERED() should also be available' );
is( SDL_HAT_DOWN, 4, 'SDL_HAT_DOWN should be imported' );
is( SDL_HAT_DOWN(), 4, 'SDL_HAT_DOWN() should also be available' );
is( SDL_HAT_LEFT, 8, 'SDL_HAT_LEFT should be imported' );
is( SDL_HAT_LEFT(), 8, 'SDL_HAT_LEFT() should also be available' );
is( SDL_HAT_LEFTDOWN, 12, 'SDL_HAT_LEFTDOWN should be imported' );
is( SDL_HAT_LEFTDOWN(), 12, 'SDL_HAT_LEFTDOWN() should also be available' );
is( SDL_HAT_LEFTUP, 9, 'SDL_HAT_LEFTUP should be imported' );
is( SDL_HAT_LEFTUP(), 9, 'SDL_HAT_LEFTUP() should also be available' );
is( SDL_HAT_RIGHT, 2, 'SDL_HAT_RIGHT should be imported' );
is( SDL_HAT_RIGHT(), 2, 'SDL_HAT_RIGHT() should also be available' );
is( SDL_HAT_RIGHTDOWN, 6, 'SDL_HAT_RIGHTDOWN should be imported' );
is( SDL_HAT_RIGHTDOWN(), 6, 'SDL_HAT_RIGHTDOWN() should also be available' );
is( SDL_HAT_RIGHTUP, 3, 'SDL_HAT_RIGHTUP should be imported' );
is( SDL_HAT_RIGHTUP(), 3, 'SDL_HAT_RIGHTUP() should also be available' );
is( SDL_HAT_UP, 1, 'SDL_HAT_UP should be imported' );
is( SDL_HAT_UP(), 1, 'SDL_HAT_UP() should also be available' );

is( SDL_IGNORE, 0, 'SDL_IGNORE should be imported' );
is( SDL_IGNORE(), 0, 'SDL_IGNORE() should also be available' );

is( SDL_JOYAXISMOTION, 7, 'SDL_JOYAXISMOTION should be imported' );
is( SDL_JOYAXISMOTION(), 7, 'SDL_JOYAXISMOTION() should also be available' );
is( SDL_JOYBALLMOTION, 8, 'SDL_JOYBALLMOTION should be imported' );
is( SDL_JOYBALLMOTION(), 8, 'SDL_JOYBALLMOTION() should also be available' );
is( SDL_JOYBUTTONDOWN, 10, 'SDL_JOYBUTTONDOWN should be imported' );
is( SDL_JOYBUTTONDOWN(), 10, 'SDL_JOYBUTTONDOWN() should also be available' );
is( SDL_JOYBUTTONUP, 11, 'SDL_JOYBUTTONUP should be imported' );
is( SDL_JOYBUTTONUP(), 11, 'SDL_JOYBUTTONUP() should also be available' );
is( SDL_JOYHATMOTION, 9, 'SDL_JOYHATMOTION should be imported' );
is( SDL_JOYHATMOTION(), 9, 'SDL_JOYHATMOTION() should also be available' );
is( SDL_JOYAXISMOTIONMASK,
SDL_EVENTMASK(SDL_JOYAXISMOTION),
'SDL_JOYAXISMOTIONMASK should be imported'
);
is( SDL_JOYAXISMOTIONMASK(),
SDL_EVENTMASK(SDL_JOYAXISMOTION),
'SDL_JOYAXISMOTIONMASK() should also be available'
);
is( SDL_JOYBALLMOTIONMASK,
SDL_EVENTMASK(SDL_JOYBALLMOTION),
'SDL_JOYBALLMOTIONMASK should be imported'
);
is( SDL_JOYBALLMOTIONMASK(),
SDL_EVENTMASK(SDL_JOYBALLMOTION),
'SDL_JOYBALLMOTIONMASK() should also be available'
);
is( SDL_JOYHATMOTIONMASK,
SDL_EVENTMASK(SDL_JOYHATMOTION),
'SDL_JOYHATMOTIONMASK should be imported'
);
is( SDL_JOYHATMOTIONMASK(),
SDL_EVENTMASK(SDL_JOYHATMOTION),
'SDL_JOYHATMOTIONMASK() should also be available'
);
is( SDL_JOYBUTTONDOWNMASK,
SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
'SDL_JOYBUTTONDOWNMASK should be imported'
);
is( SDL_JOYBUTTONDOWNMASK(),
SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
'SDL_JOYBUTTONDOWNMASK() should also be available'
);
is( SDL_JOYBUTTONUPMASK,
SDL_EVENTMASK(SDL_JOYBUTTONUP),
'SDL_JOYBUTTONUPMASK should be imported'
);
is( SDL_JOYBUTTONUPMASK(),
SDL_EVENTMASK(SDL_JOYBUTTONUP),
'SDL_JOYBUTTONUPMASK() should also be available'
);
is( SDL_JOYEVENTMASK,
SDL_EVENTMASK(SDL_JOYAXISMOTION) | SDL_EVENTMASK(SDL_JOYBALLMOTION) |
SDL_EVENTMASK(SDL_JOYHATMOTION) | SDL_EVENTMASK(SDL_JOYBUTTONDOWN) |
SDL_EVENTMASK(SDL_JOYBUTTONUP),
'SDL_JOYEVENTMASK should be imported'
);
is( SDL_JOYEVENTMASK(),
SDL_EVENTMASK(SDL_JOYAXISMOTION) | SDL_EVENTMASK(SDL_JOYBALLMOTION) |
SDL_EVENTMASK(SDL_JOYHATMOTION) | SDL_EVENTMASK(SDL_JOYBUTTONDOWN) |
SDL_EVENTMASK(SDL_JOYBUTTONUP),
'SDL_JOYEVENTMASK() should also be available'
);

is( SDL_KEYDOWN, 2, 'SDL_KEYDOWN should be imported' );
is( SDL_KEYDOWN(), 2, 'SDL_KEYDOWN() should also be available' );
is( SDL_KEYUP, 3, 'SDL_KEYUP should be imported' );
is( SDL_KEYUP(), 3, 'SDL_KEYUP() should also be available' );
is( SDL_KEYDOWNMASK,
SDL_EVENTMASK(SDL_KEYDOWN),
'SDL_KEYDOWNMASK should be imported'
);
is( SDL_KEYDOWNMASK(),
SDL_EVENTMASK(SDL_KEYDOWN),
'SDL_KEYDOWNMASK() should also be available'
);
is( SDL_KEYUPMASK,
SDL_EVENTMASK(SDL_KEYUP),
'SDL_KEYUPMASK should be imported'
);
is( SDL_KEYUPMASK(),
SDL_EVENTMASK(SDL_KEYUP),
'SDL_KEYUPMASK() should also be available'
);
is( SDL_KEYEVENTMASK,
SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
'SDL_KEYEVENTMASK should be imported'
);
is( SDL_KEYEVENTMASK(),
SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
'SDL_KEYEVENTMASK() should also be available'
);

is( SDL_MOUSEBUTTONDOWN, 5, 'SDL_MOUSEBUTTONDOWN should be imported' );
is( SDL_MOUSEBUTTONDOWN(), 5,
'SDL_MOUSEBUTTONDOWN() should also be available'
);
is( SDL_MOUSEBUTTONUP, 6, 'SDL_MOUSEBUTTONUP should be imported' );
is( SDL_MOUSEBUTTONUP(), 6, 'SDL_MOUSEBUTTONUP() should also be available' );
is( SDL_MOUSEMOTION, 4, 'SDL_MOUSEMOTION should be imported' );
is( SDL_MOUSEMOTION(), 4, 'SDL_MOUSEMOTION() should also be available' );
is( SDL_MOUSEMOTIONMASK,
SDL_EVENTMASK(SDL_MOUSEMOTION),
'SDL_MOUSEMOTIONMASK should be imported'
);
is( SDL_MOUSEMOTIONMASK(),
SDL_EVENTMASK(SDL_MOUSEMOTION),
'SDL_MOUSEMOTIONMASK() should also be available'
);
is( SDL_MOUSEBUTTONDOWNMASK,
SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
'SDL_MOUSEBUTTONDOWNMASK should be imported'
);
is( SDL_MOUSEBUTTONDOWNMASK(),
SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
'SDL_MOUSEBUTTONDOWNMASK() should also be available'
);
is( SDL_MOUSEBUTTONUPMASK,
SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
'SDL_MOUSEBUTTONUPMASK should be imported'
);
is( SDL_MOUSEBUTTONUPMASK(),
SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
'SDL_MOUSEBUTTONUPMASK() should also be available'
);
is( SDL_MOUSEEVENTMASK,
SDL_EVENTMASK(SDL_MOUSEMOTION) | SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) |
SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
'SDL_MOUSEEVENTMASK should be imported'
);
is( SDL_MOUSEEVENTMASK(),
SDL_EVENTMASK(SDL_MOUSEMOTION) | SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) |
SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
'SDL_MOUSEEVENTMASK() should also be available'
);

is( SDL_NUMEVENTS, 32, 'SDL_NUMEVENTS should be imported' );
is( SDL_NUMEVENTS(), 32, 'SDL_NUMEVENTS() should also be available' );

is( SDL_PEEKEVENT, 1, 'SDL_PEEKEVENT should be imported' );
is( SDL_PEEKEVENT(), 1, 'SDL_PEEKEVENT() should also be available' );
is( SDL_PRESSED, 1, 'SDL_PRESSED should be imported' );
is( SDL_PRESSED(), 1, 'SDL_PRESSED() should also be available' );
is( SDL_QUERY, -1, 'SDL_QUERY should be imported' );
is( SDL_QUERY(), -1, 'SDL_QUERY() should also be available' );
is( SDL_QUIT, 12, 'SDL_QUIT should be imported' );
is( SDL_QUIT(), 12, 'SDL_QUIT() should also be available' );
is( SDL_QUITMASK, SDL_EVENTMASK(SDL_QUIT), 'SDL_QUITMASK should be imported' );
is( SDL_QUITMASK(), SDL_EVENTMASK(SDL_QUIT),
'SDL_QUITMASK() should also be available'
);

is( SDL_RELEASED, 0, 'SDL_RELEASED should be imported' );
is( SDL_RELEASED(), 0, 'SDL_RELEASED() should also be available' );

is( SDL_SYSWMEVENT, 13, 'SDL_SYSWMEVENT should be imported' );
is( SDL_SYSWMEVENT(), 13, 'SDL_SYSWMEVENT() should also be available' );
is( SDL_SYSWMEVENTMASK,
SDL_EVENTMASK(SDL_SYSWMEVENT),
'SDL_SYSWMEVENTMASK should be imported'
);
is( SDL_SYSWMEVENTMASK(),
SDL_EVENTMASK(SDL_SYSWMEVENT),
'SDL_SYSWMEVENTMASK() should also be available'
);

is( SDL_USEREVENT, 24, 'SDL_USEREVENT should be imported' );
is( SDL_USEREVENT(), 24, 'SDL_USEREVENT() should also be available' );

is( SDL_VIDEOEXPOSE, 17, 'SDL_VIDEOEXPOSE should be imported' );
is( SDL_VIDEOEXPOSE(), 17, 'SDL_VIDEOEXPOSE() should also be available' );
is( SDL_VIDEOEXPOSEMASK,
SDL_EVENTMASK(SDL_VIDEOEXPOSE),
'SDL_VIDEOEXPOSEMASK should be imported'
);
is( SDL_VIDEOEXPOSEMASK(),
SDL_EVENTMASK(SDL_VIDEOEXPOSE),
'SDL_VIDEOEXPOSEMASK() should also be available'
);
is( SDL_VIDEORESIZE, 16, 'SDL_VIDEORESIZE should be imported' );
is( SDL_VIDEORESIZE(), 16, 'SDL_VIDEORESIZE() should also be available' );
is( SDL_VIDEORESIZEMASK,
SDL_EVENTMASK(SDL_VIDEORESIZE),
'SDL_VIDEORESIZEMASK should be imported'
);
is( SDL_VIDEORESIZEMASK(),
SDL_EVENTMASK(SDL_VIDEORESIZE),
'SDL_VIDEORESIZEMASK() should also be available'
);

is( KMOD_ALT, 768, 'KMOD_ALT should be imported' );
is( KMOD_ALT(), 768, 'KMOD_ALT() should also be available' );
is( KMOD_CAPS, 8192, 'KMOD_CAPS should be imported' );
is( KMOD_CAPS(), 8192, 'KMOD_CAPS() should also be available' );
is( KMOD_CTRL, 192, 'KMOD_CTRL should be imported' );
is( KMOD_CTRL(), 192, 'KMOD_CTRL() should also be available' );
is( KMOD_LALT, 256, 'KMOD_LALT should be imported' );
is( KMOD_LALT(), 256, 'KMOD_LALT() should also be available' );
is( KMOD_LCTRL, 64, 'KMOD_LCTRL should be imported' );
is( KMOD_LCTRL(), 64, 'KMOD_LCTRL() should also be available' );
is( KMOD_LMETA, 0x0400, 'KMOD_LMETA should be imported' );
is( KMOD_LMETA(), 0x0400, 'KMOD_LMETA() should also be available' );
is( KMOD_LSHIFT, 1, 'KMOD_LSHIFT should be imported' );
is( KMOD_LSHIFT(), 1, 'KMOD_LSHIFT() should also be available' );
is( KMOD_META, 0x0400 | 0x0800, 'KMOD_META should be imported' );
is( KMOD_META(), 0x0400 | 0x0800, 'KMOD_META() should also be available' );
is( KMOD_MODE, 0x4000, 'KMOD_MODE should be imported' );
is( KMOD_MODE(), 0x4000, 'KMOD_MODE() should also be available' );
is( KMOD_NONE, 0, 'KMOD_NONE should be imported' );
is( KMOD_NONE(), 0, 'KMOD_NONE() should also be available' );
is( KMOD_NUM, 4096, 'KMOD_NUM should be imported' );
is( KMOD_NUM(), 4096, 'KMOD_NUM() should also be available' );
is( KMOD_RESERVED, 0x8000, 'KMOD_RESERVED should be imported' );
is( KMOD_RESERVED(), 0x8000, 'KMOD_RESERVED() should also be available' );
is( KMOD_RALT, 512, 'KMOD_RALT should be imported' );
is( KMOD_RALT(), 512, 'KMOD_RALT() should also be available' );
is( KMOD_RCTRL, 128, 'KMOD_RCTRL should be imported' );
is( KMOD_RCTRL(), 128, 'KMOD_RCTRL() should also be available' );
is( KMOD_RMETA, 0x0800, 'KMOD_RMETA should be imported' );
is( KMOD_RMETA(), 0x0800, 'KMOD_RMETA() should also be available' );
is( KMOD_RSHIFT, 2, 'KMOD_RSHIFT should be imported' );
is( KMOD_RSHIFT(), 2, 'KMOD_RSHIFT() should also be available' );
is( KMOD_SHIFT, 3, 'KMOD_SHIFT should be imported' );
is( KMOD_SHIFT(), 3, 'KMOD_SHIFT() should also be available' );

is( SDLK_0, 48, 'SDLK_0 should be imported' );
is( SDLK_0(), 48, 'SDLK_0() should also be available' );
is( SDLK_1, 49, 'SDLK_1 should be imported' );
is( SDLK_1(), 49, 'SDLK_1() should also be available' );
is( SDLK_2, 50, 'SDLK_2 should be imported' );
is( SDLK_2(), 50, 'SDLK_2() should also be available' );
is( SDLK_3, 51, 'SDLK_3 should be imported' );
is( SDLK_3(), 51, 'SDLK_3() should also be available' );
is( SDLK_4, 52, 'SDLK_4 should be imported' );
is( SDLK_4(), 52, 'SDLK_4() should also be available' );
is( SDLK_5, 53, 'SDLK_5 should be imported' );
is( SDLK_5(), 53, 'SDLK_5() should also be available' );
is( SDLK_6, 54, 'SDLK_6 should be imported' );
is( SDLK_6(), 54, 'SDLK_6() should also be available' );
is( SDLK_7, 55, 'SDLK_7 should be imported' );
is( SDLK_7(), 55, 'SDLK_7() should also be available' );
is( SDLK_8, 56, 'SDLK_8 should be imported' );
is( SDLK_8(), 56, 'SDLK_8() should also be available' );
is( SDLK_9, 57, 'SDLK_9 should be imported' );
is( SDLK_9(), 57, 'SDLK_9() should also be available' );
is( SDLK_AMPERSAND, 38, 'SDLK_AMPERSAND should be imported' );
is( SDLK_AMPERSAND(), 38, 'SDLK_AMPERSAND() should also be available' );
is( SDLK_ASTERISK, 42, 'SDLK_ASTERISK should be imported' );
is( SDLK_ASTERISK(), 42, 'SDLK_ASTERISK() should also be available' );
is( SDLK_AT, 64, 'SDLK_AT should be imported' );
is( SDLK_AT(), 64, 'SDLK_AT() should also be available' );
is( SDLK_BACKQUOTE, 96, 'SDLK_BACKQUOTE should be imported' );
is( SDLK_BACKQUOTE(), 96, 'SDLK_BACKQUOTE() should also be available' );
is( SDLK_BACKSLASH, 92, 'SDLK_BACKSLASH should be imported' );
is( SDLK_BACKSLASH(), 92, 'SDLK_BACKSLASH() should also be available' );
is( SDLK_BACKSPACE, 8, 'SDLK_BACKSPACE should be imported' );
is( SDLK_BACKSPACE(), 8, 'SDLK_BACKSPACE() should also be available' );
is( SDLK_BREAK, 318, 'SDLK_BREAK should be imported' );
is( SDLK_BREAK(), 318, 'SDLK_BREAK() should also be available' );
is( SDLK_CAPSLOCK, 301, 'SDLK_CAPSLOCK should be imported' );
is( SDLK_CAPSLOCK(), 301, 'SDLK_CAPSLOCK() should also be available' );
is( SDLK_CARET, 94, 'SDLK_CARET should be imported' );
is( SDLK_CARET(), 94, 'SDLK_CARET() should also be available' );
is( SDLK_CLEAR, 12, 'SDLK_CLEAR should be imported' );
is( SDLK_CLEAR(), 12, 'SDLK_CLEAR() should also be available' );
is( SDLK_COLON, 58, 'SDLK_COLON should be imported' );
is( SDLK_COLON(), 58, 'SDLK_COLON() should also be available' );
is( SDLK_COMMA, 44, 'SDLK_COMMA should be imported' );
is( SDLK_COMMA(), 44, 'SDLK_COMMA() should also be available' );
is( SDLK_COMPOSE, 314, 'SDLK_COMPOSE should be imported' );
is( SDLK_COMPOSE(), 314, 'SDLK_COMPOSE() should also be available' );
is( SDLK_DELETE, 127, 'SDLK_DELETE should be imported' );
is( SDLK_DELETE(), 127, 'SDLK_DELETE() should also be available' );
is( SDLK_DOLLAR, 36, 'SDLK_DOLLAR should be imported' );
is( SDLK_DOLLAR(), 36, 'SDLK_DOLLAR() should also be available' );
is( SDLK_DOWN, 274, 'SDLK_DOWN should be imported' );
is( SDLK_DOWN(), 274, 'SDLK_DOWN() should also be available' );
is( SDLK_END, 279, 'SDLK_END should be imported' );
is( SDLK_END(), 279, 'SDLK_END() should also be available' );
is( SDLK_EQUALS, 61, 'SDLK_EQUALS should be imported' );
is( SDLK_EQUALS(), 61, 'SDLK_EQUALS() should also be available' );
is( SDLK_ESCAPE, 27, 'SDLK_ESCAPE should be imported' );
is( SDLK_ESCAPE(), 27, 'SDLK_ESCAPE() should also be available' );
is( SDLK_EURO, 321, 'SDLK_EURO should be imported' );
is( SDLK_EURO(), 321, 'SDLK_EURO() should also be available' );
is( SDLK_EXCLAIM, 33, 'SDLK_EXCLAIM should be imported' );
is( SDLK_EXCLAIM(), 33, 'SDLK_EXCLAIM() should also be available' );
is( SDLK_F1, 282, 'SDLK_F1 should be imported' );
is( SDLK_F1(), 282, 'SDLK_F1() should also be available' );
is( SDLK_F10, 291, 'SDLK_F10 should be imported' );
is( SDLK_F10(), 291, 'SDLK_F10() should also be available' );
is( SDLK_F11, 292, 'SDLK_F11 should be imported' );
is( SDLK_F11(), 292, 'SDLK_F11() should also be available' );
is( SDLK_F12, 293, 'SDLK_F12 should be imported' );
is( SDLK_F12(), 293, 'SDLK_F12() should also be available' );
is( SDLK_F13, 294, 'SDLK_F13 should be imported' );
is( SDLK_F13(), 294, 'SDLK_F13() should also be available' );
is( SDLK_F14, 295, 'SDLK_F14 should be imported' );
is( SDLK_F14(), 295, 'SDLK_F14() should also be available' );
is( SDLK_F15, 296, 'SDLK_F15 should be imported' );
is( SDLK_F15(), 296, 'SDLK_F15() should also be available' );
is( SDLK_F2, 283, 'SDLK_F2 should be imported' );
is( SDLK_F2(), 283, 'SDLK_F2() should also be available' );
is( SDLK_F3, 284, 'SDLK_F3 should be imported' );
is( SDLK_F3(), 284, 'SDLK_F3() should also be available' );
is( SDLK_F4, 285, 'SDLK_F4 should be imported' );
is( SDLK_F4(), 285, 'SDLK_F4() should also be available' );
is( SDLK_F5, 286, 'SDLK_F5 should be imported' );
is( SDLK_F5(), 286, 'SDLK_F5() should also be available' );
is( SDLK_F6, 287, 'SDLK_F6 should be imported' );
is( SDLK_F6(), 287, 'SDLK_F6() should also be available' );
is( SDLK_F7, 288, 'SDLK_F7 should be imported' );
is( SDLK_F7(), 288, 'SDLK_F7() should also be available' );
is( SDLK_F8, 289, 'SDLK_F8 should be imported' );
is( SDLK_F8(), 289, 'SDLK_F8() should also be available' );
is( SDLK_F9, 290, 'SDLK_F9 should be imported' );
is( SDLK_F9(), 290, 'SDLK_F9() should also be available' );
is( SDLK_FIRST, 0, 'SDLK_FIRST should be imported' );
is( SDLK_FIRST(), 0, 'SDLK_FIRST() should also be available' );
is( SDLK_GREATER, 62, 'SDLK_GREATER should be imported' );
is( SDLK_GREATER(), 62, 'SDLK_GREATER() should also be available' );
is( SDLK_HASH, 35, 'SDLK_HASH should be imported' );
is( SDLK_HASH(), 35, 'SDLK_HASH() should also be available' );
is( SDLK_HELP, 315, 'SDLK_HELP should be imported' );
is( SDLK_HELP(), 315, 'SDLK_HELP() should also be available' );
is( SDLK_HOME, 278, 'SDLK_HOME should be imported' );
is( SDLK_HOME(), 278, 'SDLK_HOME() should also be available' );
is( SDLK_INSERT, 277, 'SDLK_INSERT should be imported' );
is( SDLK_INSERT(), 277, 'SDLK_INSERT() should also be available' );
is( SDLK_KP0, 256, 'SDLK_KP0 should be imported' );
is( SDLK_KP0(), 256, 'SDLK_KP0() should also be available' );
is( SDLK_KP1, 257, 'SDLK_KP1 should be imported' );
is( SDLK_KP1(), 257, 'SDLK_KP1() should also be available' );
is( SDLK_KP2, 258, 'SDLK_KP2 should be imported' );
is( SDLK_KP2(), 258, 'SDLK_KP2() should also be available' );
is( SDLK_KP3, 259, 'SDLK_KP3 should be imported' );
is( SDLK_KP3(), 259, 'SDLK_KP3() should also be available' );
is( SDLK_KP4, 260, 'SDLK_KP4 should be imported' );
is( SDLK_KP4(), 260, 'SDLK_KP4() should also be available' );
is( SDLK_KP5, 261, 'SDLK_KP5 should be imported' );
is( SDLK_KP5(), 261, 'SDLK_KP5() should also be available' );
is( SDLK_KP6, 262, 'SDLK_KP6 should be imported' );
is( SDLK_KP6(), 262, 'SDLK_KP6() should also be available' );
is( SDLK_KP7, 263, 'SDLK_KP7 should be imported' );
is( SDLK_KP7(), 263, 'SDLK_KP7() should also be available' );
is( SDLK_KP8, 264, 'SDLK_KP8 should be imported' );
is( SDLK_KP8(), 264, 'SDLK_KP8() should also be available' );
is( SDLK_KP9, 265, 'SDLK_KP9 should be imported' );
is( SDLK_KP9(), 265, 'SDLK_KP9() should also be available' );
is( SDLK_KP_DIVIDE, 267, 'SDLK_KP_DIVIDE should be imported' );
is( SDLK_KP_DIVIDE(), 267, 'SDLK_KP_DIVIDE() should also be available' );
is( SDLK_KP_ENTER, 271, 'SDLK_KP_ENTER should be imported' );
is( SDLK_KP_ENTER(), 271, 'SDLK_KP_ENTER() should also be available' );
is( SDLK_KP_EQUALS, 272, 'SDLK_KP_EQUALS should be imported' );
is( SDLK_KP_EQUALS(), 272, 'SDLK_KP_EQUALS() should also be available' );
is( SDLK_KP_MINUS, 269, 'SDLK_KP_MINUS should be imported' );
is( SDLK_KP_MINUS(), 269, 'SDLK_KP_MINUS() should also be available' );
is( SDLK_KP_MULTIPLY, 268, 'SDLK_KP_MULTIPLY should be imported' );
is( SDLK_KP_MULTIPLY(), 268, 'SDLK_KP_MULTIPLY() should also be available' );
is( SDLK_KP_PERIOD, 266, 'SDLK_KP_PERIOD should be imported' );
is( SDLK_KP_PERIOD(), 266, 'SDLK_KP_PERIOD() should also be available' );
is( SDLK_KP_PLUS, 270, 'SDLK_KP_PLUS should be imported' );
is( SDLK_KP_PLUS(), 270, 'SDLK_KP_PLUS() should also be available' );
is( SDLK_LALT, 308, 'SDLK_LALT should be imported' );
is( SDLK_LALT(), 308, 'SDLK_LALT() should also be available' );
is( SDLK_LCTRL, 306, 'SDLK_LCTRL should be imported' );
is( SDLK_LCTRL(), 306, 'SDLK_LCTRL() should also be available' );
is( SDLK_LEFT, 276, 'SDLK_LEFT should be imported' );
is( SDLK_LEFT(), 276, 'SDLK_LEFT() should also be available' );
is( SDLK_LEFTBRACKET, 91, 'SDLK_LEFTBRACKET should be imported' );
is( SDLK_LEFTBRACKET(), 91, 'SDLK_LEFTBRACKET() should also be available' );
is( SDLK_LEFTPAREN, 40, 'SDLK_LEFTPAREN should be imported' );
is( SDLK_LEFTPAREN(), 40, 'SDLK_LEFTPAREN() should also be available' );
is( SDLK_LESS, 60, 'SDLK_LESS should be imported' );
is( SDLK_LESS(), 60, 'SDLK_LESS() should also be available' );
is( SDLK_LMETA, 310, 'SDLK_LMETA should be imported' );
is( SDLK_LMETA(), 310, 'SDLK_LMETA() should also be available' );
is( SDLK_LSHIFT, 304, 'SDLK_LSHIFT should be imported' );
is( SDLK_LSHIFT(), 304, 'SDLK_LSHIFT() should also be available' );
is( SDLK_LSUPER, 311, 'SDLK_LSUPER should be imported' );
is( SDLK_LSUPER(), 311, 'SDLK_LSUPER() should also be available' );
is( SDLK_MENU, 319, 'SDLK_MENU should be imported' );
is( SDLK_MENU(), 319, 'SDLK_MENU() should also be available' );
is( SDLK_MINUS, 45, 'SDLK_MINUS should be imported' );
is( SDLK_MINUS(), 45, 'SDLK_MINUS() should also be available' );
is( SDLK_MODE, 313, 'SDLK_MODE should be imported' );
is( SDLK_MODE(), 313, 'SDLK_MODE() should also be available' );
is( SDLK_NUMLOCK, 300, 'SDLK_NUMLOCK should be imported' );
is( SDLK_NUMLOCK(), 300, 'SDLK_NUMLOCK() should also be available' );
is( SDLK_PAGEDOWN, 281, 'SDLK_PAGEDOWN should be imported' );
is( SDLK_PAGEDOWN(), 281, 'SDLK_PAGEDOWN() should also be available' );
is( SDLK_PAGEUP, 280, 'SDLK_PAGEUP should be imported' );
is( SDLK_PAGEUP(), 280, 'SDLK_PAGEUP() should also be available' );
is( SDLK_PAUSE, 19, 'SDLK_PAUSE should be imported' );
is( SDLK_PAUSE(), 19, 'SDLK_PAUSE() should also be available' );
is( SDLK_PERIOD, 46, 'SDLK_PERIOD should be imported' );
is( SDLK_PERIOD(), 46, 'SDLK_PERIOD() should also be available' );
is( SDLK_PLUS, 43, 'SDLK_PLUS should be imported' );
is( SDLK_PLUS(), 43, 'SDLK_PLUS() should also be available' );
is( SDLK_POWER, 320, 'SDLK_POWER should be imported' );
is( SDLK_POWER(), 320, 'SDLK_POWER() should also be available' );
is( SDLK_PRINT, 316, 'SDLK_PRINT should be imported' );
is( SDLK_PRINT(), 316, 'SDLK_PRINT() should also be available' );
is( SDLK_QUESTION, 63, 'SDLK_QUESTION should be imported' );
is( SDLK_QUESTION(), 63, 'SDLK_QUESTION() should also be available' );
is( SDLK_QUOTE, 39, 'SDLK_QUOTE should be imported' );
is( SDLK_QUOTE(), 39, 'SDLK_QUOTE() should also be available' );
is( SDLK_QUOTEDBL, 34, 'SDLK_QUOTEDBL should be imported' );
is( SDLK_QUOTEDBL(), 34, 'SDLK_QUOTEDBL() should also be available' );
is( SDLK_RALT, 307, 'SDLK_RALT should be imported' );
is( SDLK_RALT(), 307, 'SDLK_RALT() should also be available' );
is( SDLK_RCTRL, 305, 'SDLK_RCTRL should be imported' );
is( SDLK_RCTRL(), 305, 'SDLK_RCTRL() should also be available' );
is( SDLK_RETURN, 13, 'SDLK_RETURN should be imported' );
is( SDLK_RETURN(), 13, 'SDLK_RETURN() should also be available' );
is( SDLK_RIGHT, 275, 'SDLK_RIGHT should be imported' );
is( SDLK_RIGHT(), 275, 'SDLK_RIGHT() should also be available' );
is( SDLK_RIGHTBRACKET, 93, 'SDLK_RIGHTBRACKET should be imported' );
is( SDLK_RIGHTBRACKET(), 93, 'SDLK_RIGHTBRACKET() should also be available' );
is( SDLK_RIGHTPAREN, 41, 'SDLK_RIGHTPAREN should be imported' );
is( SDLK_RIGHTPAREN(), 41, 'SDLK_RIGHTPAREN() should also be available' );
is( SDLK_RMETA, 309, 'SDLK_RMETA should be imported' );
is( SDLK_RMETA(), 309, 'SDLK_RMETA() should also be available' );
is( SDLK_RSHIFT, 303, 'SDLK_RSHIFT should be imported' );
is( SDLK_RSHIFT(), 303, 'SDLK_RSHIFT() should also be available' );
is( SDLK_RSUPER, 312, 'SDLK_RSUPER should be imported' );
is( SDLK_RSUPER(), 312, 'SDLK_RSUPER() should also be available' );
is( SDLK_SCROLLOCK, 302, 'SDLK_SCROLLOCK should be imported' );
is( SDLK_SCROLLOCK(), 302, 'SDLK_SCROLLOCK() should also be available' );
is( SDLK_SEMICOLON, 59, 'SDLK_SEMICOLON should be imported' );
is( SDLK_SEMICOLON(), 59, 'SDLK_SEMICOLON() should also be available' );
is( SDLK_SLASH, 47, 'SDLK_SLASH should be imported' );
is( SDLK_SLASH(), 47, 'SDLK_SLASH() should also be available' );
is( SDLK_SPACE, 32, 'SDLK_SPACE should be imported' );
is( SDLK_SPACE(), 32, 'SDLK_SPACE() should also be available' );
is( SDLK_SYSREQ, 317, 'SDLK_SYSREQ should be imported' );
is( SDLK_SYSREQ(), 317, 'SDLK_SYSREQ() should also be available' );
is( SDLK_TAB, 9, 'SDLK_TAB should be imported' );
is( SDLK_TAB(), 9, 'SDLK_TAB() should also be available' );
is( SDLK_UNDERSCORE, 95, 'SDLK_UNDERSCORE should be imported' );
is( SDLK_UNDERSCORE(), 95, 'SDLK_UNDERSCORE() should also be available' );
is( SDLK_UNDO, 322, 'SDLK_UNDO should be imported' );
is( SDLK_UNDO(), 322, 'SDLK_UNDO() should also be available' );
is( SDLK_UNKNOWN, 0, 'SDLK_WORLD_95 should be imported' );
is( SDLK_UNKNOWN(), 0, 'SDLK_WORLD_95() should also be available' );
is( SDLK_UP, 273, 'SDLK_UP should be imported' );
is( SDLK_UP(), 273, 'SDLK_UP() should also be available' );
is( SDLK_WORLD_0, 160, 'SDLK_WORLD_0 should be imported' );
is( SDLK_WORLD_0(), 160, 'SDLK_WORLD_0() should also be available' );
is( SDLK_WORLD_1, 161, 'SDLK_WORLD_1 should be imported' );
is( SDLK_WORLD_1(), 161, 'SDLK_WORLD_1() should also be available' );
is( SDLK_WORLD_2, 162, 'SDLK_WORLD_2 should be imported' );
is( SDLK_WORLD_2(), 162, 'SDLK_WORLD_2() should also be available' );
is( SDLK_WORLD_3, 163, 'SDLK_WORLD_3 should be imported' );
is( SDLK_WORLD_3(), 163, 'SDLK_WORLD_3() should also be available' );
is( SDLK_WORLD_4, 164, 'SDLK_WORLD_4 should be imported' );
is( SDLK_WORLD_4(), 164, 'SDLK_WORLD_4() should also be available' );
is( SDLK_WORLD_5, 165, 'SDLK_WORLD_5 should be imported' );
is( SDLK_WORLD_5(), 165, 'SDLK_WORLD_5() should also be available' );
is( SDLK_WORLD_6, 166, 'SDLK_WORLD_6 should be imported' );
is( SDLK_WORLD_6(), 166, 'SDLK_WORLD_6() should also be available' );
is( SDLK_WORLD_7, 167, 'SDLK_WORLD_7 should be imported' );
is( SDLK_WORLD_7(), 167, 'SDLK_WORLD_7() should also be available' );
is( SDLK_WORLD_8, 168, 'SDLK_WORLD_8 should be imported' );
is( SDLK_WORLD_8(), 168, 'SDLK_WORLD_8() should also be available' );
is( SDLK_WORLD_9, 169, 'SDLK_WORLD_9 should be imported' );
is( SDLK_WORLD_9(), 169, 'SDLK_WORLD_9() should also be available' );
is( SDLK_WORLD_10, 170, 'SDLK_WORLD_10 should be imported' );
is( SDLK_WORLD_10(), 170, 'SDLK_WORLD_10() should also be available' );
is( SDLK_WORLD_11, 171, 'SDLK_WORLD_11 should be imported' );
is( SDLK_WORLD_11(), 171, 'SDLK_WORLD_11() should also be available' );
is( SDLK_WORLD_12, 172, 'SDLK_WORLD_12 should be imported' );
is( SDLK_WORLD_12(), 172, 'SDLK_WORLD_12() should also be available' );
is( SDLK_WORLD_13, 173, 'SDLK_WORLD_13 should be imported' );
is( SDLK_WORLD_13(), 173, 'SDLK_WORLD_13() should also be available' );
is( SDLK_WORLD_14, 174, 'SDLK_WORLD_14 should be imported' );
is( SDLK_WORLD_14(), 174, 'SDLK_WORLD_14() should also be available' );
is( SDLK_WORLD_15, 175, 'SDLK_WORLD_15 should be imported' );
is( SDLK_WORLD_15(), 175, 'SDLK_WORLD_15() should also be available' );
is( SDLK_WORLD_16, 176, 'SDLK_WORLD_16 should be imported' );
is( SDLK_WORLD_16(), 176, 'SDLK_WORLD_16() should also be available' );
is( SDLK_WORLD_17, 177, 'SDLK_WORLD_17 should be imported' );
is( SDLK_WORLD_17(), 177, 'SDLK_WORLD_17() should also be available' );
is( SDLK_WORLD_18, 178, 'SDLK_WORLD_18 should be imported' );
is( SDLK_WORLD_18(), 178, 'SDLK_WORLD_18() should also be available' );
is( SDLK_WORLD_19, 179, 'SDLK_WORLD_19 should be imported' );
is( SDLK_WORLD_19(), 179, 'SDLK_WORLD_19() should also be available' );
is( SDLK_WORLD_20, 180, 'SDLK_WORLD_20 should be imported' );
is( SDLK_WORLD_20(), 180, 'SDLK_WORLD_20() should also be available' );
is( SDLK_WORLD_21, 181, 'SDLK_WORLD_21 should be imported' );
is( SDLK_WORLD_21(), 181, 'SDLK_WORLD_21() should also be available' );
is( SDLK_WORLD_22, 182, 'SDLK_WORLD_22 should be imported' );
is( SDLK_WORLD_22(), 182, 'SDLK_WORLD_22() should also be available' );
is( SDLK_WORLD_23, 183, 'SDLK_WORLD_23 should be imported' );
is( SDLK_WORLD_23(), 183, 'SDLK_WORLD_23() should also be available' );
is( SDLK_WORLD_24, 184, 'SDLK_WORLD_24 should be imported' );
is( SDLK_WORLD_24(), 184, 'SDLK_WORLD_24() should also be available' );
is( SDLK_WORLD_25, 185, 'SDLK_WORLD_25 should be imported' );
is( SDLK_WORLD_25(), 185, 'SDLK_WORLD_25() should also be available' );
is( SDLK_WORLD_26, 186, 'SDLK_WORLD_26 should be imported' );
is( SDLK_WORLD_26(), 186, 'SDLK_WORLD_26() should also be available' );
is( SDLK_WORLD_27, 187, 'SDLK_WORLD_27 should be imported' );
is( SDLK_WORLD_27(), 187, 'SDLK_WORLD_27() should also be available' );
is( SDLK_WORLD_28, 188, 'SDLK_WORLD_28 should be imported' );
is( SDLK_WORLD_28(), 188, 'SDLK_WORLD_28() should also be available' );
is( SDLK_WORLD_29, 189, 'SDLK_WORLD_29 should be imported' );
is( SDLK_WORLD_29(), 189, 'SDLK_WORLD_29() should also be available' );
is( SDLK_WORLD_30, 190, 'SDLK_WORLD_30 should be imported' );
is( SDLK_WORLD_30(), 190, 'SDLK_WORLD_30() should also be available' );
is( SDLK_WORLD_31, 191, 'SDLK_WORLD_31 should be imported' );
is( SDLK_WORLD_31(), 191, 'SDLK_WORLD_31() should also be available' );
is( SDLK_WORLD_32, 192, 'SDLK_WORLD_32 should be imported' );
is( SDLK_WORLD_32(), 192, 'SDLK_WORLD_32() should also be available' );
is( SDLK_WORLD_33, 193, 'SDLK_WORLD_33 should be imported' );
is( SDLK_WORLD_33(), 193, 'SDLK_WORLD_33() should also be available' );
is( SDLK_WORLD_34, 194, 'SDLK_WORLD_34 should be imported' );
is( SDLK_WORLD_34(), 194, 'SDLK_WORLD_34() should also be available' );
is( SDLK_WORLD_35, 195, 'SDLK_WORLD_35 should be imported' );
is( SDLK_WORLD_35(), 195, 'SDLK_WORLD_35() should also be available' );
is( SDLK_WORLD_36, 196, 'SDLK_WORLD_36 should be imported' );
is( SDLK_WORLD_36(), 196, 'SDLK_WORLD_36() should also be available' );
is( SDLK_WORLD_37, 197, 'SDLK_WORLD_37 should be imported' );
is( SDLK_WORLD_37(), 197, 'SDLK_WORLD_37() should also be available' );
is( SDLK_WORLD_38, 198, 'SDLK_WORLD_38 should be imported' );
is( SDLK_WORLD_38(), 198, 'SDLK_WORLD_38() should also be available' );
is( SDLK_WORLD_39, 199, 'SDLK_WORLD_39 should be imported' );
is( SDLK_WORLD_39(), 199, 'SDLK_WORLD_39() should also be available' );
is( SDLK_WORLD_40, 200, 'SDLK_WORLD_40 should be imported' );
is( SDLK_WORLD_40(), 200, 'SDLK_WORLD_40() should also be available' );
is( SDLK_WORLD_41, 201, 'SDLK_WORLD_41 should be imported' );
is( SDLK_WORLD_41(), 201, 'SDLK_WORLD_41() should also be available' );
is( SDLK_WORLD_42, 202, 'SDLK_WORLD_42 should be imported' );
is( SDLK_WORLD_42(), 202, 'SDLK_WORLD_42() should also be available' );
is( SDLK_WORLD_43, 203, 'SDLK_WORLD_43 should be imported' );
is( SDLK_WORLD_43(), 203, 'SDLK_WORLD_43() should also be available' );
is( SDLK_WORLD_44, 204, 'SDLK_WORLD_44 should be imported' );
is( SDLK_WORLD_44(), 204, 'SDLK_WORLD_44() should also be available' );
is( SDLK_WORLD_45, 205, 'SDLK_WORLD_45 should be imported' );
is( SDLK_WORLD_45(), 205, 'SDLK_WORLD_45() should also be available' );
is( SDLK_WORLD_46, 206, 'SDLK_WORLD_46 should be imported' );
is( SDLK_WORLD_46(), 206, 'SDLK_WORLD_46() should also be available' );
is( SDLK_WORLD_47, 207, 'SDLK_WORLD_47 should be imported' );
is( SDLK_WORLD_47(), 207, 'SDLK_WORLD_47() should also be available' );
is( SDLK_WORLD_48, 208, 'SDLK_WORLD_48 should be imported' );
is( SDLK_WORLD_48(), 208, 'SDLK_WORLD_48() should also be available' );
is( SDLK_WORLD_49, 209, 'SDLK_WORLD_49 should be imported' );
is( SDLK_WORLD_49(), 209, 'SDLK_WORLD_49() should also be available' );
is( SDLK_WORLD_50, 210, 'SDLK_WORLD_50 should be imported' );
is( SDLK_WORLD_50(), 210, 'SDLK_WORLD_50() should also be available' );
is( SDLK_WORLD_51, 211, 'SDLK_WORLD_51 should be imported' );
is( SDLK_WORLD_51(), 211, 'SDLK_WORLD_51() should also be available' );
is( SDLK_WORLD_52, 212, 'SDLK_WORLD_52 should be imported' );
is( SDLK_WORLD_52(), 212, 'SDLK_WORLD_52() should also be available' );
is( SDLK_WORLD_53, 213, 'SDLK_WORLD_53 should be imported' );
is( SDLK_WORLD_53(), 213, 'SDLK_WORLD_53() should also be available' );
is( SDLK_WORLD_54, 214, 'SDLK_WORLD_54 should be imported' );
is( SDLK_WORLD_54(), 214, 'SDLK_WORLD_54() should also be available' );
is( SDLK_WORLD_55, 215, 'SDLK_WORLD_55 should be imported' );
is( SDLK_WORLD_55(), 215, 'SDLK_WORLD_55() should also be available' );
is( SDLK_WORLD_56, 216, 'SDLK_WORLD_56 should be imported' );
is( SDLK_WORLD_56(), 216, 'SDLK_WORLD_56() should also be available' );
is( SDLK_WORLD_57, 217, 'SDLK_WORLD_57 should be imported' );
is( SDLK_WORLD_57(), 217, 'SDLK_WORLD_57() should also be available' );
is( SDLK_WORLD_58, 218, 'SDLK_WORLD_58 should be imported' );
is( SDLK_WORLD_58(), 218, 'SDLK_WORLD_58() should also be available' );
is( SDLK_WORLD_59, 219, 'SDLK_WORLD_59 should be imported' );
is( SDLK_WORLD_59(), 219, 'SDLK_WORLD_59() should also be available' );
is( SDLK_WORLD_60, 220, 'SDLK_WORLD_60 should be imported' );
is( SDLK_WORLD_60(), 220, 'SDLK_WORLD_60() should also be available' );
is( SDLK_WORLD_61, 221, 'SDLK_WORLD_61 should be imported' );
is( SDLK_WORLD_61(), 221, 'SDLK_WORLD_61() should also be available' );
is( SDLK_WORLD_62, 222, 'SDLK_WORLD_62 should be imported' );
is( SDLK_WORLD_62(), 222, 'SDLK_WORLD_62() should also be available' );
is( SDLK_WORLD_63, 223, 'SDLK_WORLD_63 should be imported' );
is( SDLK_WORLD_63(), 223, 'SDLK_WORLD_63() should also be available' );
is( SDLK_WORLD_64, 224, 'SDLK_WORLD_64 should be imported' );
is( SDLK_WORLD_64(), 224, 'SDLK_WORLD_64() should also be available' );
is( SDLK_WORLD_65, 225, 'SDLK_WORLD_65 should be imported' );
is( SDLK_WORLD_65(), 225, 'SDLK_WORLD_65() should also be available' );
is( SDLK_WORLD_66, 226, 'SDLK_WORLD_66 should be imported' );
is( SDLK_WORLD_66(), 226, 'SDLK_WORLD_66() should also be available' );
is( SDLK_WORLD_67, 227, 'SDLK_WORLD_67 should be imported' );
is( SDLK_WORLD_67(), 227, 'SDLK_WORLD_67() should also be available' );
is( SDLK_WORLD_68, 228, 'SDLK_WORLD_68 should be imported' );
is( SDLK_WORLD_68(), 228, 'SDLK_WORLD_68() should also be available' );
is( SDLK_WORLD_69, 229, 'SDLK_WORLD_69 should be imported' );
is( SDLK_WORLD_69(), 229, 'SDLK_WORLD_69() should also be available' );
is( SDLK_WORLD_70, 230, 'SDLK_WORLD_70 should be imported' );
is( SDLK_WORLD_70(), 230, 'SDLK_WORLD_70() should also be available' );
is( SDLK_WORLD_71, 231, 'SDLK_WORLD_71 should be imported' );
is( SDLK_WORLD_71(), 231, 'SDLK_WORLD_71() should also be available' );
is( SDLK_WORLD_72, 232, 'SDLK_WORLD_72 should be imported' );
is( SDLK_WORLD_72(), 232, 'SDLK_WORLD_72() should also be available' );
is( SDLK_WORLD_73, 233, 'SDLK_WORLD_73 should be imported' );
is( SDLK_WORLD_73(), 233, 'SDLK_WORLD_73() should also be available' );
is( SDLK_WORLD_74, 234, 'SDLK_WORLD_74 should be imported' );
is( SDLK_WORLD_74(), 234, 'SDLK_WORLD_74() should also be available' );
is( SDLK_WORLD_75, 235, 'SDLK_WORLD_75 should be imported' );
is( SDLK_WORLD_75(), 235, 'SDLK_WORLD_75() should also be available' );
is( SDLK_WORLD_76, 236, 'SDLK_WORLD_76 should be imported' );
is( SDLK_WORLD_76(), 236, 'SDLK_WORLD_76() should also be available' );
is( SDLK_WORLD_77, 237, 'SDLK_WORLD_77 should be imported' );
is( SDLK_WORLD_77(), 237, 'SDLK_WORLD_77() should also be available' );
is( SDLK_WORLD_78, 238, 'SDLK_WORLD_78 should be imported' );
is( SDLK_WORLD_78(), 238, 'SDLK_WORLD_78() should also be available' );
is( SDLK_WORLD_79, 239, 'SDLK_WORLD_79 should be imported' );
is( SDLK_WORLD_79(), 239, 'SDLK_WORLD_79() should also be available' );
is( SDLK_WORLD_80, 240, 'SDLK_WORLD_80 should be imported' );
is( SDLK_WORLD_80(), 240, 'SDLK_WORLD_80() should also be available' );
is( SDLK_WORLD_81, 241, 'SDLK_WORLD_81 should be imported' );
is( SDLK_WORLD_81(), 241, 'SDLK_WORLD_81() should also be available' );
is( SDLK_WORLD_82, 242, 'SDLK_WORLD_82 should be imported' );
is( SDLK_WORLD_82(), 242, 'SDLK_WORLD_82() should also be available' );
is( SDLK_WORLD_83, 243, 'SDLK_WORLD_83 should be imported' );
is( SDLK_WORLD_83(), 243, 'SDLK_WORLD_83() should also be available' );
is( SDLK_WORLD_84, 244, 'SDLK_WORLD_84 should be imported' );
is( SDLK_WORLD_84(), 244, 'SDLK_WORLD_84() should also be available' );
is( SDLK_WORLD_85, 245, 'SDLK_WORLD_85 should be imported' );
is( SDLK_WORLD_85(), 245, 'SDLK_WORLD_85() should also be available' );
is( SDLK_WORLD_86, 246, 'SDLK_WORLD_86 should be imported' );
is( SDLK_WORLD_86(), 246, 'SDLK_WORLD_86() should also be available' );
is( SDLK_WORLD_87, 247, 'SDLK_WORLD_87 should be imported' );
is( SDLK_WORLD_87(), 247, 'SDLK_WORLD_87() should also be available' );
is( SDLK_WORLD_88, 248, 'SDLK_WORLD_88 should be imported' );
is( SDLK_WORLD_88(), 248, 'SDLK_WORLD_88() should also be available' );
is( SDLK_WORLD_89, 249, 'SDLK_WORLD_89 should be imported' );
is( SDLK_WORLD_89(), 249, 'SDLK_WORLD_89() should also be available' );
is( SDLK_WORLD_90, 250, 'SDLK_WORLD_90 should be imported' );
is( SDLK_WORLD_90(), 250, 'SDLK_WORLD_90() should also be available' );
is( SDLK_WORLD_91, 251, 'SDLK_WORLD_91 should be imported' );
is( SDLK_WORLD_91(), 251, 'SDLK_WORLD_91() should also be available' );
is( SDLK_WORLD_92, 252, 'SDLK_WORLD_92 should be imported' );
is( SDLK_WORLD_92(), 252, 'SDLK_WORLD_92() should also be available' );
is( SDLK_WORLD_93, 253, 'SDLK_WORLD_93 should be imported' );
is( SDLK_WORLD_93(), 253, 'SDLK_WORLD_93() should also be available' );
is( SDLK_WORLD_94, 254, 'SDLK_WORLD_94 should be imported' );
is( SDLK_WORLD_94(), 254, 'SDLK_WORLD_94() should also be available' );
is( SDLK_WORLD_95, 255, 'SDLK_WORLD_95 should be imported' );
is( SDLK_WORLD_95(), 255, 'SDLK_WORLD_95() should also be available' );
is( SDLK_a, 97, 'SDLK_a should be imported' );
is( SDLK_a(), 97, 'SDLK_a() should also be available' );
is( SDLK_b, 98, 'SDLK_b should be imported' );
is( SDLK_b(), 98, 'SDLK_b() should also be available' );
is( SDLK_c, 99, 'SDLK_c should be imported' );
is( SDLK_c(), 99, 'SDLK_c() should also be available' );
is( SDLK_d, 100, 'SDLK_d should be imported' );
is( SDLK_d(), 100, 'SDLK_d() should also be available' );
is( SDLK_e, 101, 'SDLK_e should be imported' );
is( SDLK_e(), 101, 'SDLK_e() should also be available' );
is( SDLK_f, 102, 'SDLK_f should be imported' );
is( SDLK_f(), 102, 'SDLK_f() should also be available' );
is( SDLK_g, 103, 'SDLK_g should be imported' );
is( SDLK_g(), 103, 'SDLK_g() should also be available' );
is( SDLK_h, 104, 'SDLK_h should be imported' );
is( SDLK_h(), 104, 'SDLK_h() should also be available' );
is( SDLK_i, 105, 'SDLK_i should be imported' );
is( SDLK_i(), 105, 'SDLK_i() should also be available' );
is( SDLK_j, 106, 'SDLK_j should be imported' );
is( SDLK_j(), 106, 'SDLK_j() should also be available' );
is( SDLK_k, 107, 'SDLK_k should be imported' );
is( SDLK_k(), 107, 'SDLK_k() should also be available' );
is( SDLK_l, 108, 'SDLK_l should be imported' );
is( SDLK_l(), 108, 'SDLK_l() should also be available' );
is( SDLK_m, 109, 'SDLK_m should be imported' );
is( SDLK_m(), 109, 'SDLK_m() should also be available' );
is( SDLK_n, 110, 'SDLK_n should be imported' );
is( SDLK_n(), 110, 'SDLK_n() should also be available' );
is( SDLK_o, 111, 'SDLK_o should be imported' );
is( SDLK_o(), 111, 'SDLK_o() should also be available' );
is( SDLK_p, 112, 'SDLK_p should be imported' );
is( SDLK_p(), 112, 'SDLK_p() should also be available' );
is( SDLK_q, 113, 'SDLK_q should be imported' );
is( SDLK_q(), 113, 'SDLK_q() should also be available' );
is( SDLK_r, 114, 'SDLK_r should be imported' );
is( SDLK_r(), 114, 'SDLK_r() should also be available' );
is( SDLK_s, 115, 'SDLK_s should be imported' );
is( SDLK_s(), 115, 'SDLK_s() should also be available' );
is( SDLK_t, 116, 'SDLK_t should be imported' );
is( SDLK_t(), 116, 'SDLK_t() should also be available' );
is( SDLK_u, 117, 'SDLK_u should be imported' );
is( SDLK_u(), 117, 'SDLK_u() should also be available' );
is( SDLK_v, 118, 'SDLK_v should be imported' );
is( SDLK_v(), 118, 'SDLK_v() should also be available' );
is( SDLK_w, 119, 'SDLK_w should be imported' );
is( SDLK_w(), 119, 'SDLK_w() should also be available' );
is( SDLK_x, 120, 'SDLK_x should be imported' );
is( SDLK_x(), 120, 'SDLK_x() should also be available' );
is( SDLK_y, 121, 'SDLK_y should be imported' );
is( SDLK_y(), 121, 'SDLK_y() should also be available' );
is( SDLK_z, 122, 'SDLK_z should be imported' );
is( SDLK_z(), 122, 'SDLK_z() should also be available' );

my $display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );

is( SDL::Events::pump_events(), undef, '[pump_events] Returns undef' );

my $event = SDL::Event->new();

my $aevent = SDL::Event->new();
$aevent->type(SDL_ACTIVEEVENT);
$aevent->active_gain(1);
$aevent->active_state(SDL_APPINPUTFOCUS);

my $userdata = SDL::Event->new();
$userdata->type(SDL_USEREVENT);
my @udata = ( 0 .. 10 );
$userdata->user_data1( \@udata );

SDL::Events::push_event($aevent);
pass '[push_event] Event can be pushed';
SDL::Events::push_event($userdata);
SDL::Events::pump_events();
pass '[pump_events] pumping events';

my $got_event = 0;

while (1) {
SDL::Events::pump_events();

my $ret = SDL::Events::poll_event($event);
my $r;
if ( $event->type == SDL_ACTIVEEVENT
&& $event->active_gain == 1
&& $event->active_state == SDL_APPINPUTFOCUS )
{
$got_event = 1;
is( $got_event, 1, '[poll_event] Got an Active event back out' );
is( $event->active_gain(), 1, '[poll_event] Got right active->gain' );
is( $event->active_state(), SDL_APPINPUTFOCUS,
'[poll_event] Got right active->state'
);

}
if ( $event->type == SDL_USEREVENT ) {
$r = $event->user_data1();
is( @{$r}, 11, '[user_events] can hold user data now' );

}
last if $r && $got_event;
last if ( $ret == 0 );
}

SDL::Events::push_event($aevent);
pass '[push_event] ran';

SDL::Events::pump_events();

my $value = SDL::Events::wait_event($event);

is( $value, 1, '[wait_event] waited for event' );

my $num_peep_events = SDL::Events::peep_events( $event, 127, SDL_PEEKEVENT, SDL_ALLEVENTS );
is( $num_peep_events >= 0,
1, '[peep_events] Size of event queue is ' . $num_peep_events
);

my $callback = sub { return 1; };
SDL::Events::set_event_filter($callback);
pass '[set_event_filter] takes a callback';

my $array = SDL::Events::get_key_state();
isa_ok( $array, 'ARRAY', '[get_key_state] returned and array' );

my @mods = (
KMOD_NONE, KMOD_LSHIFT, KMOD_RSHIFT, KMOD_LCTRL,
KMOD_RCTRL, KMOD_LALT, KMOD_RALT, KMOD_LMETA,
KMOD_RMETA, KMOD_NUM, KMOD_CAPS, KMOD_MODE,
);

foreach (@mods) {
SDL::Events::set_mod_state($_);
pass '[set_mod_state] set the mod properly';
is( SDL::Events::get_mod_state(),
$_, '[get_mod_state] got the mod properly'
);

}

#SDL::quit();

#SDL::init(SDL_INIT_VIDEO);

$display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );

SDL::Video::get_video_info();

is( SDL::Events::get_key_name(SDLK_ESCAPE),
'escape', '[get_key_name] Gets name of key_sym back'
);

SDL::Events::push_event($aevent);
my $nevent = SDL::Event->new();
SDL::Events::event_state( SDL_ACTIVEEVENT, SDL_IGNORE );
SDL::Events::pump_events();

my $got = 0;
while ( SDL::Events::poll_event($nevent) ) {
$got = 1 if $nevent->type == SDL_ACTIVEEVENT;
}
is( $got, 0, '[event_state] works with SDL_IGNORE on SDL_ACTIVEEVENT' );

SDL::Events::event_state( SDL_ACTIVEEVENT, SDL_ENABLE );
SDL::Events::push_event($aevent);
SDL::Events::pump_events();
my $atleast = 0;
while ( SDL::Events::poll_event($nevent) ) {
$atleast = 1 if $nevent->type == SDL_ACTIVEEVENT;
}
is( $atleast, 1, '[event_state] works with SDL_ENABLE on SDL_ACTIVEEVENT' );

is( SDL::Events::enable_unicode(1), 0, '[enable_unicode] return 0 took 1' );
is( SDL::Events::enable_unicode(-1), 1, '[enable_unicode] return 1 took -1' );
is( SDL::Events::enable_unicode(0), 1, '[enable_unicode] return 1 took 0' );
is( SDL::Events::enable_unicode(-1), 0, '[enable_unicode] return 1 took -1' );

#my $kr = SDL::Events::enable_key_repeat( SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
my $kr = SDL::Events::enable_key_repeat( 10, 10 );

is( ( $kr == -1 || $kr == 0 ),
1, '[enable_key_repeat] returned expeceted values'
);

SDL::Events::pump_events();

my $ms = SDL::Events::get_mouse_state();

isa_ok(
$ms, 'ARRAY',
'[get_mouse_state] got back array size of ' . @{$ms} . ' '
);

$ms = SDL::Events::get_relative_mouse_state();

isa_ok(
$ms, 'ARRAY',
'[get_relative_mouse_state] got back array size of ' . @{$ms} . ' '
);

$ms = SDL::Events::get_app_state();

is( ( $ms >= SDL_APPACTIVE || SDL_APPINPUTFOCUS && $ms <= SDL_APPMOUSEFOCUS ),
1, '[get_app_state] Returns value within parameter ' . $ms
);

is( SDL::Events::joystick_event_state(SDL_ENABLE),
SDL_ENABLE, '[joystick_event_state] return SDL_IGNORE correctly'
);
is( SDL::Events::joystick_event_state(SDL_QUERY),
SDL_ENABLE, '[joystick_event_state] return SDL_ENABLE took SDL_QUERY'
);
is( SDL::Events::joystick_event_state(SDL_IGNORE),
SDL_IGNORE, '[joystick_event_state] return SDL_IGNORE correctly'
);
is( SDL::Events::joystick_event_state(SDL_QUERY),
SDL_IGNORE, '[joystick_event_state] return SDL_IGNORE took SDL_QUERY '
);

SKIP:
{
skip "Turn SDL_GUI_TEST on", 1 unless $ENV{'SDL_GUI_TEST'};

SDL::quit();
SDL::init(SDL_INIT_VIDEO);
$display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );
$event = SDL::Event->new();

#This filters out all ActiveEvents
my $filter = sub {
if ( $_[0]->type == SDL_ACTIVEEVENT ) { return 0 }
else { return 1; }
};
my $filtered = 1;

SDL::Events::set_event_filter($filter);

while (1) {
SDL::Events::pump_events();
if ( SDL::Events::poll_event($event) ) {
if ( $event->type == SDL_ACTIVEEVENT ) {
diag 'We should not be in here. The next test will fail!';
$filtered = 0; #we got a problem!
print "Hello Mouse!!!\n"
if ( $event->active_gain
&& ( $event->active_state == SDL_APPMOUSEFOCUS ) );
print "Bye Mouse!!!\n"
if ( !$event->active_gain
&& ( $event->active_state == SDL_APPMOUSEFOCUS ) );
}
last if ( $event->type == SDL_QUIT );
}
}
is( $filtered, 1, '[set_event_filter] Properly filtered SDL_ACTIVEEVENT' );
}

if ($videodriver) {
$ENV{SDL_VIDEODRIVER} = $videodriver;
} else {
delete $ENV{SDL_VIDEODRIVER};
}

#SDL::quit();
pass 'Are we still alive? Checking for segfaults';

done_testing;

sleep(2);
Something went wrong with that request. Please try again.