//"use strict";
// See browser tests for examples (tests/runner.py, search for sdl_). Run with
// python tests/runner.py browser
var LibrarySDL = {
$SDL__deps: ['$FS', '$Browser'],
$SDL: {
defaults: {
width: 320,
height: 200,
copyOnLock: true
},
version: null,
surfaces: {},
events: [],
audios: [null],
fonts: [null],
keyboardState: null,
shiftKey: false,
ctrlKey: false,
altKey: false,
startTime: null,
mouseX: 0,
mouseY: 0,
DOMEventToSDLEvent: {},
keyCodes: { // DOM code ==> SDL code. See https://developer.mozilla.org/en/Document_Object_Model_%28DOM%29/KeyboardEvent and SDL_keycode.h
38: 1106, // up arrow
40: 1105, // down arrow
37: 1104, // left arrow
39: 1103, // right arrow
33: 1099, // pagedup
34: 1102, // pagedown
17: 305, // control (right, or left)
18: 308, // alt
109: 45, // minus
16: 304, // shift
96: 88 | 1<<10, // keypad 0
97: 89 | 1<<10, // keypad 1
98: 90 | 1<<10, // keypad 2
99: 91 | 1<<10, // keypad 3
100: 92 | 1<<10, // keypad 4
101: 93 | 1<<10, // keypad 5
102: 94 | 1<<10, // keypad 6
103: 95 | 1<<10, // keypad 7
104: 96 | 1<<10, // keypad 8
105: 97 | 1<<10, // keypad 9
112: 58 | 1<<10, // F1
113: 59 | 1<<10, // F2
114: 60 | 1<<10, // F3
115: 61 | 1<<10, // F4
116: 62 | 1<<10, // F5
117: 63 | 1<<10, // F6
118: 64 | 1<<10, // F7
119: 65 | 1<<10, // F8
120: 66 | 1<<10, // F9
121: 67 | 1<<10, // F10
122: 68 | 1<<10, // F11
123: 69 | 1<<10, // F12
188: 44, // comma
190: 46, // period
191: 47, // slash (/)
},
scanCodes: { // SDL keycode ==> SDL scancode. See SDL_scancode.h
97: 4, // A
98: 5,
99: 6,
100: 7,
101: 8,
102: 9,
103: 10,
104: 11,
105: 12,
106: 13,
107: 14,
108: 15,
109: 16,
110: 17,
111: 18,
112: 19,
113: 20,
114: 21,
115: 22,
116: 23,
117: 24,
118: