input.js 50 KB

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