input.js 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923
  1. /*
  2. * noVNC: HTML5 VNC client
  3. * Copyright (C) 2012 Joel Martin
  4. * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
  5. */
  6. /*jslint browser: true, white: false, bitwise: false */
  7. /*global window, Util */
  8. //
  9. // Keyboard event handler
  10. //
  11. function Keyboard(defaults) {
  12. "use strict";
  13. var that = {}, // Public API methods
  14. conf = {}, // Configuration attributes
  15. keyDownList = []; // List of depressed keys
  16. // (even if they are happy)
  17. // Configuration attributes
  18. Util.conf_defaults(conf, that, defaults, [
  19. ['target', 'wo', 'dom', document, 'DOM element that captures keyboard input'],
  20. ['focused', 'rw', 'bool', true, 'Capture and send key events'],
  21. ['onKeyPress', 'rw', 'func', null, 'Handler for key press/release']
  22. ]);
  23. //
  24. // Private functions
  25. //
  26. // From the event keyCode return the keysym value for keys that need
  27. // to be suppressed otherwise they may trigger unintended browser
  28. // actions
  29. function getKeysymSpecial(evt) {
  30. var keysym = null;
  31. switch ( evt.keyCode ) {
  32. // These generate a keyDown and keyPress in Firefox and Opera
  33. case 8 : keysym = 0xFF08; break; // BACKSPACE
  34. case 13 : keysym = 0xFF0D; break; // ENTER
  35. // This generates a keyDown and keyPress in Opera
  36. case 9 : keysym = 0xFF09; break; // TAB
  37. default : break;
  38. }
  39. if (evt.type === 'keydown') {
  40. switch ( evt.keyCode ) {
  41. case 27 : keysym = 0xFF1B; break; // ESCAPE
  42. case 46 : keysym = 0xFFFF; break; // DELETE
  43. case 36 : keysym = 0xFF50; break; // HOME
  44. case 35 : keysym = 0xFF57; break; // END
  45. case 33 : keysym = 0xFF55; break; // PAGE_UP
  46. case 34 : keysym = 0xFF56; break; // PAGE_DOWN
  47. case 45 : keysym = 0xFF63; break; // INSERT
  48. // '-' during keyPress
  49. case 37 : keysym = 0xFF51; break; // LEFT
  50. case 38 : keysym = 0xFF52; break; // UP
  51. case 39 : keysym = 0xFF53; break; // RIGHT
  52. case 40 : keysym = 0xFF54; break; // DOWN
  53. case 16 : keysym = 0xFFE1; break; // SHIFT
  54. case 17 : keysym = 0xFFE3; break; // CONTROL
  55. //case 18 : keysym = 0xFFE7; break; // Left Meta (Mac Option)
  56. case 18 : keysym = 0xFFE9; break; // Left ALT (Mac Command)
  57. case 112 : keysym = 0xFFBE; break; // F1
  58. case 113 : keysym = 0xFFBF; break; // F2
  59. case 114 : keysym = 0xFFC0; break; // F3
  60. case 115 : keysym = 0xFFC1; break; // F4
  61. case 116 : keysym = 0xFFC2; break; // F5
  62. case 117 : keysym = 0xFFC3; break; // F6
  63. case 118 : keysym = 0xFFC4; break; // F7
  64. case 119 : keysym = 0xFFC5; break; // F8
  65. case 120 : keysym = 0xFFC6; break; // F9
  66. case 121 : keysym = 0xFFC7; break; // F10
  67. case 122 : keysym = 0xFFC8; break; // F11
  68. case 123 : keysym = 0xFFC9; break; // F12
  69. case 225 : keysym = 0xFE03; break; // AltGr
  70. case 91 : keysym = 0xFFEC; break; // Super_R (Win Key)
  71. case 93 : keysym = 0xFF67; break; // Menu (Win Menu)
  72. default : break;
  73. }
  74. }
  75. if ((!keysym) && (evt.ctrlKey || evt.altKey)) {
  76. if ((typeof(evt.which) !== "undefined") && (evt.which > 0)) {
  77. keysym = evt.which;
  78. } else {
  79. // IE9 always
  80. // Firefox and Opera when ctrl/alt + special
  81. Util.Warn("which not set, using keyCode");
  82. keysym = evt.keyCode;
  83. }
  84. /* Remap symbols */
  85. switch (keysym) {
  86. case 186 : keysym = 59; break; // ; (IE)
  87. case 187 : keysym = 61; break; // = (IE)
  88. case 188 : keysym = 44; break; // , (Mozilla, IE)
  89. case 109 : // - (Mozilla, Opera)
  90. if (Util.Engine.gecko || Util.Engine.presto) {
  91. keysym = 45; }
  92. break;
  93. case 173 : // - (Mozilla)
  94. if (Util.Engine.gecko) {
  95. keysym = 45; }
  96. break;
  97. case 189 : keysym = 45; break; // - (IE)
  98. case 190 : keysym = 46; break; // . (Mozilla, IE)
  99. case 191 : keysym = 47; break; // / (Mozilla, IE)
  100. case 192 : keysym = 96; break; // ` (Mozilla, IE)
  101. case 219 : keysym = 91; break; // [ (Mozilla, IE)
  102. case 220 : keysym = 92; break; // \ (Mozilla, IE)
  103. case 221 : keysym = 93; break; // ] (Mozilla, IE)
  104. case 222 : keysym = 39; break; // ' (Mozilla, IE)
  105. }
  106. /* Remap shifted and unshifted keys */
  107. if (!!evt.shiftKey) {
  108. switch (keysym) {
  109. case 48 : keysym = 41 ; break; // ) (shifted 0)
  110. case 49 : keysym = 33 ; break; // ! (shifted 1)
  111. case 50 : keysym = 64 ; break; // @ (shifted 2)
  112. case 51 : keysym = 35 ; break; // # (shifted 3)
  113. case 52 : keysym = 36 ; break; // $ (shifted 4)
  114. case 53 : keysym = 37 ; break; // % (shifted 5)
  115. case 54 : keysym = 94 ; break; // ^ (shifted 6)
  116. case 55 : keysym = 38 ; break; // & (shifted 7)
  117. case 56 : keysym = 42 ; break; // * (shifted 8)
  118. case 57 : keysym = 40 ; break; // ( (shifted 9)
  119. case 59 : keysym = 58 ; break; // : (shifted `)
  120. case 61 : keysym = 43 ; break; // + (shifted ;)
  121. case 44 : keysym = 60 ; break; // < (shifted ,)
  122. case 45 : keysym = 95 ; break; // _ (shifted -)
  123. case 46 : keysym = 62 ; break; // > (shifted .)
  124. case 47 : keysym = 63 ; break; // ? (shifted /)
  125. case 96 : keysym = 126; break; // ~ (shifted `)
  126. case 91 : keysym = 123; break; // { (shifted [)
  127. case 92 : keysym = 124; break; // | (shifted \)
  128. case 93 : keysym = 125; break; // } (shifted ])
  129. case 39 : keysym = 34 ; break; // " (shifted ')
  130. }
  131. } else if ((keysym >= 65) && (keysym <=90)) {
  132. /* Remap unshifted A-Z */
  133. keysym += 32;
  134. } else if (evt.keyLocation === 3) {
  135. // numpad keys
  136. switch (keysym) {
  137. case 96 : keysym = 48; break; // 0
  138. case 97 : keysym = 49; break; // 1
  139. case 98 : keysym = 50; break; // 2
  140. case 99 : keysym = 51; break; // 3
  141. case 100: keysym = 52; break; // 4
  142. case 101: keysym = 53; break; // 5
  143. case 102: keysym = 54; break; // 6
  144. case 103: keysym = 55; break; // 7
  145. case 104: keysym = 56; break; // 8
  146. case 105: keysym = 57; break; // 9
  147. case 109: keysym = 45; break; // -
  148. case 110: keysym = 46; break; // .
  149. case 111: keysym = 47; break; // /
  150. }
  151. }
  152. }
  153. return keysym;
  154. }
  155. /* Translate DOM keyPress event to keysym value */
  156. function getKeysym(evt) {
  157. var keysym, msg;
  158. if (typeof(evt.which) !== "undefined") {
  159. // WebKit, Firefox, Opera
  160. keysym = evt.which;
  161. } else {
  162. // IE9
  163. Util.Warn("which not set, using keyCode");
  164. keysym = evt.keyCode;
  165. }
  166. if ((keysym > 255) && (keysym < 0xFF00)) {
  167. msg = "Mapping character code " + keysym;
  168. // Map Unicode outside Latin 1 to X11 keysyms
  169. keysym = unicodeTable[keysym];
  170. if (typeof(keysym) === 'undefined') {
  171. keysym = 0;
  172. }
  173. Util.Debug(msg + " to " + keysym);
  174. }
  175. return keysym;
  176. }
  177. function show_keyDownList(kind) {
  178. var c;
  179. var msg = "keyDownList (" + kind + "):\n";
  180. for (c = 0; c < keyDownList.length; c++) {
  181. msg = msg + " " + c + " - keyCode: " + keyDownList[c].keyCode +
  182. " - which: " + keyDownList[c].which + "\n";
  183. }
  184. Util.Debug(msg);
  185. }
  186. function copyKeyEvent(evt) {
  187. var members = ['type', 'keyCode', 'charCode', 'which',
  188. 'altKey', 'ctrlKey', 'shiftKey',
  189. 'keyLocation', 'keyIdentifier'], i, obj = {};
  190. for (i = 0; i < members.length; i++) {
  191. if (typeof(evt[members[i]]) !== "undefined") {
  192. obj[members[i]] = evt[members[i]];
  193. }
  194. }
  195. return obj;
  196. }
  197. function pushKeyEvent(fevt) {
  198. keyDownList.push(fevt);
  199. }
  200. function getKeyEvent(keyCode, pop) {
  201. var i, fevt = null;
  202. for (i = keyDownList.length-1; i >= 0; i--) {
  203. if (keyDownList[i].keyCode === keyCode) {
  204. if ((typeof(pop) !== "undefined") && (pop)) {
  205. fevt = keyDownList.splice(i, 1)[0];
  206. } else {
  207. fevt = keyDownList[i];
  208. }
  209. break;
  210. }
  211. }
  212. return fevt;
  213. }
  214. function ignoreKeyEvent(evt) {
  215. // Blarg. Some keys have a different keyCode on keyDown vs keyUp
  216. if (evt.keyCode === 229) {
  217. // French AZERTY keyboard dead key.
  218. // Lame thing is that the respective keyUp is 219 so we can't
  219. // properly ignore the keyUp event
  220. return true;
  221. }
  222. return false;
  223. }
  224. //
  225. // Key Event Handling:
  226. //
  227. // There are several challenges when dealing with key events:
  228. // - The meaning and use of keyCode, charCode and which depends on
  229. // both the browser and the event type (keyDown/Up vs keyPress).
  230. // - We cannot automatically determine the keyboard layout
  231. // - The keyDown and keyUp events have a keyCode value that has not
  232. // been translated by modifier keys.
  233. // - The keyPress event has a translated (for layout and modifiers)
  234. // character code but the attribute containing it differs. keyCode
  235. // contains the translated value in WebKit (Chrome/Safari), Opera
  236. // 11 and IE9. charCode contains the value in WebKit and Firefox.
  237. // The which attribute contains the value on WebKit, Firefox and
  238. // Opera 11.
  239. // - The keyDown/Up keyCode value indicates (sort of) the physical
  240. // key was pressed but only for standard US layout. On a US
  241. // keyboard, the '-' and '_' characters are on the same key and
  242. // generate a keyCode value of 189. But on an AZERTY keyboard even
  243. // though they are different physical keys they both still
  244. // generate a keyCode of 189!
  245. // - To prevent a key event from propagating to the browser and
  246. // causing unwanted default actions (such as closing a tab,
  247. // opening a menu, shifting focus, etc) we must suppress this
  248. // event in both keyDown and keyPress because not all key strokes
  249. // generate on a keyPress event. Also, in WebKit and IE9
  250. // suppressing the keyDown prevents a keyPress but other browsers
  251. // still generated a keyPress even if keyDown is suppressed.
  252. //
  253. // For safe key events, we wait until the keyPress event before
  254. // reporting a key down event. For unsafe key events, we report a key
  255. // down event when the keyDown event fires and we suppress any further
  256. // actions (including keyPress).
  257. //
  258. // In order to report a key up event that matches what we reported
  259. // for the key down event, we keep a list of keys that are currently
  260. // down. When the keyDown event happens, we add the key event to the
  261. // list. If it is a safe key event, then we update the which attribute
  262. // in the most recent item on the list when we received a keyPress
  263. // event (keyPress should immediately follow keyDown). When we
  264. // received a keyUp event we search for the event on the list with
  265. // a matching keyCode and we report the character code using the value
  266. // in the 'which' attribute that was stored with that key.
  267. //
  268. function onKeyDown(e) {
  269. if (! conf.focused) {
  270. return true;
  271. }
  272. var fevt = null, evt = (e ? e : window.event),
  273. keysym = null, suppress = false;
  274. //Util.Debug("onKeyDown kC:" + evt.keyCode + " cC:" + evt.charCode + " w:" + evt.which);
  275. fevt = copyKeyEvent(evt);
  276. keysym = getKeysymSpecial(evt);
  277. // Save keysym decoding for use in keyUp
  278. fevt.keysym = keysym;
  279. if (keysym) {
  280. // If it is a key or key combination that might trigger
  281. // browser behaviors or it has no corresponding keyPress
  282. // event, then send it immediately
  283. if (conf.onKeyPress && !ignoreKeyEvent(evt)) {
  284. Util.Debug("onKeyPress down, keysym: " + keysym +
  285. " (onKeyDown key: " + evt.keyCode +
  286. ", which: " + evt.which + ")");
  287. conf.onKeyPress(keysym, 1, evt);
  288. }
  289. suppress = true;
  290. }
  291. if (! ignoreKeyEvent(evt)) {
  292. // Add it to the list of depressed keys
  293. pushKeyEvent(fevt);
  294. //show_keyDownList('down');
  295. }
  296. if (suppress) {
  297. // Suppress bubbling/default actions
  298. Util.stopEvent(e);
  299. return false;
  300. } else {
  301. // Allow the event to bubble and become a keyPress event which
  302. // will have the character code translated
  303. return true;
  304. }
  305. }
  306. function onKeyPress(e) {
  307. if (! conf.focused) {
  308. return true;
  309. }
  310. var evt = (e ? e : window.event),
  311. kdlen = keyDownList.length, keysym = null;
  312. //Util.Debug("onKeyPress kC:" + evt.keyCode + " cC:" + evt.charCode + " w:" + evt.which);
  313. if (((evt.which !== "undefined") && (evt.which === 0)) ||
  314. (getKeysymSpecial(evt))) {
  315. // Firefox and Opera generate a keyPress event even if keyDown
  316. // is suppressed. But the keys we want to suppress will have
  317. // either:
  318. // - the which attribute set to 0
  319. // - getKeysymSpecial() will identify it
  320. Util.Debug("Ignoring special key in keyPress");
  321. Util.stopEvent(e);
  322. return false;
  323. }
  324. keysym = getKeysym(evt);
  325. // Modify the the which attribute in the depressed keys list so
  326. // that the keyUp event will be able to have the character code
  327. // translation available.
  328. if (kdlen > 0) {
  329. keyDownList[kdlen-1].keysym = keysym;
  330. } else {
  331. Util.Warn("keyDownList empty when keyPress triggered");
  332. }
  333. //show_keyDownList('press');
  334. // Send the translated keysym
  335. if (conf.onKeyPress && (keysym > 0)) {
  336. Util.Debug("onKeyPress down, keysym: " + keysym +
  337. " (onKeyPress key: " + evt.keyCode +
  338. ", which: " + evt.which + ")");
  339. conf.onKeyPress(keysym, 1, evt);
  340. }
  341. // Stop keypress events just in case
  342. Util.stopEvent(e);
  343. return false;
  344. }
  345. function onKeyUp(e) {
  346. if (! conf.focused) {
  347. return true;
  348. }
  349. var fevt = null, evt = (e ? e : window.event), keysym;
  350. //Util.Debug("onKeyUp kC:" + evt.keyCode + " cC:" + evt.charCode + " w:" + evt.which);
  351. fevt = getKeyEvent(evt.keyCode, true);
  352. if (fevt) {
  353. keysym = fevt.keysym;
  354. } else {
  355. Util.Warn("Key event (keyCode = " + evt.keyCode +
  356. ") not found on keyDownList");
  357. keysym = 0;
  358. }
  359. //show_keyDownList('up');
  360. if (conf.onKeyPress && (keysym > 0)) {
  361. //Util.Debug("keyPress up, keysym: " + keysym +
  362. // " (key: " + evt.keyCode + ", which: " + evt.which + ")");
  363. Util.Debug("onKeyPress up, keysym: " + keysym +
  364. " (onKeyPress key: " + evt.keyCode +
  365. ", which: " + evt.which + ")");
  366. conf.onKeyPress(keysym, 0, evt);
  367. }
  368. Util.stopEvent(e);
  369. return false;
  370. }
  371. function allKeysUp() {
  372. Util.Debug(">> Keyboard.allKeysUp");
  373. if (keyDownList.length > 0) {
  374. Util.Info("Releasing pressed/down keys");
  375. }
  376. var i, keysym, fevt = null;
  377. for (i = keyDownList.length-1; i >= 0; i--) {
  378. fevt = keyDownList.splice(i, 1)[0];
  379. keysym = fevt.keysym;
  380. if (conf.onKeyPress && (keysym > 0)) {
  381. Util.Debug("allKeysUp, keysym: " + keysym +
  382. " (keyCode: " + fevt.keyCode +
  383. ", which: " + fevt.which + ")");
  384. conf.onKeyPress(keysym, 0, fevt);
  385. }
  386. }
  387. Util.Debug("<< Keyboard.allKeysUp");
  388. return;
  389. }
  390. //
  391. // Public API interface functions
  392. //
  393. that.grab = function() {
  394. //Util.Debug(">> Keyboard.grab");
  395. var c = conf.target;
  396. Util.addEvent(c, 'keydown', onKeyDown);
  397. Util.addEvent(c, 'keyup', onKeyUp);
  398. Util.addEvent(c, 'keypress', onKeyPress);
  399. // Release (key up) if window loses focus
  400. Util.addEvent(window, 'blur', allKeysUp);
  401. //Util.Debug("<< Keyboard.grab");
  402. };
  403. that.ungrab = function() {
  404. //Util.Debug(">> Keyboard.ungrab");
  405. var c = conf.target;
  406. Util.removeEvent(c, 'keydown', onKeyDown);
  407. Util.removeEvent(c, 'keyup', onKeyUp);
  408. Util.removeEvent(c, 'keypress', onKeyPress);
  409. Util.removeEvent(window, 'blur', allKeysUp);
  410. // Release (key up) all keys that are in a down state
  411. allKeysUp();
  412. //Util.Debug(">> Keyboard.ungrab");
  413. };
  414. return that; // Return the public API interface
  415. } // End of Keyboard()
  416. //
  417. // Mouse event handler
  418. //
  419. function Mouse(defaults) {
  420. "use strict";
  421. var that = {}, // Public API methods
  422. conf = {}; // Configuration attributes
  423. // Configuration attributes
  424. Util.conf_defaults(conf, that, defaults, [
  425. ['target', 'ro', 'dom', document, 'DOM element that captures mouse input'],
  426. ['focused', 'rw', 'bool', true, 'Capture and send mouse clicks/movement'],
  427. ['scale', 'rw', 'float', 1.0, 'Viewport scale factor 0.0 - 1.0'],
  428. ['onMouseButton', 'rw', 'func', null, 'Handler for mouse button click/release'],
  429. ['onMouseMove', 'rw', 'func', null, 'Handler for mouse movement'],
  430. ['touchButton', 'rw', 'int', 1, 'Button mask (1, 2, 4) for touch devices (0 means ignore clicks)']
  431. ]);
  432. //
  433. // Private functions
  434. //
  435. function onMouseButton(e, down) {
  436. var evt, pos, bmask;
  437. if (! conf.focused) {
  438. return true;
  439. }
  440. evt = (e ? e : window.event);
  441. pos = Util.getEventPosition(e, conf.target, conf.scale);
  442. if (e.touches || e.changedTouches) {
  443. // Touch device
  444. bmask = conf.touchButton;
  445. // If bmask is set
  446. } else if (evt.which) {
  447. /* everything except IE */
  448. bmask = 1 << evt.button;
  449. } else {
  450. /* IE including 9 */
  451. bmask = (evt.button & 0x1) + // Left
  452. (evt.button & 0x2) * 2 + // Right
  453. (evt.button & 0x4) / 2; // Middle
  454. }
  455. //Util.Debug("mouse " + pos.x + "," + pos.y + " down: " + down +
  456. // " bmask: " + bmask + "(evt.button: " + evt.button + ")");
  457. if (bmask > 0 && conf.onMouseButton) {
  458. Util.Debug("onMouseButton " + (down ? "down" : "up") +
  459. ", x: " + pos.x + ", y: " + pos.y + ", bmask: " + bmask);
  460. conf.onMouseButton(pos.x, pos.y, down, bmask);
  461. }
  462. Util.stopEvent(e);
  463. return false;
  464. }
  465. function onMouseDown(e) {
  466. onMouseButton(e, 1);
  467. }
  468. function onMouseUp(e) {
  469. onMouseButton(e, 0);
  470. }
  471. function onMouseWheel(e) {
  472. var evt, pos, bmask, wheelData;
  473. if (! conf.focused) {
  474. return true;
  475. }
  476. evt = (e ? e : window.event);
  477. pos = Util.getEventPosition(e, conf.target, conf.scale);
  478. wheelData = evt.detail ? evt.detail * -1 : evt.wheelDelta / 40;
  479. if (wheelData > 0) {
  480. bmask = 1 << 3;
  481. } else {
  482. bmask = 1 << 4;
  483. }
  484. //Util.Debug('mouse scroll by ' + wheelData + ':' + pos.x + "," + pos.y);
  485. if (conf.onMouseButton) {
  486. conf.onMouseButton(pos.x, pos.y, 1, bmask);
  487. conf.onMouseButton(pos.x, pos.y, 0, bmask);
  488. }
  489. Util.stopEvent(e);
  490. return false;
  491. }
  492. function onMouseMove(e) {
  493. var evt, pos;
  494. if (! conf.focused) {
  495. return true;
  496. }
  497. evt = (e ? e : window.event);
  498. pos = Util.getEventPosition(e, conf.target, conf.scale);
  499. //Util.Debug('mouse ' + evt.which + '/' + evt.button + ' up:' + pos.x + "," + pos.y);
  500. if (conf.onMouseMove) {
  501. conf.onMouseMove(pos.x, pos.y);
  502. }
  503. Util.stopEvent(e);
  504. return false;
  505. }
  506. function onMouseDisable(e) {
  507. var evt, pos;
  508. if (! conf.focused) {
  509. return true;
  510. }
  511. evt = (e ? e : window.event);
  512. pos = Util.getEventPosition(e, conf.target, conf.scale);
  513. /* Stop propagation if inside canvas area */
  514. if ((pos.x >= 0) && (pos.y >= 0) &&
  515. (pos.x < conf.target.offsetWidth) &&
  516. (pos.y < conf.target.offsetHeight)) {
  517. //Util.Debug("mouse event disabled");
  518. Util.stopEvent(e);
  519. return false;
  520. }
  521. //Util.Debug("mouse event not disabled");
  522. return true;
  523. }
  524. //
  525. // Public API interface functions
  526. //
  527. that.grab = function() {
  528. //Util.Debug(">> Mouse.grab");
  529. var c = conf.target;
  530. if ('ontouchstart' in document.documentElement) {
  531. Util.addEvent(c, 'touchstart', onMouseDown);
  532. Util.addEvent(window, 'touchend', onMouseUp);
  533. Util.addEvent(c, 'touchend', onMouseUp);
  534. Util.addEvent(c, 'touchmove', onMouseMove);
  535. } else {
  536. Util.addEvent(c, 'mousedown', onMouseDown);
  537. Util.addEvent(window, 'mouseup', onMouseUp);
  538. Util.addEvent(c, 'mouseup', onMouseUp);
  539. Util.addEvent(c, 'mousemove', onMouseMove);
  540. Util.addEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel',
  541. onMouseWheel);
  542. }
  543. /* Work around right and middle click browser behaviors */
  544. Util.addEvent(document, 'click', onMouseDisable);
  545. Util.addEvent(document.body, 'contextmenu', onMouseDisable);
  546. //Util.Debug("<< Mouse.grab");
  547. };
  548. that.ungrab = function() {
  549. //Util.Debug(">> Mouse.ungrab");
  550. var c = conf.target;
  551. if ('ontouchstart' in document.documentElement) {
  552. Util.removeEvent(c, 'touchstart', onMouseDown);
  553. Util.removeEvent(window, 'touchend', onMouseUp);
  554. Util.removeEvent(c, 'touchend', onMouseUp);
  555. Util.removeEvent(c, 'touchmove', onMouseMove);
  556. } else {
  557. Util.removeEvent(c, 'mousedown', onMouseDown);
  558. Util.removeEvent(window, 'mouseup', onMouseUp);
  559. Util.removeEvent(c, 'mouseup', onMouseUp);
  560. Util.removeEvent(c, 'mousemove', onMouseMove);
  561. Util.removeEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel',
  562. onMouseWheel);
  563. }
  564. /* Work around right and middle click browser behaviors */
  565. Util.removeEvent(document, 'click', onMouseDisable);
  566. Util.removeEvent(document.body, 'contextmenu', onMouseDisable);
  567. //Util.Debug(">> Mouse.ungrab");
  568. };
  569. return that; // Return the public API interface
  570. } // End of Mouse()
  571. /*
  572. * Browser keypress to X11 keysym for Unicode characters > U+00FF
  573. */
  574. unicodeTable = {
  575. 0x0104 : 0x01a1,
  576. 0x02D8 : 0x01a2,
  577. 0x0141 : 0x01a3,
  578. 0x013D : 0x01a5,
  579. 0x015A : 0x01a6,
  580. 0x0160 : 0x01a9,
  581. 0x015E : 0x01aa,
  582. 0x0164 : 0x01ab,
  583. 0x0179 : 0x01ac,
  584. 0x017D : 0x01ae,
  585. 0x017B : 0x01af,
  586. 0x0105 : 0x01b1,
  587. 0x02DB : 0x01b2,
  588. 0x0142 : 0x01b3,
  589. 0x013E : 0x01b5,
  590. 0x015B : 0x01b6,
  591. 0x02C7 : 0x01b7,
  592. 0x0161 : 0x01b9,
  593. 0x015F : 0x01ba,
  594. 0x0165 : 0x01bb,
  595. 0x017A : 0x01bc,
  596. 0x02DD : 0x01bd,
  597. 0x017E : 0x01be,
  598. 0x017C : 0x01bf,
  599. 0x0154 : 0x01c0,
  600. 0x0102 : 0x01c3,
  601. 0x0139 : 0x01c5,
  602. 0x0106 : 0x01c6,
  603. 0x010C : 0x01c8,
  604. 0x0118 : 0x01ca,
  605. 0x011A : 0x01cc,
  606. 0x010E : 0x01cf,
  607. 0x0110 : 0x01d0,
  608. 0x0143 : 0x01d1,
  609. 0x0147 : 0x01d2,
  610. 0x0150 : 0x01d5,
  611. 0x0158 : 0x01d8,
  612. 0x016E : 0x01d9,
  613. 0x0170 : 0x01db,
  614. 0x0162 : 0x01de,
  615. 0x0155 : 0x01e0,
  616. 0x0103 : 0x01e3,
  617. 0x013A : 0x01e5,
  618. 0x0107 : 0x01e6,
  619. 0x010D : 0x01e8,
  620. 0x0119 : 0x01ea,
  621. 0x011B : 0x01ec,
  622. 0x010F : 0x01ef,
  623. 0x0111 : 0x01f0,
  624. 0x0144 : 0x01f1,
  625. 0x0148 : 0x01f2,
  626. 0x0151 : 0x01f5,
  627. 0x0171 : 0x01fb,
  628. 0x0159 : 0x01f8,
  629. 0x016F : 0x01f9,
  630. 0x0163 : 0x01fe,
  631. 0x02D9 : 0x01ff,
  632. 0x0126 : 0x02a1,
  633. 0x0124 : 0x02a6,
  634. 0x0130 : 0x02a9,
  635. 0x011E : 0x02ab,
  636. 0x0134 : 0x02ac,
  637. 0x0127 : 0x02b1,
  638. 0x0125 : 0x02b6,
  639. 0x0131 : 0x02b9,
  640. 0x011F : 0x02bb,
  641. 0x0135 : 0x02bc,
  642. 0x010A : 0x02c5,
  643. 0x0108 : 0x02c6,
  644. 0x0120 : 0x02d5,
  645. 0x011C : 0x02d8,
  646. 0x016C : 0x02dd,
  647. 0x015C : 0x02de,
  648. 0x010B : 0x02e5,
  649. 0x0109 : 0x02e6,
  650. 0x0121 : 0x02f5,
  651. 0x011D : 0x02f8,
  652. 0x016D : 0x02fd,
  653. 0x015D : 0x02fe,
  654. 0x0138 : 0x03a2,
  655. 0x0156 : 0x03a3,
  656. 0x0128 : 0x03a5,
  657. 0x013B : 0x03a6,
  658. 0x0112 : 0x03aa,
  659. 0x0122 : 0x03ab,
  660. 0x0166 : 0x03ac,
  661. 0x0157 : 0x03b3,
  662. 0x0129 : 0x03b5,
  663. 0x013C : 0x03b6,
  664. 0x0113 : 0x03ba,
  665. 0x0123 : 0x03bb,
  666. 0x0167 : 0x03bc,
  667. 0x014A : 0x03bd,
  668. 0x014B : 0x03bf,
  669. 0x0100 : 0x03c0,
  670. 0x012E : 0x03c7,
  671. 0x0116 : 0x03cc,
  672. 0x012A : 0x03cf,
  673. 0x0145 : 0x03d1,
  674. 0x014C : 0x03d2,
  675. 0x0136 : 0x03d3,
  676. 0x0172 : 0x03d9,
  677. 0x0168 : 0x03dd,
  678. 0x016A : 0x03de,
  679. 0x0101 : 0x03e0,
  680. 0x012F : 0x03e7,
  681. 0x0117 : 0x03ec,
  682. 0x012B : 0x03ef,
  683. 0x0146 : 0x03f1,
  684. 0x014D : 0x03f2,
  685. 0x0137 : 0x03f3,
  686. 0x0173 : 0x03f9,
  687. 0x0169 : 0x03fd,
  688. 0x016B : 0x03fe,
  689. 0x1E02 : 0x1001e02,
  690. 0x1E03 : 0x1001e03,
  691. 0x1E0A : 0x1001e0a,
  692. 0x1E80 : 0x1001e80,
  693. 0x1E82 : 0x1001e82,
  694. 0x1E0B : 0x1001e0b,
  695. 0x1EF2 : 0x1001ef2,
  696. 0x1E1E : 0x1001e1e,
  697. 0x1E1F : 0x1001e1f,
  698. 0x1E40 : 0x1001e40,
  699. 0x1E41 : 0x1001e41,
  700. 0x1E56 : 0x1001e56,
  701. 0x1E81 : 0x1001e81,
  702. 0x1E57 : 0x1001e57,
  703. 0x1E83 : 0x1001e83,
  704. 0x1E60 : 0x1001e60,
  705. 0x1EF3 : 0x1001ef3,
  706. 0x1E84 : 0x1001e84,
  707. 0x1E85 : 0x1001e85,
  708. 0x1E61 : 0x1001e61,
  709. 0x0174 : 0x1000174,
  710. 0x1E6A : 0x1001e6a,
  711. 0x0176 : 0x1000176,
  712. 0x0175 : 0x1000175,
  713. 0x1E6B : 0x1001e6b,
  714. 0x0177 : 0x1000177,
  715. 0x0152 : 0x13bc,
  716. 0x0153 : 0x13bd,
  717. 0x0178 : 0x13be,
  718. 0x203E : 0x047e,
  719. 0x3002 : 0x04a1,
  720. 0x300C : 0x04a2,
  721. 0x300D : 0x04a3,
  722. 0x3001 : 0x04a4,
  723. 0x30FB : 0x04a5,
  724. 0x30F2 : 0x04a6,
  725. 0x30A1 : 0x04a7,
  726. 0x30A3 : 0x04a8,
  727. 0x30A5 : 0x04a9,
  728. 0x30A7 : 0x04aa,
  729. 0x30A9 : 0x04ab,
  730. 0x30E3 : 0x04ac,
  731. 0x30E5 : 0x04ad,
  732. 0x30E7 : 0x04ae,
  733. 0x30C3 : 0x04af,
  734. 0x30FC : 0x04b0,
  735. 0x30A2 : 0x04b1,
  736. 0x30A4 : 0x04b2,
  737. 0x30A6 : 0x04b3,
  738. 0x30A8 : 0x04b4,
  739. 0x30AA : 0x04b5,
  740. 0x30AB : 0x04b6,
  741. 0x30AD : 0x04b7,
  742. 0x30AF : 0x04b8,
  743. 0x30B1 : 0x04b9,
  744. 0x30B3 : 0x04ba,
  745. 0x30B5 : 0x04bb,
  746. 0x30B7 : 0x04bc,
  747. 0x30B9 : 0x04bd,
  748. 0x30BB : 0x04be,
  749. 0x30BD : 0x04bf,
  750. 0x30BF : 0x04c0,
  751. 0x30C1 : 0x04c1,
  752. 0x30C4 : 0x04c2,
  753. 0x30C6 : 0x04c3,
  754. 0x30C8 : 0x04c4,
  755. 0x30CA : 0x04c5,
  756. 0x30CB : 0x04c6,
  757. 0x30CC : 0x04c7,
  758. 0x30CD : 0x04c8,
  759. 0x30CE : 0x04c9,
  760. 0x30CF : 0x04ca,
  761. 0x30D2 : 0x04cb,
  762. 0x30D5 : 0x04cc,
  763. 0x30D8 : 0x04cd,
  764. 0x30DB : 0x04ce,
  765. 0x30DE : 0x04cf,
  766. 0x30DF : 0x04d0,
  767. 0x30E0 : 0x04d1,
  768. 0x30E1 : 0x04d2,
  769. 0x30E2 : 0x04d3,
  770. 0x30E4 : 0x04d4,
  771. 0x30E6 : 0x04d5,
  772. 0x30E8 : 0x04d6,
  773. 0x30E9 : 0x04d7,
  774. 0x30EA : 0x04d8,
  775. 0x30EB : 0x04d9,
  776. 0x30EC : 0x04da,
  777. 0x30ED : 0x04db,
  778. 0x30EF : 0x04dc,
  779. 0x30F3 : 0x04dd,
  780. 0x309B : 0x04de,
  781. 0x309C : 0x04df,
  782. 0x06F0 : 0x10006f0,
  783. 0x06F1 : 0x10006f1,
  784. 0x06F2 : 0x10006f2,
  785. 0x06F3 : 0x10006f3,
  786. 0x06F4 : 0x10006f4,
  787. 0x06F5 : 0x10006f5,
  788. 0x06F6 : 0x10006f6,
  789. 0x06F7 : 0x10006f7,
  790. 0x06F8 : 0x10006f8,
  791. 0x06F9 : 0x10006f9,
  792. 0x066A : 0x100066a,
  793. 0x0670 : 0x1000670,
  794. 0x0679 : 0x1000679,
  795. 0x067E : 0x100067e,
  796. 0x0686 : 0x1000686,
  797. 0x0688 : 0x1000688,
  798. 0x0691 : 0x1000691,
  799. 0x060C : 0x05ac,
  800. 0x06D4 : 0x10006d4,
  801. 0x0660 : 0x1000660,
  802. 0x0661 : 0x1000661,
  803. 0x0662 : 0x1000662,
  804. 0x0663 : 0x1000663,
  805. 0x0664 : 0x1000664,
  806. 0x0665 : 0x1000665,
  807. 0x0666 : 0x1000666,
  808. 0x0667 : 0x1000667,
  809. 0x0668 : 0x1000668,
  810. 0x0669 : 0x1000669,
  811. 0x061B : 0x05bb,
  812. 0x061F : 0x05bf,
  813. 0x0621 : 0x05c1,
  814. 0x0622 : 0x05c2,
  815. 0x0623 : 0x05c3,
  816. 0x0624 : 0x05c4,
  817. 0x0625 : 0x05c5,
  818. 0x0626 : 0x05c6,
  819. 0x0627 : 0x05c7,
  820. 0x0628 : 0x05c8,
  821. 0x0629 : 0x05c9,
  822. 0x062A : 0x05ca,
  823. 0x062B : 0x05cb,
  824. 0x062C : 0x05cc,
  825. 0x062D : 0x05cd,
  826. 0x062E : 0x05ce,
  827. 0x062F : 0x05cf,
  828. 0x0630 : 0x05d0,
  829. 0x0631 : 0x05d1,
  830. 0x0632 : 0x05d2,
  831. 0x0633 : 0x05d3,
  832. 0x0634 : 0x05d4,
  833. 0x0635 : 0x05d5,
  834. 0x0636 : 0x05d6,
  835. 0x0637 : 0x05d7,
  836. 0x0638 : 0x05d8,
  837. 0x0639 : 0x05d9,
  838. 0x063A : 0x05da,
  839. 0x0640 : 0x05e0,
  840. 0x0641 : 0x05e1,
  841. 0x0642 : 0x05e2,
  842. 0x0643 : 0x05e3,
  843. 0x0644 : 0x05e4,
  844. 0x0645 : 0x05e5,
  845. 0x0646 : 0x05e6,
  846. 0x0647 : 0x05e7,
  847. 0x0648 : 0x05e8,
  848. 0x0649 : 0x05e9,
  849. 0x064A : 0x05ea,
  850. 0x064B : 0x05eb,
  851. 0x064C : 0x05ec,
  852. 0x064D : 0x05ed,
  853. 0x064E : 0x05ee,
  854. 0x064F : 0x05ef,
  855. 0x0650 : 0x05f0,
  856. 0x0651 : 0x05f1,
  857. 0x0652 : 0x05f2,
  858. 0x0653 : 0x1000653,
  859. 0x0654 : 0x1000654,
  860. 0x0655 : 0x1000655,
  861. 0x0698 : 0x1000698,
  862. 0x06A4 : 0x10006a4,
  863. 0x06A9 : 0x10006a9,
  864. 0x06AF : 0x10006af,
  865. 0x06BA : 0x10006ba,
  866. 0x06BE : 0x10006be,
  867. 0x06CC : 0x10006cc,
  868. 0x06D2 : 0x10006d2,
  869. 0x06C1 : 0x10006c1,
  870. 0x0492 : 0x1000492,
  871. 0x0493 : 0x1000493,
  872. 0x0496 : 0x1000496,
  873. 0x0497 : 0x1000497,
  874. 0x049A : 0x100049a,
  875. 0x049B : 0x100049b,
  876. 0x049C : 0x100049c,
  877. 0x049D : 0x100049d,
  878. 0x04A2 : 0x10004a2,
  879. 0x04A3 : 0x10004a3,
  880. 0x04AE : 0x10004ae,
  881. 0x04AF : 0x10004af,
  882. 0x04B0 : 0x10004b0,
  883. 0x04B1 : 0x10004b1,
  884. 0x04B2 : 0x10004b2,
  885. 0x04B3 : 0x10004b3,
  886. 0x04B6 : 0x10004b6,
  887. 0x04B7 : 0x10004b7,
  888. 0x04B8 : 0x10004b8,
  889. 0x04B9 : 0x10004b9,
  890. 0x04BA : 0x10004ba,
  891. 0x04BB : 0x10004bb,
  892. 0x04D8 : 0x10004d8,
  893. 0x04D9 : 0x10004d9,
  894. 0x04E2 : 0x10004e2,
  895. 0x04E3 : 0x10004e3,
  896. 0x04E8 : 0x10004e8,
  897. 0x04E9 : 0x10004e9,
  898. 0x04EE : 0x10004ee,
  899. 0x04EF : 0x10004ef,
  900. 0x0452 : 0x06a1,
  901. 0x0453 : 0x06a2,
  902. 0x0451 : 0x06a3,
  903. 0x0454 : 0x06a4,
  904. 0x0455 : 0x06a5,
  905. 0x0456 : 0x06a6,
  906. 0x0457 : 0x06a7,
  907. 0x0458 : 0x06a8,
  908. 0x0459 : 0x06a9,
  909. 0x045A : 0x06aa,
  910. 0x045B : 0x06ab,
  911. 0x045C : 0x06ac,
  912. 0x0491 : 0x06ad,
  913. 0x045E : 0x06ae,
  914. 0x045F : 0x06af,
  915. 0x2116 : 0x06b0,
  916. 0x0402 : 0x06b1,
  917. 0x0403 : 0x06b2,
  918. 0x0401 : 0x06b3,
  919. 0x0404 : 0x06b4,
  920. 0x0405 : 0x06b5,
  921. 0x0406 : 0x06b6,
  922. 0x0407 : 0x06b7,
  923. 0x0408 : 0x06b8,
  924. 0x0409 : 0x06b9,
  925. 0x040A : 0x06ba,
  926. 0x040B : 0x06bb,
  927. 0x040C : 0x06bc,
  928. 0x0490 : 0x06bd,
  929. 0x040E : 0x06be,
  930. 0x040F : 0x06bf,
  931. 0x044E : 0x06c0,
  932. 0x0430 : 0x06c1,
  933. 0x0431 : 0x06c2,
  934. 0x0446 : 0x06c3,
  935. 0x0434 : 0x06c4,
  936. 0x0435 : 0x06c5,
  937. 0x0444 : 0x06c6,
  938. 0x0433 : 0x06c7,
  939. 0x0445 : 0x06c8,
  940. 0x0438 : 0x06c9,
  941. 0x0439 : 0x06ca,
  942. 0x043A : 0x06cb,
  943. 0x043B : 0x06cc,
  944. 0x043C : 0x06cd,
  945. 0x043D : 0x06ce,
  946. 0x043E : 0x06cf,
  947. 0x043F : 0x06d0,
  948. 0x044F : 0x06d1,
  949. 0x0440 : 0x06d2,
  950. 0x0441 : 0x06d3,
  951. 0x0442 : 0x06d4,
  952. 0x0443 : 0x06d5,
  953. 0x0436 : 0x06d6,
  954. 0x0432 : 0x06d7,
  955. 0x044C : 0x06d8,
  956. 0x044B : 0x06d9,
  957. 0x0437 : 0x06da,
  958. 0x0448 : 0x06db,
  959. 0x044D : 0x06dc,
  960. 0x0449 : 0x06dd,
  961. 0x0447 : 0x06de,
  962. 0x044A : 0x06df,
  963. 0x042E : 0x06e0,
  964. 0x0410 : 0x06e1,
  965. 0x0411 : 0x06e2,
  966. 0x0426 : 0x06e3,
  967. 0x0414 : 0x06e4,
  968. 0x0415 : 0x06e5,
  969. 0x0424 : 0x06e6,
  970. 0x0413 : 0x06e7,
  971. 0x0425 : 0x06e8,
  972. 0x0418 : 0x06e9,
  973. 0x0419 : 0x06ea,
  974. 0x041A : 0x06eb,
  975. 0x041B : 0x06ec,
  976. 0x041C : 0x06ed,
  977. 0x041D : 0x06ee,
  978. 0x041E : 0x06ef,
  979. 0x041F : 0x06f0,
  980. 0x042F : 0x06f1,
  981. 0x0420 : 0x06f2,
  982. 0x0421 : 0x06f3,
  983. 0x0422 : 0x06f4,
  984. 0x0423 : 0x06f5,
  985. 0x0416 : 0x06f6,
  986. 0x0412 : 0x06f7,
  987. 0x042C : 0x06f8,
  988. 0x042B : 0x06f9,
  989. 0x0417 : 0x06fa,
  990. 0x0428 : 0x06fb,
  991. 0x042D : 0x06fc,
  992. 0x0429 : 0x06fd,
  993. 0x0427 : 0x06fe,
  994. 0x042A : 0x06ff,
  995. 0x0386 : 0x07a1,
  996. 0x0388 : 0x07a2,
  997. 0x0389 : 0x07a3,
  998. 0x038A : 0x07a4,
  999. 0x03AA : 0x07a5,
  1000. 0x038C : 0x07a7,
  1001. 0x038E : 0x07a8,
  1002. 0x03AB : 0x07a9,
  1003. 0x038F : 0x07ab,
  1004. 0x0385 : 0x07ae,
  1005. 0x2015 : 0x07af,
  1006. 0x03AC : 0x07b1,
  1007. 0x03AD : 0x07b2,
  1008. 0x03AE : 0x07b3,
  1009. 0x03AF : 0x07b4,
  1010. 0x03CA : 0x07b5,
  1011. 0x0390 : 0x07b6,
  1012. 0x03CC : 0x07b7,
  1013. 0x03CD : 0x07b8,
  1014. 0x03CB : 0x07b9,
  1015. 0x03B0 : 0x07ba,
  1016. 0x03CE : 0x07bb,
  1017. 0x0391 : 0x07c1,
  1018. 0x0392 : 0x07c2,
  1019. 0x0393 : 0x07c3,
  1020. 0x0394 : 0x07c4,
  1021. 0x0395 : 0x07c5,
  1022. 0x0396 : 0x07c6,
  1023. 0x0397 : 0x07c7,
  1024. 0x0398 : 0x07c8,
  1025. 0x0399 : 0x07c9,
  1026. 0x039A : 0x07ca,
  1027. 0x039B : 0x07cb,
  1028. 0x039C : 0x07cc,
  1029. 0x039D : 0x07cd,
  1030. 0x039E : 0x07ce,
  1031. 0x039F : 0x07cf,
  1032. 0x03A0 : 0x07d0,
  1033. 0x03A1 : 0x07d1,
  1034. 0x03A3 : 0x07d2,
  1035. 0x03A4 : 0x07d4,
  1036. 0x03A5 : 0x07d5,
  1037. 0x03A6 : 0x07d6,
  1038. 0x03A7 : 0x07d7,
  1039. 0x03A8 : 0x07d8,
  1040. 0x03A9 : 0x07d9,
  1041. 0x03B1 : 0x07e1,
  1042. 0x03B2 : 0x07e2,
  1043. 0x03B3 : 0x07e3,
  1044. 0x03B4 : 0x07e4,
  1045. 0x03B5 : 0x07e5,
  1046. 0x03B6 : 0x07e6,
  1047. 0x03B7 : 0x07e7,
  1048. 0x03B8 : 0x07e8,
  1049. 0x03B9 : 0x07e9,
  1050. 0x03BA : 0x07ea,
  1051. 0x03BB : 0x07eb,
  1052. 0x03BC : 0x07ec,
  1053. 0x03BD : 0x07ed,
  1054. 0x03BE : 0x07ee,
  1055. 0x03BF : 0x07ef,
  1056. 0x03C0 : 0x07f0,
  1057. 0x03C1 : 0x07f1,
  1058. 0x03C3 : 0x07f2,
  1059. 0x03C2 : 0x07f3,
  1060. 0x03C4 : 0x07f4,
  1061. 0x03C5 : 0x07f5,
  1062. 0x03C6 : 0x07f6,
  1063. 0x03C7 : 0x07f7,
  1064. 0x03C8 : 0x07f8,
  1065. 0x03C9 : 0x07f9,
  1066. 0x23B7 : 0x08a1,
  1067. 0x2320 : 0x08a4,
  1068. 0x2321 : 0x08a5,
  1069. 0x23A1 : 0x08a7,
  1070. 0x23A3 : 0x08a8,
  1071. 0x23A4 : 0x08a9,
  1072. 0x23A6 : 0x08aa,
  1073. 0x239B : 0x08ab,
  1074. 0x239D : 0x08ac,
  1075. 0x239E : 0x08ad,
  1076. 0x23A0 : 0x08ae,
  1077. 0x23A8 : 0x08af,
  1078. 0x23AC : 0x08b0,
  1079. 0x2264 : 0x08bc,
  1080. 0x2260 : 0x08bd,
  1081. 0x2265 : 0x08be,
  1082. 0x222B : 0x08bf,
  1083. 0x2234 : 0x08c0,
  1084. 0x221D : 0x08c1,
  1085. 0x221E : 0x08c2,
  1086. 0x2207 : 0x08c5,
  1087. 0x223C : 0x08c8,
  1088. 0x2243 : 0x08c9,
  1089. 0x21D4 : 0x08cd,
  1090. 0x21D2 : 0x08ce,
  1091. 0x2261 : 0x08cf,
  1092. //0x221A : 0x08d6,
  1093. 0x2282 : 0x08da,
  1094. 0x2283 : 0x08db,
  1095. 0x2229 : 0x08dc,
  1096. 0x222A : 0x08dd,
  1097. 0x2227 : 0x08de,
  1098. 0x2228 : 0x08df,
  1099. //0x2202 : 0x08ef,
  1100. 0x0192 : 0x08f6,
  1101. 0x2190 : 0x08fb,
  1102. 0x2191 : 0x08fc,
  1103. 0x2192 : 0x08fd,
  1104. 0x2193 : 0x08fe,
  1105. 0x25C6 : 0x09e0,
  1106. 0x2592 : 0x09e1,
  1107. 0x2409 : 0x09e2,
  1108. 0x240C : 0x09e3,
  1109. 0x240D : 0x09e4,
  1110. 0x240A : 0x09e5,
  1111. 0x2424 : 0x09e8,
  1112. 0x240B : 0x09e9,
  1113. 0x2518 : 0x09ea,
  1114. 0x2510 : 0x09eb,
  1115. 0x250C : 0x09ec,
  1116. 0x2514 : 0x09ed,
  1117. 0x253C : 0x09ee,
  1118. 0x23BA : 0x09ef,
  1119. 0x23BB : 0x09f0,
  1120. 0x2500 : 0x09f1,
  1121. 0x23BC : 0x09f2,
  1122. 0x23BD : 0x09f3,
  1123. 0x251C : 0x09f4,
  1124. 0x2524 : 0x09f5,
  1125. 0x2534 : 0x09f6,
  1126. 0x252C : 0x09f7,
  1127. 0x2502 : 0x09f8,
  1128. 0x2003 : 0x0aa1,
  1129. 0x2002 : 0x0aa2,
  1130. 0x2004 : 0x0aa3,
  1131. 0x2005 : 0x0aa4,
  1132. 0x2007 : 0x0aa5,
  1133. 0x2008 : 0x0aa6,
  1134. 0x2009 : 0x0aa7,
  1135. 0x200A : 0x0aa8,
  1136. 0x2014 : 0x0aa9,
  1137. 0x2013 : 0x0aaa,
  1138. 0x2026 : 0x0aae,
  1139. 0x2025 : 0x0aaf,
  1140. 0x2153 : 0x0ab0,
  1141. 0x2154 : 0x0ab1,
  1142. 0x2155 : 0x0ab2,
  1143. 0x2156 : 0x0ab3,
  1144. 0x2157 : 0x0ab4,
  1145. 0x2158 : 0x0ab5,
  1146. 0x2159 : 0x0ab6,
  1147. 0x215A : 0x0ab7,
  1148. 0x2105 : 0x0ab8,
  1149. 0x2012 : 0x0abb,
  1150. 0x215B : 0x0ac3,
  1151. 0x215C : 0x0ac4,
  1152. 0x215D : 0x0ac5,
  1153. 0x215E : 0x0ac6,
  1154. 0x2122 : 0x0ac9,
  1155. 0x2018 : 0x0ad0,
  1156. 0x2019 : 0x0ad1,
  1157. 0x201C : 0x0ad2,
  1158. 0x201D : 0x0ad3,
  1159. 0x211E : 0x0ad4,
  1160. 0x2032 : 0x0ad6,
  1161. 0x2033 : 0x0ad7,
  1162. 0x271D : 0x0ad9,
  1163. 0x2663 : 0x0aec,
  1164. 0x2666 : 0x0aed,
  1165. 0x2665 : 0x0aee,
  1166. 0x2720 : 0x0af0,
  1167. 0x2020 : 0x0af1,
  1168. 0x2021 : 0x0af2,
  1169. 0x2713 : 0x0af3,
  1170. 0x2717 : 0x0af4,
  1171. 0x266F : 0x0af5,
  1172. 0x266D : 0x0af6,
  1173. 0x2642 : 0x0af7,
  1174. 0x2640 : 0x0af8,
  1175. 0x260E : 0x0af9,
  1176. 0x2315 : 0x0afa,
  1177. 0x2117 : 0x0afb,
  1178. 0x2038 : 0x0afc,
  1179. 0x201A : 0x0afd,
  1180. 0x201E : 0x0afe,
  1181. 0x22A4 : 0x0bc2,
  1182. 0x230A : 0x0bc4,
  1183. 0x2218 : 0x0bca,
  1184. 0x2395 : 0x0bcc,
  1185. 0x22A5 : 0x0bce,
  1186. 0x25CB : 0x0bcf,
  1187. 0x2308 : 0x0bd3,
  1188. 0x22A3 : 0x0bdc,
  1189. 0x22A2 : 0x0bfc,
  1190. 0x2017 : 0x0cdf,
  1191. 0x05D0 : 0x0ce0,
  1192. 0x05D1 : 0x0ce1,
  1193. 0x05D2 : 0x0ce2,
  1194. 0x05D3 : 0x0ce3,
  1195. 0x05D4 : 0x0ce4,
  1196. 0x05D5 : 0x0ce5,
  1197. 0x05D6 : 0x0ce6,
  1198. 0x05D7 : 0x0ce7,
  1199. 0x05D8 : 0x0ce8,
  1200. 0x05D9 : 0x0ce9,
  1201. 0x05DA : 0x0cea,
  1202. 0x05DB : 0x0ceb,
  1203. 0x05DC : 0x0cec,
  1204. 0x05DD : 0x0ced,
  1205. 0x05DE : 0x0cee,
  1206. 0x05DF : 0x0cef,
  1207. 0x05E0 : 0x0cf0,
  1208. 0x05E1 : 0x0cf1,
  1209. 0x05E2 : 0x0cf2,
  1210. 0x05E3 : 0x0cf3,
  1211. 0x05E4 : 0x0cf4,
  1212. 0x05E5 : 0x0cf5,
  1213. 0x05E6 : 0x0cf6,
  1214. 0x05E7 : 0x0cf7,
  1215. 0x05E8 : 0x0cf8,
  1216. 0x05E9 : 0x0cf9,
  1217. 0x05EA : 0x0cfa,
  1218. 0x0E01 : 0x0da1,
  1219. 0x0E02 : 0x0da2,
  1220. 0x0E03 : 0x0da3,
  1221. 0x0E04 : 0x0da4,
  1222. 0x0E05 : 0x0da5,
  1223. 0x0E06 : 0x0da6,
  1224. 0x0E07 : 0x0da7,
  1225. 0x0E08 : 0x0da8,
  1226. 0x0E09 : 0x0da9,
  1227. 0x0E0A : 0x0daa,
  1228. 0x0E0B : 0x0dab,
  1229. 0x0E0C : 0x0dac,
  1230. 0x0E0D : 0x0dad,
  1231. 0x0E0E : 0x0dae,
  1232. 0x0E0F : 0x0daf,
  1233. 0x0E10 : 0x0db0,
  1234. 0x0E11 : 0x0db1,
  1235. 0x0E12 : 0x0db2,
  1236. 0x0E13 : 0x0db3,
  1237. 0x0E14 : 0x0db4,
  1238. 0x0E15 : 0x0db5,
  1239. 0x0E16 : 0x0db6,
  1240. 0x0E17 : 0x0db7,
  1241. 0x0E18 : 0x0db8,
  1242. 0x0E19 : 0x0db9,
  1243. 0x0E1A : 0x0dba,
  1244. 0x0E1B : 0x0dbb,
  1245. 0x0E1C : 0x0dbc,
  1246. 0x0E1D : 0x0dbd,
  1247. 0x0E1E : 0x0dbe,
  1248. 0x0E1F : 0x0dbf,
  1249. 0x0E20 : 0x0dc0,
  1250. 0x0E21 : 0x0dc1,
  1251. 0x0E22 : 0x0dc2,
  1252. 0x0E23 : 0x0dc3,
  1253. 0x0E24 : 0x0dc4,
  1254. 0x0E25 : 0x0dc5,
  1255. 0x0E26 : 0x0dc6,
  1256. 0x0E27 : 0x0dc7,
  1257. 0x0E28 : 0x0dc8,
  1258. 0x0E29 : 0x0dc9,
  1259. 0x0E2A : 0x0dca,
  1260. 0x0E2B : 0x0dcb,
  1261. 0x0E2C : 0x0dcc,
  1262. 0x0E2D : 0x0dcd,
  1263. 0x0E2E : 0x0dce,
  1264. 0x0E2F : 0x0dcf,
  1265. 0x0E30 : 0x0dd0,
  1266. 0x0E31 : 0x0dd1,
  1267. 0x0E32 : 0x0dd2,
  1268. 0x0E33 : 0x0dd3,
  1269. 0x0E34 : 0x0dd4,
  1270. 0x0E35 : 0x0dd5,
  1271. 0x0E36 : 0x0dd6,
  1272. 0x0E37 : 0x0dd7,
  1273. 0x0E38 : 0x0dd8,
  1274. 0x0E39 : 0x0dd9,
  1275. 0x0E3A : 0x0dda,
  1276. 0x0E3F : 0x0ddf,
  1277. 0x0E40 : 0x0de0,
  1278. 0x0E41 : 0x0de1,
  1279. 0x0E42 : 0x0de2,
  1280. 0x0E43 : 0x0de3,
  1281. 0x0E44 : 0x0de4,
  1282. 0x0E45 : 0x0de5,
  1283. 0x0E46 : 0x0de6,
  1284. 0x0E47 : 0x0de7,
  1285. 0x0E48 : 0x0de8,
  1286. 0x0E49 : 0x0de9,
  1287. 0x0E4A : 0x0dea,
  1288. 0x0E4B : 0x0deb,
  1289. 0x0E4C : 0x0dec,
  1290. 0x0E4D : 0x0ded,
  1291. 0x0E50 : 0x0df0,
  1292. 0x0E51 : 0x0df1,
  1293. 0x0E52 : 0x0df2,
  1294. 0x0E53 : 0x0df3,
  1295. 0x0E54 : 0x0df4,
  1296. 0x0E55 : 0x0df5,
  1297. 0x0E56 : 0x0df6,
  1298. 0x0E57 : 0x0df7,
  1299. 0x0E58 : 0x0df8,
  1300. 0x0E59 : 0x0df9,
  1301. 0x0587 : 0x1000587,
  1302. 0x0589 : 0x1000589,
  1303. 0x055D : 0x100055d,
  1304. 0x058A : 0x100058a,
  1305. 0x055C : 0x100055c,
  1306. 0x055B : 0x100055b,
  1307. 0x055E : 0x100055e,
  1308. 0x0531 : 0x1000531,
  1309. 0x0561 : 0x1000561,
  1310. 0x0532 : 0x1000532,
  1311. 0x0562 : 0x1000562,
  1312. 0x0533 : 0x1000533,
  1313. 0x0563 : 0x1000563,
  1314. 0x0534 : 0x1000534,
  1315. 0x0564 : 0x1000564,
  1316. 0x0535 : 0x1000535,
  1317. 0x0565 : 0x1000565,
  1318. 0x0536 : 0x1000536,
  1319. 0x0566 : 0x1000566,
  1320. 0x0537 : 0x1000537,
  1321. 0x0567 : 0x1000567,
  1322. 0x0538 : 0x1000538,
  1323. 0x0568 : 0x1000568,
  1324. 0x0539 : 0x1000539,
  1325. 0x0569 : 0x1000569,
  1326. 0x053A : 0x100053a,
  1327. 0x056A : 0x100056a,
  1328. 0x053B : 0x100053b,
  1329. 0x056B : 0x100056b,
  1330. 0x053C : 0x100053c,
  1331. 0x056C : 0x100056c,
  1332. 0x053D : 0x100053d,
  1333. 0x056D : 0x100056d,
  1334. 0x053E : 0x100053e,
  1335. 0x056E : 0x100056e,
  1336. 0x053F : 0x100053f,
  1337. 0x056F : 0x100056f,
  1338. 0x0540 : 0x1000540,
  1339. 0x0570 : 0x1000570,
  1340. 0x0541 : 0x1000541,
  1341. 0x0571 : 0x1000571,
  1342. 0x0542 : 0x1000542,
  1343. 0x0572 : 0x1000572,
  1344. 0x0543 : 0x1000543,
  1345. 0x0573 : 0x1000573,
  1346. 0x0544 : 0x1000544,
  1347. 0x0574 : 0x1000574,
  1348. 0x0545 : 0x1000545,
  1349. 0x0575 : 0x1000575,
  1350. 0x0546 : 0x1000546,
  1351. 0x0576 : 0x1000576,
  1352. 0x0547 : 0x1000547,
  1353. 0x0577 : 0x1000577,
  1354. 0x0548 : 0x1000548,
  1355. 0x0578 : 0x1000578,
  1356. 0x0549 : 0x1000549,
  1357. 0x0579 : 0x1000579,
  1358. 0x054A : 0x100054a,
  1359. 0x057A : 0x100057a,
  1360. 0x054B : 0x100054b,
  1361. 0x057B : 0x100057b,
  1362. 0x054C : 0x100054c,
  1363. 0x057C : 0x100057c,
  1364. 0x054D : 0x100054d,
  1365. 0x057D : 0x100057d,
  1366. 0x054E : 0x100054e,
  1367. 0x057E : 0x100057e,
  1368. 0x054F : 0x100054f,
  1369. 0x057F : 0x100057f,
  1370. 0x0550 : 0x1000550,
  1371. 0x0580 : 0x1000580,
  1372. 0x0551 : 0x1000551,
  1373. 0x0581 : 0x1000581,
  1374. 0x0552 : 0x1000552,
  1375. 0x0582 : 0x1000582,
  1376. 0x0553 : 0x1000553,
  1377. 0x0583 : 0x1000583,
  1378. 0x0554 : 0x1000554,
  1379. 0x0584 : 0x1000584,
  1380. 0x0555 : 0x1000555,
  1381. 0x0585 : 0x1000585,
  1382. 0x0556 : 0x1000556,
  1383. 0x0586 : 0x1000586,
  1384. 0x055A : 0x100055a,
  1385. 0x10D0 : 0x10010d0,
  1386. 0x10D1 : 0x10010d1,
  1387. 0x10D2 : 0x10010d2,
  1388. 0x10D3 : 0x10010d3,
  1389. 0x10D4 : 0x10010d4,
  1390. 0x10D5 : 0x10010d5,
  1391. 0x10D6 : 0x10010d6,
  1392. 0x10D7 : 0x10010d7,
  1393. 0x10D8 : 0x10010d8,
  1394. 0x10D9 : 0x10010d9,
  1395. 0x10DA : 0x10010da,
  1396. 0x10DB : 0x10010db,
  1397. 0x10DC : 0x10010dc,
  1398. 0x10DD : 0x10010dd,
  1399. 0x10DE : 0x10010de,
  1400. 0x10DF : 0x10010df,
  1401. 0x10E0 : 0x10010e0,
  1402. 0x10E1 : 0x10010e1,
  1403. 0x10E2 : 0x10010e2,
  1404. 0x10E3 : 0x10010e3,
  1405. 0x10E4 : 0x10010e4,
  1406. 0x10E5 : 0x10010e5,
  1407. 0x10E6 : 0x10010e6,
  1408. 0x10E7 : 0x10010e7,
  1409. 0x10E8 : 0x10010e8,
  1410. 0x10E9 : 0x10010e9,
  1411. 0x10EA : 0x10010ea,
  1412. 0x10EB : 0x10010eb,
  1413. 0x10EC : 0x10010ec,
  1414. 0x10ED : 0x10010ed,
  1415. 0x10EE : 0x10010ee,
  1416. 0x10EF : 0x10010ef,
  1417. 0x10F0 : 0x10010f0,
  1418. 0x10F1 : 0x10010f1,
  1419. 0x10F2 : 0x10010f2,
  1420. 0x10F3 : 0x10010f3,
  1421. 0x10F4 : 0x10010f4,
  1422. 0x10F5 : 0x10010f5,
  1423. 0x10F6 : 0x10010f6,
  1424. 0x1E8A : 0x1001e8a,
  1425. 0x012C : 0x100012c,
  1426. 0x01B5 : 0x10001b5,
  1427. 0x01E6 : 0x10001e6,
  1428. 0x01D2 : 0x10001d1,
  1429. 0x019F : 0x100019f,
  1430. 0x1E8B : 0x1001e8b,
  1431. 0x012D : 0x100012d,
  1432. 0x01B6 : 0x10001b6,
  1433. 0x01E7 : 0x10001e7,
  1434. //0x01D2 : 0x10001d2,
  1435. 0x0275 : 0x1000275,
  1436. 0x018F : 0x100018f,
  1437. 0x0259 : 0x1000259,
  1438. 0x1E36 : 0x1001e36,
  1439. 0x1E37 : 0x1001e37,
  1440. 0x1EA0 : 0x1001ea0,
  1441. 0x1EA1 : 0x1001ea1,
  1442. 0x1EA2 : 0x1001ea2,
  1443. 0x1EA3 : 0x1001ea3,
  1444. 0x1EA4 : 0x1001ea4,
  1445. 0x1EA5 : 0x1001ea5,
  1446. 0x1EA6 : 0x1001ea6,
  1447. 0x1EA7 : 0x1001ea7,
  1448. 0x1EA8 : 0x1001ea8,
  1449. 0x1EA9 : 0x1001ea9,
  1450. 0x1EAA : 0x1001eaa,
  1451. 0x1EAB : 0x1001eab,
  1452. 0x1EAC : 0x1001eac,
  1453. 0x1EAD : 0x1001ead,
  1454. 0x1EAE : 0x1001eae,
  1455. 0x1EAF : 0x1001eaf,
  1456. 0x1EB0 : 0x1001eb0,
  1457. 0x1EB1 : 0x1001eb1,
  1458. 0x1EB2 : 0x1001eb2,
  1459. 0x1EB3 : 0x1001eb3,
  1460. 0x1EB4 : 0x1001eb4,
  1461. 0x1EB5 : 0x1001eb5,
  1462. 0x1EB6 : 0x1001eb6,
  1463. 0x1EB7 : 0x1001eb7,
  1464. 0x1EB8 : 0x1001eb8,
  1465. 0x1EB9 : 0x1001eb9,
  1466. 0x1EBA : 0x1001eba,
  1467. 0x1EBB : 0x1001ebb,
  1468. 0x1EBC : 0x1001ebc,
  1469. 0x1EBD : 0x1001ebd,
  1470. 0x1EBE : 0x1001ebe,
  1471. 0x1EBF : 0x1001ebf,
  1472. 0x1EC0 : 0x1001ec0,
  1473. 0x1EC1 : 0x1001ec1,
  1474. 0x1EC2 : 0x1001ec2,
  1475. 0x1EC3 : 0x1001ec3,
  1476. 0x1EC4 : 0x1001ec4,
  1477. 0x1EC5 : 0x1001ec5,
  1478. 0x1EC6 : 0x1001ec6,
  1479. 0x1EC7 : 0x1001ec7,
  1480. 0x1EC8 : 0x1001ec8,
  1481. 0x1EC9 : 0x1001ec9,
  1482. 0x1ECA : 0x1001eca,
  1483. 0x1ECB : 0x1001ecb,
  1484. 0x1ECC : 0x1001ecc,
  1485. 0x1ECD : 0x1001ecd,
  1486. 0x1ECE : 0x1001ece,
  1487. 0x1ECF : 0x1001ecf,
  1488. 0x1ED0 : 0x1001ed0,
  1489. 0x1ED1 : 0x1001ed1,
  1490. 0x1ED2 : 0x1001ed2,
  1491. 0x1ED3 : 0x1001ed3,
  1492. 0x1ED4 : 0x1001ed4,
  1493. 0x1ED5 : 0x1001ed5,
  1494. 0x1ED6 : 0x1001ed6,
  1495. 0x1ED7 : 0x1001ed7,
  1496. 0x1ED8 : 0x1001ed8,
  1497. 0x1ED9 : 0x1001ed9,
  1498. 0x1EDA : 0x1001eda,
  1499. 0x1EDB : 0x1001edb,
  1500. 0x1EDC : 0x1001edc,
  1501. 0x1EDD : 0x1001edd,
  1502. 0x1EDE : 0x1001ede,
  1503. 0x1EDF : 0x1001edf,
  1504. 0x1EE0 : 0x1001ee0,
  1505. 0x1EE1 : 0x1001ee1,
  1506. 0x1EE2 : 0x1001ee2,
  1507. 0x1EE3 : 0x1001ee3,
  1508. 0x1EE4 : 0x1001ee4,
  1509. 0x1EE5 : 0x1001ee5,
  1510. 0x1EE6 : 0x1001ee6,
  1511. 0x1EE7 : 0x1001ee7,
  1512. 0x1EE8 : 0x1001ee8,
  1513. 0x1EE9 : 0x1001ee9,
  1514. 0x1EEA : 0x1001eea,
  1515. 0x1EEB : 0x1001eeb,
  1516. 0x1EEC : 0x1001eec,
  1517. 0x1EED : 0x1001eed,
  1518. 0x1EEE : 0x1001eee,
  1519. 0x1EEF : 0x1001eef,
  1520. 0x1EF0 : 0x1001ef0,
  1521. 0x1EF1 : 0x1001ef1,
  1522. 0x1EF4 : 0x1001ef4,
  1523. 0x1EF5 : 0x1001ef5,
  1524. 0x1EF6 : 0x1001ef6,
  1525. 0x1EF7 : 0x1001ef7,
  1526. 0x1EF8 : 0x1001ef8,
  1527. 0x1EF9 : 0x1001ef9,
  1528. 0x01A0 : 0x10001a0,
  1529. 0x01A1 : 0x10001a1,
  1530. 0x01AF : 0x10001af,
  1531. 0x01B0 : 0x10001b0,
  1532. 0x20A0 : 0x10020a0,
  1533. 0x20A1 : 0x10020a1,
  1534. 0x20A2 : 0x10020a2,
  1535. 0x20A3 : 0x10020a3,
  1536. 0x20A4 : 0x10020a4,
  1537. 0x20A5 : 0x10020a5,
  1538. 0x20A6 : 0x10020a6,
  1539. 0x20A7 : 0x10020a7,
  1540. 0x20A8 : 0x10020a8,
  1541. 0x20A9 : 0x10020a9,
  1542. 0x20AA : 0x10020aa,
  1543. 0x20AB : 0x10020ab,
  1544. 0x20AC : 0x20ac,
  1545. 0x2070 : 0x1002070,
  1546. 0x2074 : 0x1002074,
  1547. 0x2075 : 0x1002075,
  1548. 0x2076 : 0x1002076,
  1549. 0x2077 : 0x1002077,
  1550. 0x2078 : 0x1002078,
  1551. 0x2079 : 0x1002079,
  1552. 0x2080 : 0x1002080,
  1553. 0x2081 : 0x1002081,
  1554. 0x2082 : 0x1002082,
  1555. 0x2083 : 0x1002083,
  1556. 0x2084 : 0x1002084,
  1557. 0x2085 : 0x1002085,
  1558. 0x2086 : 0x1002086,
  1559. 0x2087 : 0x1002087,
  1560. 0x2088 : 0x1002088,
  1561. 0x2089 : 0x1002089,
  1562. 0x2202 : 0x1002202,
  1563. 0x2205 : 0x1002205,
  1564. 0x2208 : 0x1002208,
  1565. 0x2209 : 0x1002209,
  1566. 0x220B : 0x100220B,
  1567. 0x221A : 0x100221A,
  1568. 0x221B : 0x100221B,
  1569. 0x221C : 0x100221C,
  1570. 0x222C : 0x100222C,
  1571. 0x222D : 0x100222D,
  1572. 0x2235 : 0x1002235,
  1573. 0x2245 : 0x1002248,
  1574. 0x2247 : 0x1002247,
  1575. 0x2262 : 0x1002262,
  1576. 0x2263 : 0x1002263,
  1577. 0x2800 : 0x1002800,
  1578. 0x2801 : 0x1002801,
  1579. 0x2802 : 0x1002802,
  1580. 0x2803 : 0x1002803,
  1581. 0x2804 : 0x1002804,
  1582. 0x2805 : 0x1002805,
  1583. 0x2806 : 0x1002806,
  1584. 0x2807 : 0x1002807,
  1585. 0x2808 : 0x1002808,
  1586. 0x2809 : 0x1002809,
  1587. 0x280a : 0x100280a,
  1588. 0x280b : 0x100280b,
  1589. 0x280c : 0x100280c,
  1590. 0x280d : 0x100280d,
  1591. 0x280e : 0x100280e,
  1592. 0x280f : 0x100280f,
  1593. 0x2810 : 0x1002810,
  1594. 0x2811 : 0x1002811,
  1595. 0x2812 : 0x1002812,
  1596. 0x2813 : 0x1002813,
  1597. 0x2814 : 0x1002814,
  1598. 0x2815 : 0x1002815,
  1599. 0x2816 : 0x1002816,
  1600. 0x2817 : 0x1002817,
  1601. 0x2818 : 0x1002818,
  1602. 0x2819 : 0x1002819,
  1603. 0x281a : 0x100281a,
  1604. 0x281b : 0x100281b,
  1605. 0x281c : 0x100281c,
  1606. 0x281d : 0x100281d,
  1607. 0x281e : 0x100281e,
  1608. 0x281f : 0x100281f,
  1609. 0x2820 : 0x1002820,
  1610. 0x2821 : 0x1002821,
  1611. 0x2822 : 0x1002822,
  1612. 0x2823 : 0x1002823,
  1613. 0x2824 : 0x1002824,
  1614. 0x2825 : 0x1002825,
  1615. 0x2826 : 0x1002826,
  1616. 0x2827 : 0x1002827,
  1617. 0x2828 : 0x1002828,
  1618. 0x2829 : 0x1002829,
  1619. 0x282a : 0x100282a,
  1620. 0x282b : 0x100282b,
  1621. 0x282c : 0x100282c,
  1622. 0x282d : 0x100282d,
  1623. 0x282e : 0x100282e,
  1624. 0x282f : 0x100282f,
  1625. 0x2830 : 0x1002830,
  1626. 0x2831 : 0x1002831,
  1627. 0x2832 : 0x1002832,
  1628. 0x2833 : 0x1002833,
  1629. 0x2834 : 0x1002834,
  1630. 0x2835 : 0x1002835,
  1631. 0x2836 : 0x1002836,
  1632. 0x2837 : 0x1002837,
  1633. 0x2838 : 0x1002838,
  1634. 0x2839 : 0x1002839,
  1635. 0x283a : 0x100283a,
  1636. 0x283b : 0x100283b,
  1637. 0x283c : 0x100283c,
  1638. 0x283d : 0x100283d,
  1639. 0x283e : 0x100283e,
  1640. 0x283f : 0x100283f,
  1641. 0x2840 : 0x1002840,
  1642. 0x2841 : 0x1002841,
  1643. 0x2842 : 0x1002842,
  1644. 0x2843 : 0x1002843,
  1645. 0x2844 : 0x1002844,
  1646. 0x2845 : 0x1002845,
  1647. 0x2846 : 0x1002846,
  1648. 0x2847 : 0x1002847,
  1649. 0x2848 : 0x1002848,
  1650. 0x2849 : 0x1002849,
  1651. 0x284a : 0x100284a,
  1652. 0x284b : 0x100284b,
  1653. 0x284c : 0x100284c,
  1654. 0x284d : 0x100284d,
  1655. 0x284e : 0x100284e,
  1656. 0x284f : 0x100284f,
  1657. 0x2850 : 0x1002850,
  1658. 0x2851 : 0x1002851,
  1659. 0x2852 : 0x1002852,
  1660. 0x2853 : 0x1002853,
  1661. 0x2854 : 0x1002854,
  1662. 0x2855 : 0x1002855,
  1663. 0x2856 : 0x1002856,
  1664. 0x2857 : 0x1002857,
  1665. 0x2858 : 0x1002858,
  1666. 0x2859 : 0x1002859,
  1667. 0x285a : 0x100285a,
  1668. 0x285b : 0x100285b,
  1669. 0x285c : 0x100285c,
  1670. 0x285d : 0x100285d,
  1671. 0x285e : 0x100285e,
  1672. 0x285f : 0x100285f,
  1673. 0x2860 : 0x1002860,
  1674. 0x2861 : 0x1002861,
  1675. 0x2862 : 0x1002862,
  1676. 0x2863 : 0x1002863,
  1677. 0x2864 : 0x1002864,
  1678. 0x2865 : 0x1002865,
  1679. 0x2866 : 0x1002866,
  1680. 0x2867 : 0x1002867,
  1681. 0x2868 : 0x1002868,
  1682. 0x2869 : 0x1002869,
  1683. 0x286a : 0x100286a,
  1684. 0x286b : 0x100286b,
  1685. 0x286c : 0x100286c,
  1686. 0x286d : 0x100286d,
  1687. 0x286e : 0x100286e,
  1688. 0x286f : 0x100286f,
  1689. 0x2870 : 0x1002870,
  1690. 0x2871 : 0x1002871,
  1691. 0x2872 : 0x1002872,
  1692. 0x2873 : 0x1002873,
  1693. 0x2874 : 0x1002874,
  1694. 0x2875 : 0x1002875,
  1695. 0x2876 : 0x1002876,
  1696. 0x2877 : 0x1002877,
  1697. 0x2878 : 0x1002878,
  1698. 0x2879 : 0x1002879,
  1699. 0x287a : 0x100287a,
  1700. 0x287b : 0x100287b,
  1701. 0x287c : 0x100287c,
  1702. 0x287d : 0x100287d,
  1703. 0x287e : 0x100287e,
  1704. 0x287f : 0x100287f,
  1705. 0x2880 : 0x1002880,
  1706. 0x2881 : 0x1002881,
  1707. 0x2882 : 0x1002882,
  1708. 0x2883 : 0x1002883,
  1709. 0x2884 : 0x1002884,
  1710. 0x2885 : 0x1002885,
  1711. 0x2886 : 0x1002886,
  1712. 0x2887 : 0x1002887,
  1713. 0x2888 : 0x1002888,
  1714. 0x2889 : 0x1002889,
  1715. 0x288a : 0x100288a,
  1716. 0x288b : 0x100288b,
  1717. 0x288c : 0x100288c,
  1718. 0x288d : 0x100288d,
  1719. 0x288e : 0x100288e,
  1720. 0x288f : 0x100288f,
  1721. 0x2890 : 0x1002890,
  1722. 0x2891 : 0x1002891,
  1723. 0x2892 : 0x1002892,
  1724. 0x2893 : 0x1002893,
  1725. 0x2894 : 0x1002894,
  1726. 0x2895 : 0x1002895,
  1727. 0x2896 : 0x1002896,
  1728. 0x2897 : 0x1002897,
  1729. 0x2898 : 0x1002898,
  1730. 0x2899 : 0x1002899,
  1731. 0x289a : 0x100289a,
  1732. 0x289b : 0x100289b,
  1733. 0x289c : 0x100289c,
  1734. 0x289d : 0x100289d,
  1735. 0x289e : 0x100289e,
  1736. 0x289f : 0x100289f,
  1737. 0x28a0 : 0x10028a0,
  1738. 0x28a1 : 0x10028a1,
  1739. 0x28a2 : 0x10028a2,
  1740. 0x28a3 : 0x10028a3,
  1741. 0x28a4 : 0x10028a4,
  1742. 0x28a5 : 0x10028a5,
  1743. 0x28a6 : 0x10028a6,
  1744. 0x28a7 : 0x10028a7,
  1745. 0x28a8 : 0x10028a8,
  1746. 0x28a9 : 0x10028a9,
  1747. 0x28aa : 0x10028aa,
  1748. 0x28ab : 0x10028ab,
  1749. 0x28ac : 0x10028ac,
  1750. 0x28ad : 0x10028ad,
  1751. 0x28ae : 0x10028ae,
  1752. 0x28af : 0x10028af,
  1753. 0x28b0 : 0x10028b0,
  1754. 0x28b1 : 0x10028b1,
  1755. 0x28b2 : 0x10028b2,
  1756. 0x28b3 : 0x10028b3,
  1757. 0x28b4 : 0x10028b4,
  1758. 0x28b5 : 0x10028b5,
  1759. 0x28b6 : 0x10028b6,
  1760. 0x28b7 : 0x10028b7,
  1761. 0x28b8 : 0x10028b8,
  1762. 0x28b9 : 0x10028b9,
  1763. 0x28ba : 0x10028ba,
  1764. 0x28bb : 0x10028bb,
  1765. 0x28bc : 0x10028bc,
  1766. 0x28bd : 0x10028bd,
  1767. 0x28be : 0x10028be,
  1768. 0x28bf : 0x10028bf,
  1769. 0x28c0 : 0x10028c0,
  1770. 0x28c1 : 0x10028c1,
  1771. 0x28c2 : 0x10028c2,
  1772. 0x28c3 : 0x10028c3,
  1773. 0x28c4 : 0x10028c4,
  1774. 0x28c5 : 0x10028c5,
  1775. 0x28c6 : 0x10028c6,
  1776. 0x28c7 : 0x10028c7,
  1777. 0x28c8 : 0x10028c8,
  1778. 0x28c9 : 0x10028c9,
  1779. 0x28ca : 0x10028ca,
  1780. 0x28cb : 0x10028cb,
  1781. 0x28cc : 0x10028cc,
  1782. 0x28cd : 0x10028cd,
  1783. 0x28ce : 0x10028ce,
  1784. 0x28cf : 0x10028cf,
  1785. 0x28d0 : 0x10028d0,
  1786. 0x28d1 : 0x10028d1,
  1787. 0x28d2 : 0x10028d2,
  1788. 0x28d3 : 0x10028d3,
  1789. 0x28d4 : 0x10028d4,
  1790. 0x28d5 : 0x10028d5,
  1791. 0x28d6 : 0x10028d6,
  1792. 0x28d7 : 0x10028d7,
  1793. 0x28d8 : 0x10028d8,
  1794. 0x28d9 : 0x10028d9,
  1795. 0x28da : 0x10028da,
  1796. 0x28db : 0x10028db,
  1797. 0x28dc : 0x10028dc,
  1798. 0x28dd : 0x10028dd,
  1799. 0x28de : 0x10028de,
  1800. 0x28df : 0x10028df,
  1801. 0x28e0 : 0x10028e0,
  1802. 0x28e1 : 0x10028e1,
  1803. 0x28e2 : 0x10028e2,
  1804. 0x28e3 : 0x10028e3,
  1805. 0x28e4 : 0x10028e4,
  1806. 0x28e5 : 0x10028e5,
  1807. 0x28e6 : 0x10028e6,
  1808. 0x28e7 : 0x10028e7,
  1809. 0x28e8 : 0x10028e8,
  1810. 0x28e9 : 0x10028e9,
  1811. 0x28ea : 0x10028ea,
  1812. 0x28eb : 0x10028eb,
  1813. 0x28ec : 0x10028ec,
  1814. 0x28ed : 0x10028ed,
  1815. 0x28ee : 0x10028ee,
  1816. 0x28ef : 0x10028ef,
  1817. 0x28f0 : 0x10028f0,
  1818. 0x28f1 : 0x10028f1,
  1819. 0x28f2 : 0x10028f2,
  1820. 0x28f3 : 0x10028f3,
  1821. 0x28f4 : 0x10028f4,
  1822. 0x28f5 : 0x10028f5,
  1823. 0x28f6 : 0x10028f6,
  1824. 0x28f7 : 0x10028f7,
  1825. 0x28f8 : 0x10028f8,
  1826. 0x28f9 : 0x10028f9,
  1827. 0x28fa : 0x10028fa,
  1828. 0x28fb : 0x10028fb,
  1829. 0x28fc : 0x10028fc,
  1830. 0x28fd : 0x10028fd,
  1831. 0x28fe : 0x10028fe,
  1832. 0x28ff : 0x10028ff
  1833. };