/** * @namespace Top-level ROT namespace */ var ROT = { /** * @returns {bool} Is rot.js supported by this browser? */ isSupported: function() { return !!(document.createElement("canvas").getContext && Function.prototype.bind); }, /** Default with for display and map generators */ DEFAULT_WIDTH: 80, /** Default height for display and map generators */ DEFAULT_HEIGHT: 25, /** Directional constants. Ordering is important! */ DIRS: { "4": [ [ 0, -1], [ 1, 0], [ 0, 1], [-1, 0] ], "8": [ [ 0, -1], [ 1, -1], [ 1, 0], [ 1, 1], [ 0, 1], [-1, 1], [-1, 0], [-1, -1] ], "6": [ [-1, -1], [ 1, -1], [ 2, 0], [ 1, 1], [-1, 1], [-2, 0] ] }, /** Cancel key. */ VK_CANCEL: 3, /** Help key. */ VK_HELP: 6, /** Backspace key. */ VK_BACK_SPACE: 8, /** Tab key. */ VK_TAB: 9, /** 5 key on Numpad when NumLock is unlocked. Or on Mac, clear key which is positioned at NumLock key. */ VK_CLEAR: 12, /** Return/enter key on the main keyboard. */ VK_RETURN: 13, /** Reserved, but not used. */ VK_ENTER: 14, /** Shift key. */ VK_SHIFT: 16, /** Control key. */ VK_CONTROL: 17, /** Alt (Option on Mac) key. */ VK_ALT: 18, /** Pause key. */ VK_PAUSE: 19, /** Caps lock. */ VK_CAPS_LOCK: 20, /** Escape key. */ VK_ESCAPE: 27, /** Space bar. */ VK_SPACE: 32, /** Page Up key. */ VK_PAGE_UP: 33, /** Page Down key. */ VK_PAGE_DOWN: 34, /** End key. */ VK_END: 35, /** Home key. */ VK_HOME: 36, /** Left arrow. */ VK_LEFT: 37, /** Up arrow. */ VK_UP: 38, /** Right arrow. */ VK_RIGHT: 39, /** Down arrow. */ VK_DOWN: 40, /** Print Screen key. */ VK_PRINTSCREEN: 44, /** Ins(ert) key. */ VK_INSERT: 45, /** Del(ete) key. */ VK_DELETE: 46, /***/ VK_0: 48, /***/ VK_1: 49, /***/ VK_2: 50, /***/ VK_3: 51, /***/ VK_4: 52, /***/ VK_5: 53, /***/ VK_6: 54, /***/ VK_7: 55, /***/ VK_8: 56, /***/ VK_9: 57, /** Colon (:) key. Requires Gecko 15.0 */ VK_COLON: 58, /** Semicolon (;) key. */ VK_SEMICOLON: 59, /** Less-than (<) key. Requires Gecko 15.0 */ VK_LESS_THAN: 60, /** Equals (=) key. */ VK_EQUALS: 61, /** Greater-than (>) key. Requires Gecko 15.0 */ VK_GREATER_THAN: 62, /** Question mark (?) key. Requires Gecko 15.0 */ VK_QUESTION_MARK: 63, /** Atmark (@) key. Requires Gecko 15.0 */ VK_AT: 64, /***/ VK_A: 65, /***/ VK_B: 66, /***/ VK_C: 67, /***/ VK_D: 68, /***/ VK_E: 69, /***/ VK_F: 70, /***/ VK_G: 71, /***/ VK_H: 72, /***/ VK_I: 73, /***/ VK_J: 74, /***/ VK_K: 75, /***/ VK_L: 76, /***/ VK_M: 77, /***/ VK_N: 78, /***/ VK_O: 79, /***/ VK_P: 80, /***/ VK_Q: 81, /***/ VK_R: 82, /***/ VK_S: 83, /***/ VK_T: 84, /***/ VK_U: 85, /***/ VK_V: 86, /***/ VK_W: 87, /***/ VK_X: 88, /***/ VK_Y: 89, /***/ VK_Z: 90, /***/ VK_CONTEXT_MENU: 93, /** 0 on the numeric keypad. */ VK_NUMPAD0: 96, /** 1 on the numeric keypad. */ VK_NUMPAD1: 97, /** 2 on the numeric keypad. */ VK_NUMPAD2: 98, /** 3 on the numeric keypad. */ VK_NUMPAD3: 99, /** 4 on the numeric keypad. */ VK_NUMPAD4: 100, /** 5 on the numeric keypad. */ VK_NUMPAD5: 101, /** 6 on the numeric keypad. */ VK_NUMPAD6: 102, /** 7 on the numeric keypad. */ VK_NUMPAD7: 103, /** 8 on the numeric keypad. */ VK_NUMPAD8: 104, /** 9 on the numeric keypad. */ VK_NUMPAD9: 105, /** * on the numeric keypad. */ VK_MULTIPLY: 106, /** + on the numeric keypad. */ VK_ADD: 107, /***/ VK_SEPARATOR: 108, /** - on the numeric keypad. */ VK_SUBTRACT: 109, /** Decimal point on the numeric keypad. */ VK_DECIMAL: 110, /** / on the numeric keypad. */ VK_DIVIDE: 111, /** F1 key. */ VK_F1: 112, /** F2 key. */ VK_F2: 113, /** F3 key. */ VK_F3: 114, /** F4 key. */ VK_F4: 115, /** F5 key. */ VK_F5: 116, /** F6 key. */ VK_F6: 117, /** F7 key. */ VK_F7: 118, /** F8 key. */ VK_F8: 119, /** F9 key. */ VK_F9: 120, /** F10 key. */ VK_F10: 121, /** F11 key. */ VK_F11: 122, /** F12 key. */ VK_F12: 123, /** F13 key. */ VK_F13: 124, /** F14 key. */ VK_F14: 125, /** F15 key. */ VK_F15: 126, /** F16 key. */ VK_F16: 127, /** F17 key. */ VK_F17: 128, /** F18 key. */ VK_F18: 129, /** F19 key. */ VK_F19: 130, /** F20 key. */ VK_F20: 131, /** F21 key. */ VK_F21: 132, /** F22 key. */ VK_F22: 133, /** F23 key. */ VK_F23: 134, /** F24 key. */ VK_F24: 135, /** Num Lock key. */ VK_NUM_LOCK: 144, /** Scroll Lock key. */ VK_SCROLL_LOCK: 145, /** Circumflex (^) key. Requires Gecko 15.0 */ VK_CIRCUMFLEX: 160, /** Exclamation (!) key. Requires Gecko 15.0 */ VK_EXCLAMATION: 161, /** Double quote () key. Requires Gecko 15.0 */ VK_DOUBLE_QUOTE: 162, /** Hash (#) key. Requires Gecko 15.0 */ VK_HASH: 163, /** Dollar sign ($) key. Requires Gecko 15.0 */ VK_DOLLAR: 164, /** Percent (%) key. Requires Gecko 15.0 */ VK_PERCENT: 165, /** Ampersand (&) key. Requires Gecko 15.0 */ VK_AMPERSAND: 166, /** Underscore (_) key. Requires Gecko 15.0 */ VK_UNDERSCORE: 167, /** Open parenthesis (() key. Requires Gecko 15.0 */ VK_OPEN_PAREN: 168, /** Close parenthesis ()) key. Requires Gecko 15.0 */ VK_CLOSE_PAREN: 169, /* Asterisk (*) key. Requires Gecko 15.0 */ VK_ASTERISK: 170, /** Plus (+) key. Requires Gecko 15.0 */ VK_PLUS: 171, /** Pipe (|) key. Requires Gecko 15.0 */ VK_PIPE: 172, /** Hyphen-US/docs/Minus (-) key. Requires Gecko 15.0 */ VK_HYPHEN_MINUS: 173, /** Open curly bracket ({) key. Requires Gecko 15.0 */ VK_OPEN_CURLY_BRACKET: 174, /** Close curly bracket (}) key. Requires Gecko 15.0 */ VK_CLOSE_CURLY_BRACKET: 175, /** Tilde (~) key. Requires Gecko 15.0 */ VK_TILDE: 176, /** Comma (,) key. */ VK_COMMA: 188, /** Period (.) key. */ VK_PERIOD: 190, /** Slash (/) key. */ VK_SLASH: 191, /** Back tick (`) key. */ VK_BACK_QUOTE: 192, /** Open square bracket ([) key. */ VK_OPEN_BRACKET: 219, /** Back slash (\) key. */ VK_BACK_SLASH: 220, /** Close square bracket (]) key. */ VK_CLOSE_BRACKET: 221, /** Quote (''') key. */ VK_QUOTE: 222, /** Meta key on Linux, Command key on Mac. */ VK_META: 224, /** AltGr key on Linux. Requires Gecko 15.0 */ VK_ALTGR: 225, /** Windows logo key on Windows. Or Super or Hyper key on Linux. Requires Gecko 15.0 */ VK_WIN: 91, /** Linux support for this keycode was added in Gecko 4.0. */ VK_KANA: 21, /** Linux support for this keycode was added in Gecko 4.0. */ VK_HANGUL: 21, /** 英数 key on Japanese Mac keyboard. Requires Gecko 15.0 */ VK_EISU: 22, /** Linux support for this keycode was added in Gecko 4.0. */ VK_JUNJA: 23, /** Linux support for this keycode was added in Gecko 4.0. */ VK_FINAL: 24, /** Linux support for this keycode was added in Gecko 4.0. */ VK_HANJA: 25, /** Linux support for this keycode was added in Gecko 4.0. */ VK_KANJI: 25, /** Linux support for this keycode was added in Gecko 4.0. */ VK_CONVERT: 28, /** Linux support for this keycode was added in Gecko 4.0. */ VK_NONCONVERT: 29, /** Linux support for this keycode was added in Gecko 4.0. */ VK_ACCEPT: 30, /** Linux support for this keycode was added in Gecko 4.0. */ VK_MODECHANGE: 31, /** Linux support for this keycode was added in Gecko 4.0. */ VK_SELECT: 41, /** Linux support for this keycode was added in Gecko 4.0. */ VK_PRINT: 42, /** Linux support for this keycode was added in Gecko 4.0. */ VK_EXECUTE: 43, /** Linux support for this keycode was added in Gecko 4.0. */ VK_SLEEP: 95 };