Subversion Repositories wimsdev

Rev

Rev 1013 | Rev 3131 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1013 bpr 1
/* ********************************************************************
2
 **********************************************************************
1220 bpr 3
 * HTML Virtual Keyboard Interface Script - v1.26
1013 bpr 4
 *   Copyright (c) 2009 - GreyWyvern
5
 *
6
 *  - Licenced for free distribution under the BSDL
7
 *          http://www.opensource.org/licenses/bsd-license.php
8
 *
9
 * Add a script-driven keyboard interface to text fields, password
10
 * fields and textareas.
11
 *
12
 * See http://www.greywyvern.com/code/javascript/keyboard for examples
13
 * and usage instructions.
14
 *
1220 bpr 15
 * Version 1.26 - June 5, 2009
16
 *   - Slovak keyboard layout added
1013 bpr 17
 *
18
 *   See full changelog at:
19
 *     http://www.greywyvern.com/code/javascript/keyboard.changelog.txt
20
 *
21
 * Keyboard Credits
1220 bpr 22
 *   - Slovak keyboard layout by Daniel Lara (www.learningslovak.com)
23
 *   - Belarusian, Serbian Cyrillic and Serbian Latin keyboard layouts by Evgeniy Titov
24
 *   - Bulgarian Phonetic keyboard layout by Samuil Gospodinov
1013 bpr 25
 *   - Swedish keyboard layout by Håkan Sandberg
26
 *   - Romanian keyboard layout by Aurel
27
 *   - Farsi (Persian) keyboard layout by Kaveh Bakhtiyari (www.bakhtiyari.com)
28
 *   - Burmese keyboard layout by Cetanapa
29
 *   - Slovenian keyboard layout by Miran Zeljko
30
 *   - Hungarian keyboard layout by Antal Sall 'Hiromacu'
31
 *   - Arabic keyboard layout by Srinivas Reddy
32
 *   - Italian and Spanish (Spain) keyboard layouts by dictionarist.com
33
 *   - Lithuanian and Russian keyboard layouts by Ramunas
34
 *   - German keyboard layout by QuHno
35
 *   - French keyboard layout by Hidden Evil
36
 *   - Polish Programmers layout by moose
37
 *   - Turkish keyboard layouts by offcu
38
 *   - Dutch and US Int'l keyboard layouts by jerone
39
 *   - Portuguese keyboard layout by clisboa
40
 *
41
 */
42
var VKI_attach, VKI_close;
43
  function VKI_buildKeyboardInputs() {
44
    var self = this;
45
 
1220 bpr 46
    this.VKI_version = "1.26";
1013 bpr 47
    this.VKI_target = this.VKI_visible = false;
48
    this.VKI_shift = this.VKI_capslock = this.VKI_alternate = this.VKI_dead = false;
49
    this.VKI_deadkeysOn = false;
50
    this.VKI_kt = "French";  // Default keyboard layout
51
    this.VKI_clearPasswords = false;  // Clear password fields on focus
52
    this.VKI_showVersion = true;
1220 bpr 53
    this.VKI_imageURI = "keyboard.png";
1013 bpr 54
    this.VKI_clickless = false;
55
    this.VKI_clicklessDelay = 500;
56
    this.VKI_keyCenter = 3;
57
 
58
    this.VKI_isIE = /*@cc_on!@*/false;
59
    this.VKI_isIE6 = /*@if(@_jscript_version == 5.6)!@end@*/false;
60
    this.VKI_isIElt8 = /*@if(@_jscript_version < 5.8)!@end@*/false;
61
    this.VKI_isMoz = (navigator.product == "Gecko");
62
    this.VKI_isWebKit = RegExp("KHTML").test(navigator.userAgent);
63
 
64
 
65
    /* ***** Create keyboards ************************************** */
66
    this.VKI_layout = {};
67
    this.VKI_layoutDDK = {};
68
 
69
    // - Lay out each keyboard in rows of sub-arrays.  Each sub-array
70
    //   represents one key.
1220 bpr 71
    //
1013 bpr 72
    // - Each sub-array consists of four slots described as follows:
73
    //     example: ["a", "A", "\u00e1", "\u00c1"]
74
    //
75
    //          a) Normal character
76
    //          A) Character + Shift or Caps
77
    //     \u00e1) Character + Alt or AltGr
78
    //     \u00c1) Character + Shift or Caps + Alt or AltGr
79
    //
80
    //   You may include sub-arrays which are fewer than four slots.
81
    //   In these cases, the missing slots will be blanked when the
82
    //   corresponding modifier key (Shift or AltGr) is pressed.
83
    //
84
    // - If the second slot of a sub-array matches one of the following
85
    //   strings:
86
    //       "Tab", "Caps", "Shift", "Enter", "Bksp", "Alt" OR "AltGr"
87
    //   then the function of the key will be the following,
88
    //   respectively:
89
    //     - Insert a tab
90
    //     - Toggle Caps Lock (technically a Shift Lock)
91
    //     - Next entered character will be the shifted character
92
    //     - Insert a newline (textarea), or close the keyboard
93
    //     - Delete the previous character
94
    //     - Next entered character will be the alternate character
95
    //
96
    //   The first slot of this sub-array will be the text to display
97
    //   on the corresponding key.  This allows for easy localisation
98
    //   of key names.
99
    //
100
    // - Layout dead keys (diacritic + letter) should be added as
101
    //   arrays of two item arrays with hash keys equal to the
102
    //   diacritic.  See the "this.VKI_deadkey" object below the layout
103
    //   definitions.  In  each two item child array, the second item
104
    //   is what the diacritic would change the first item to.
105
    //
106
    // - To disable dead keys for a layout, simply assign true to the
107
    //   this.VKI_layoutDDK (DDK = disable dead keys) object of the
108
    //   same name as the layout.  See the Numpad layout below for an
109
    //   example.
110
    //
111
    // - Note that any characters beyond the normal ASCII set should be
112
    //   entered in escaped Unicode format.  (eg \u00a3 = Pound symbol)
113
    //   You can find Unicode values for characters here:
114
    //     http://unicode.org/charts/
115
    //
116
    // - To remove a keyboard, just delete it, or comment it out of the
117
    //   source code
118
 
119
    this.VKI_layout.Arabic = [ // Arabic Keyboard
120
      [["\u0630", "\u0651 "], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]],
121
      [["Tab", "Tab"], ["\u0636", "\u064e"], ["\u0635", "\u064b"], ["\u062b", "\u064f"], ["\u0642", "\u064c"], ["\u0641", "\u0644"], ["\u063a", "\u0625"], ["\u0639", "\u2018"], ["\u0647", "\u00f7"], ["\u062e", "\u00d7"], ["\u062d", "\u061b"], ["\u062c", "\u003c"], ["\u062f", "\u003e"], ["\u005c", "\u007c"]],
122
      [["Caps", "Caps"], ["\u0634", "\u0650"], ["\u0633", "\u064d"], ["\u064a", "\u005d"], ["\u0628", "\u005b"], ["\u0644", "\u0644"], ["\u0627", "\u0623"], ["\u062a", "\u0640"], ["\u0646", "\u060c"], ["\u0645", "\u002f"], ["\u0643", "\u003a"], ["\u0637", "\u0022"], ["Enter", "Enter"]],
123
      [["Shift", "Shift"], ["\u0626", "\u007e"], ["\u0621", "\u0652"], ["\u0624", "\u007d"], ["\u0631", "\u007b"], ["\u0644", "\u0644"], ["\u0649", "\u0622"], ["\u0629", "\u2019"], ["\u0648", "\u002c"], ["\u0632", "\u002e"], ["\u0638", "\u061f"], ["Shift", "Shift"]],
124
      [[" ", " ", " ", " "], ["Alt", "Alt"]]
125
    ];
126
 
1220 bpr 127
    this.VKI_layout.Belarusian = [ // Belarusian Standard Keyboard
128
      [["\u0451", "\u0401"], ["1", "!"], ["2", '"'], ["3", "\u2116"], ["4", ";"], ["5", "%"], ["6", ":"], ["7", "?"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]],
129
      [["Tab", "Tab"], ["\u0439", "\u0419"], ["\u0446", "\u0426"], ["\u0443", "\u0423"], ["\u043a", "\u041a"], ["\u0435", "\u0415"], ["\u043d", "\u041d"], ["\u0433", "\u0413"], ["\u0448", "\u0428"], ["\u045e", "\u040e"], ["\u0437", "\u0417"], ["\u0445", "\u0425"], ["'", "'"], ["\\", "/"]],
130
      [["Caps", "Caps"], ["\u0444", "\u0424"], ["\u044b", "\u042b"], ["\u0432", "\u0412"], ["\u0430", "\u0410"], ["\u043f", "\u041f"], ["\u0440", "\u0420"], ["\u043e", "\u041e"], ["\u043b", "\u041b"], ["\u0434", "\u0414"], ["\u0436", "\u0416"], ["\u044d", "\u042d"], ["Enter", "Enter"]],
131
      [["Shift", "Shift"], ["/", "|"], ["\u044f", "\u042f"], ["\u0447", "\u0427"], ["\u0441", "\u0421"], ["\u043c", "\u041c"], ["\u0456", "\u0406"], ["\u0442", "\u0422"], ["\u044c", "\u042c"], ["\u0431", "\u0411"], ["\u044e", "\u042e"], [".", ","], ["Shift", "Shift"]],
132
      [[" ", " "]]
133
    ];
134
 
1013 bpr 135
    this.VKI_layout.Belgian = [ // Belgian Standard Keyboard
136
      [["\u00b2", "\u00b3"], ["&", "1", "|"], ["\u00e9", "2", "@"], ['"', "3", "#"], ["'", "4"], ["(", "5"], ["\u00a7", "6", "^"], ["\u00e8", "7"], ["!", "8"], ["\u00e7", "9", "{"], ["\u00e0", "0", "}"], [")", "\u00b0"], ["-", "_"], ["Bksp", "Bksp"]],
137
      [["Tab", "Tab"], ["a", "A"], ["z", "Z"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u005e", "\u00a8", "["], ["$", "*", "]"], ["Enter", "Enter"]],
138
      [["Caps", "Caps"], ["q", "Q"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["m", "M"], ["\u00f9", "%", "\u00b4"], ["\u03bc", "\u00a3", "`"]],
139
      [["Shift", "Shift"], ["<", ">", "\\"], ["w", "W"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], [",", "?"], [";", "."], [":", "/"], ["=", "+", "~"], ["Shift", "Shift"]],
140
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
141
    ];
142
 
1220 bpr 143
    this.VKI_layout['Bulgarian Ph'] = [ // Bulgarian Phonetic Keyboard
144
      [["\u0447", "\u0427"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]],
145
      [["Tab", "Tab"], ["\u044F", "\u042F"], ["\u0432", "\u0412"], ["\u0435", "\u0415"], ["\u0440", "\u0420"], ["\u0442", "\u0422"], ["\u044A", "\u042A"], ["\u0443", "\u0423"], ["\u0438", "\u0418"], ["\u043E", "\u041E"], ["\u043F", "\u041F"], ["\u0448", "\u0428"], ["\u0449", "\u0429"], ["\u044E", "\u042E"]],
146
      [["Caps", "Caps"], ["\u0430", "\u0410"], ["\u0441", "\u0421"], ["\u0434", "\u0414"], ["\u0444", "\u0424"], ["\u0433", "\u0413"], ["\u0445", "\u0425"], ["\u0439", "\u0419"], ["\u043A", "\u041A"], ["\u043B", "\u041B"], [";", ":"], ["'", '"'], ["Enter", "Enter"]],
147
      [["Shift", "Shift"], ["\u0437", "\u0417"], ["\u044C", "\u042C"], ["\u0446", "\u0426"], ["\u0436", "\u0416"], ["\u0431", "\u0411"], ["\u043D", "\u041D"], ["\u043C", "\u041C"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]],
148
      [[" ", " "]]
149
    ];
150
 
1013 bpr 151
    this.VKI_layout.Burmese = [ // Burmese Keyboard
152
      [["\u1039`", "~"], ["\u1041", "\u100D"], ["\u1042", "\u100E"], ["\u1043", "\u100B"], ["\u1044", "\u1000\u103B\u1015\u103A"], ["\u1045", "%"], ["\u1046", "\u002F"], ["\u1047", "\u101B"], ["\u1048", "\u1002"], ["\u1049", "("], ["\u1040", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]],
153
      [["Tab", "Tab"], ["\u1006", "\u1029"], ["\u1010", "\u1040"], ["\u1014", "\u103F"], ["\u1019", "\u1023"], ["\u1021", "\u1024"], ["\u1015", "\u104C"], ["\u1000", "\u1009"], ["\u1004", "\u104D"], ["\u101E", "\u1025"], ["\u1005", "\u100F"], ["\u101F", "\u1027"], ["\u2018", "\u2019"], ["\u104F", "\u100B\u1039\u100C"]],
154
      [["Caps", "Caps"], ["\u200B\u1031", "\u1017"], ["\u200B\u103B", "\u200B\u103E"], ["\u200B\u102D", "\u200B\u102E"], ["\u200B\u103A","\u1004\u103A\u1039\u200B"], ["\u200B\u102B", "\u200B\u103D"], ["\u200B\u1037", "\u200B\u1036"], ["\u200B\u103C", "\u200B\u1032"], ["\u200B\u102F", "\u200B\u102F"], ["\u200B\u1030", "\u200B\u1030"], ["\u200B\u1038", "\u200B\u102B\u103A"], ["\u1012", "\u1013"], ["Enter", "Enter"]],
155
      [["Shift", "Shift"], ["\u1016", "\u1007"], ["\u1011", "\u100C"], ["\u1001", "\u1003"], ["\u101C", "\u1020"], ["\u1018", "\u1026"], ["\u100A", "\u1008"], ["\u200B\u102C", "\u102A"], ["\u101A", "\u101B"], ["\u002E", "\u101B"], ["\u104B", "\u104A"], ["Shift", "Shift"]],
156
      [[" ", " "]]
157
    ];
158
 
159
    this.VKI_layout.Czech = [ // Czech Keyboard
160
     [[";", "\u00b0", "`", "~"], ["+", "1", "!"], ["\u011B", "2", "@"], ["\u0161", "3", "#"], ["\u010D", "4", "$"], ["\u0159", "5", "%"], ["\u017E", "6", "^"], ["\u00FD", "7", "&"], ["\u00E1", "8", "*"], ["\u00ED", "9", "("], ["\u00E9", "0", ")"], ["=", "%", "-", "_"], ["\u00B4", "\u02c7", "=", "+"], ["Bksp", "Bksp"]],
161
     [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20AC"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00FA", "/", "[", "{"], [")", "(", "]", "}"], ["Enter", "Enter"]],
162
     [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u016F", '"', ";", ":"], ["\u00A7", "!", "\u00a4", "^"], ["\u00A8", "'", "\\", "|"]],
163
     [["Shift", "Shift"], ["\\", "|", "", "\u02dd"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "?", "<", "\u00d7"], [".", ":", ">", "\u00f7"], ["-", "_", "/", "?"], ["Shift", "Shift"]],
164
     [[" ", " ", " ", " "], ["Alt", "Alt"]]
165
    ];
166
 
167
    this.VKI_layout.Dutch = [ // Dutch Standard Keyboard
168
      [["@", "\u00a7", "\u00ac"], ["1", "!", "\u00b9"], ["2", '"', "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00bc"], ["5", "%", "\u00bd"], ["6", "&", "\u00be"], ["7", "_", "\u00a3"], ["8", "(", "{"], ["9", ")", "}"], ["0", "'"], ["/", "?", "\\"], ["\u00b0", "~", "\u00b8"], ["Bksp", "Bksp"]],
169
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R", "\u00b6"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00a8", "^"], ["*", "|"], ["<", ">"]],
170
      [["Caps", "Caps"], ["a", "A"], ["s", "S", "\u00df"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["+", "\u00b1"], ["\u00b4", "\u0060"], ["Enter", "Enter"]],
171
      [["Shift", "Shift"], ["]", "[", "\u00a6"], ["z", "Z", "\u00ab"], ["x", "X", "\u00bb"], ["c", "C", "\u00a2"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u00b5"], [",", ";"], [".", ":", "\u00b7"], ["-", "="], ["Shift", "Shift"]],
172
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
173
    ];
174
 
175
    this.VKI_layout.Dvorak = [ // Dvorak Keyboard
176
      [["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["[", "{"], ["]", "}"], ["Bksp", "Bksp"]],
177
      [["Tab", "Tab"],["'", '"'], [",", "<"], [".", ">"], ["p", "P"], ["y", "Y"], ["f", "F"], ["g", "G"], ["c", "C"], ["r", "R"], ["l", "L"], ["/", "?"], ["=", "+"], ["\\", "|"]],
178
      [["Caps", "Caps"], ["a", "A"], ["o", "O"], ["e", "E"], ["u", "U"], ["i", "I"], ["d", "D"], ["h", "H"], ["t", "T"], ["n", "N"], ["s", "S"], ["-", "_"], ["Enter", "Enter"]],
179
      [["Shift", "Shift"], [";", ":"], ["q", "Q"], ["j", "J"], ["k", "K"], ["x", "X"], ["b", "B"], ["m", "M"], ["w", "W"], ["v", "V"], ["z", "Z"], ["Shift", "Shift"]],
180
      [[" ", " "]]
181
    ];
182
 
183
    this.VKI_layout.Farsi = [ // Farsi Keyboard
184
      [["\u067e", "\u0651 "], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]],
185
      [["Tab", "Tab"], ["\u0636", "\u064e"], ["\u0635", "\u064b"], ["\u062b", "\u064f"], ["\u0642", "\u064c"], ["\u0641", "\u0644"], ["\u063a", "\u0625"], ["\u0639", "\u2018"], ["\u0647", "\u00f7"], ["\u062e", "\u00d7"], ["\u062d", "\u061b"], ["\u062c", "\u003c"], ["\u0686", "\u003e"], ["\u0698", "\u007c"]],
186
      [["Caps", "Caps"], ["\u0634", "\u0650"], ["\u0633", "\u064d"], ["\u064a", "\u005d"], ["\u0628", "\u005b"], ["\u0644", "\u0644"], ["\u0627", "\u0623"], ["\u062a", "\u0640"], ["\u0646", "\u060c"], ["\u0645", "\u005c"], ["\u06af", "\u003a"], ["\u0643", "\u0022"], ["Enter", "Enter"]],
187
      [["Shift", "Shift"], ["\u0626", "\u007e"], ["\u0621", "\u0652"], ["\u0632", "\u007d"], ["\u0631", "\u007b"], ["\u0630", "\u0644"], ["\u062f", "\u0622"], ["\u0626", "\u0621"], ["\u0648", "\u002c"], [".", "\u002e"], ["/", "\u061f"], ["Shift", "Shift"]],
188
      [[" ", " ", " ", " "], ["Alt", "Alt"]]
189
    ];
190
 
191
    this.VKI_layout.French = [ // French Standard Keyboard
192
      [["\u00b2", "\u00b3"], ["&", "1"], ["\u00e9", "2", "~"], ['"', "3", "#"], ["'", "4", "{"], ["(", "5", "["], ["-", "6", "|"], ["\u00e8", "7", "\u0060"], ["_", "8", "\\"], ["\u00e7", "9", "\u005e"], ["\u00e0", "0", "\u0040"], [")", "\u00b0", "]"], ["=", "+", "}"], ["Bksp", "Bksp"]],
193
      [["Tab", "Tab"], ["a", "A"], ["z", "Z"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["^", "\u00a8"], ["$", "\u00a3", "\u00a4"], ["Enter", "Enter"]],
194
      [["Caps", "Caps"], ["q", "Q"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["m", "M"], ["\u00f9", "%"], ["*", "\u03bc"]],
195
      [["Shift", "Shift"], ["<", ">"], ["w", "W"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], [",", "?"], [";", "."], [":", "/"], ["!", "\u00a7"], ["Shift", "Shift"]],
196
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
197
    ];
198
 
199
    this.VKI_layout.German = [ // German Standard Keyboard
200
      [["\u005e", "\u00b0"], ["1", "!"], ["2", '"', "\u00b2"], ["3", "\u00a7", "\u00b3"], ["4", "$"], ["5", "%"], ["6", "&"], ["7", "/", "{"], ["8", "(", "["], ["9", ")", "]"], ["0", "=", "}"], ["\u00df", "?", "\\"], ["\u00b4", "\u0060"], ["Bksp", "Bksp"]],
201
      [["Tab", "Tab"], ["q", "Q", "\u0040"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00fc", "\u00dc"], ["+", "*", "~"], ["Enter", "Enter"]],
202
      [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f6", "\u00d6"], ["\u00e4", "\u00c4"], ["#", "'"]],
203
      [["Shift", "Shift"], ["<", ">", "\u00a6"], ["y", "Y"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u00b5"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]],
204
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
205
    ];
206
 
207
    this.VKI_layout.Greek = [ // Greek Standard Keyboard
208
      [["`", "~"], ["1", "!"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a3"], ["5", "%", "\u00a7"], ["6", "^", "\u00b6"], ["7", "&"], ["8", "*", "\u00a4"], ["9", "(", "\u00a6"], ["0", ")", "\u00ba"], ["-", "_", "\u00b1"], ["=", "+", "\u00bd"], ["Bksp", "Bksp"]],
209
      [["Tab", "Tab"], [";", ":"], ["\u03c2", "^"], ["\u03b5", "\u0395"], ["\u03c1", "\u03a1"], ["\u03c4", "\u03a4"], ["\u03c5", "\u03a5"], ["\u03b8", "\u0398"], ["\u03b9", "\u0399"], ["\u03bf", "\u039f"], ["\u03c0", "\u03a0"], ["[", "{", "\u201c"], ["]", "}", "\u201d"], ["Enter", "Enter"]],
210
      [["Caps", "Caps"], ["\u03b1", "\u0391"], ["\u03c3", "\u03a3"], ["\u03b4", "\u0394"], ["\u03c6", "\u03a6"], ["\u03b3", "\u0393"], ["\u03b7", "\u0397"], ["\u03be", "\u039e"], ["\u03ba", "\u039a"], ["\u03bb", "\u039b"], ["\u0384", "\u00a8", "\u0385"], ["'", '"'], ["\\", "|", "\u00ac"]],
211
      [["Shift", "Shift"], ["<", ">"], ["\u03b6", "\u0396"], ["\u03c7", "\u03a7"], ["\u03c8", "\u03a8"], ["\u03c9", "\u03a9"], ["\u03b2", "\u0392"], ["\u03bd", "\u039d"], ["\u03bc", "\u039c"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]],
212
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
213
    ];
214
 
215
    this.VKI_layout.Hebrew = [ // Hebrew Standard Keyboard
216
      [["~", "`"], ["1", "!"], ["2", "@"], ["3", "#"], ["4" , "$", "\u20aa"], ["5" , "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", ")"], ["0", "("], ["-", "_"], ["=", "+"], ["\\", "|"], ["Bksp", "Bksp"]],
217
      [["Tab", "Tab"], ["/", "Q"], ["'", "W"], ["\u05e7", "E", "\u20ac"], ["\u05e8", "R"], ["\u05d0", "T"], ["\u05d8", "Y"], ["\u05d5", "U", "\u05f0"], ["\u05df", "I"], ["\u05dd", "O"], ["\u05e4", "P"], ["]", "}"], ["[", "{"]],
218
      [["Caps", "Caps"], ["\u05e9", "A"], ["\u05d3", "S"], ["\u05d2", "D"], ["\u05db", "F"], ["\u05e2", "G"], ["\u05d9", "H", "\u05f2"], ["\u05d7", "J", "\u05f1"], ["\u05dc", "K"], ["\u05da", "L"], ["\u05e3", ":"], ["," , '"'], ["Enter", "Enter"]],
219
      [["Shift", "Shift"], ["\u05d6", "Z"], ["\u05e1", "X"], ["\u05d1", "C"], ["\u05d4", "V"], ["\u05e0", "B"], ["\u05de", "N"], ["\u05e6", "M"], ["\u05ea", ">"], ["\u05e5", "<"], [".", "?"], ["Shift", "Shift"]],
220
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
221
    ];
222
 
223
    this.VKI_layout.Hungarian = [ // Hungarian Standard Keyboard
224
      [["0", "\u00a7"], ["1", "'", "\u007e"], ["2", '"', "\u02c7"], ["3", "+", "\u02c6"], ["4", "!", "\u02d8"], ["5", "%", "\u00b0"], ["6", "/", "\u02db"], ["7", "=", "\u0060"], ["8", "(", "\u02d9"], ["9", ")", "\u00b4"], ["\u00f6", "\u00d6", "\u02dd"], ["\u00fc", "\u00dc", "\u00a8"], ["\u00f3", "\u00d3", "\u00b8"], ["Bksp", "Bksp"]],
225
      [["Tab", "Tab"], ["q", "Q", "\u005c"], ["w", "W", "\u007c"], ["e", "E", "\u00c4"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U", "\u20ac"], ["i", "I", "\u00cd"], ["o", "O"], ["p", "P"], ["\u0151", "\u0150", "\u00f7"], ["\u00fa", "\u00da", "\u00d7"], ["Enter", "Enter"]],
226
      [["Caps", "Caps"], ["a", "A", "\u00e4"], ["s", "S","\u0111"], ["d", "D","\u0110"], ["f", "F","\u005b"], ["g", "G","\u005d"], ["h", "H"], ["j", "J","\u00ed"], ["k", "K","\u0141"], ["l", "L","\u0142"], ["\u00e9", "\u00c9","\u0024"], ["\u00e1", "\u00c1","\u00df"], ["\u0171", "\u0170","\u00a4"]],
227
      [["Shift", "Shift"], ["\u00ed", "\u00cd","\u003c"], ["y", "Y","\u003e"], ["x", "X","\u0023"], ["c", "C","\u0026"], ["v", "V","\u0040"], ["b", "B","\u007b"], ["n", "N","\u007d"], ["m", "M","\u003c"], [",", "?","\u003b"], [".", ":","\u003e"], ["-", "_","\u002a"], ["Shift", "Shift"]],
228
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
229
    ];
230
 
231
    this.VKI_layout.Italian = [ // Italian Standard Keyboard
232
      [["\u005c", "\u007c"], ["1", "!"], ["2", '"'], ["3", "\u00a3"], ["4", "$", "\u20ac"], ["5", "%"], ["6", "&"], ["7", "/"], ["8", "("], ["9", ")"], ["0", "="], ["'", "?"], ["\u00ec", "\u005e"], ["Bksp", "Bksp"]],
233
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00e8", "\u00e9", "[", "{"], ["+", "*", "]", "}"], ["Enter", "Enter"]],
234
      [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f2", "\u00e7", "@"], ["\u00e0", "\u00b0", "#"], ["\u00f9", "\u00a7"]],
235
      [["Shift", "Shift"], ["<", ">"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]],
236
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
237
    ];
1220 bpr 238
 
1013 bpr 239
    this.VKI_layout.Lithuanian = [ // Lithuanian Standard Keyboard
240
      [["`", "~"], ["\u0105", "\u0104"], ["\u010D", "\u010C"], ["\u0119", "\u0118"], ["\u0117", "\u0116"], ["\u012F", "\u012E"], ["\u0161", "\u0160"], ["\u0173", "\u0172"], ["\u016B", "\u016A"], ["\u201E", "("], ["\u201C", ")"], ["-", "_"], ["\u017E", "\u017D"], ["Bksp", "Bksp"]],
241
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["[", "{"], ["]", "}"], ["Enter", "Enter"]],
242
      [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], [";", ":"], ["'", '"'], ["\\", "|"]],
243
      [["Shift", "Shift"], ["\u2013", "\u20AC"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]],
244
      [[" ", " "]]
245
    ];
246
 
247
    this.VKI_layout.Norwegian = [ // Norwegian Standard Keyboard
248
      [["|", "\u00a7"], ["1", "!"], ["2", '"', "@"], ["3", "#", "\u00a3"], ["4", "\u00a4", "$"], ["5", "%"], ["6", "&"], ["7", "/", "{"], ["8", "(", "["], ["9", ")", "]"], ["0", "=", "}"], ["+", "?"], ["\\", "`", "\u00b4"], ["Bksp", "Bksp"]],
249
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00e5", "\u00c5"], ["\u00a8", "^", "~"], ["Enter", "Enter"]],
250
      [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f8", "\u00d8"], ["\u00e6", "\u00c6"], ["'", "*"]],
251
      [["Shift", "Shift"], ["<", ">"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u03bc", "\u039c"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]],
252
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
253
    ];
254
 
255
    this.VKI_layout.Numpad = [ // Number pad
256
      [["$"], ["\u00a3"], ["\u20ac"], ["\u00a5"], ["/"], ["^"], ["Bksp", "Bksp"]],
257
      [["."], ["7"], ["8"], ["9"], ["*"], ["<"], ["("], ["["]],
258
      [["="], ["4"], ["5"], ["6"], ["-"], [">"], [")"], ["]"]],
259
      [["0"], ["1"], ["2"], ["3"], ["+"], ["Enter", "Enter"]],
260
      [[" "]]
261
    ];
262
    this.VKI_layoutDDK.Numpad = true;
263
 
264
    this.VKI_layout["Polish Prog"] = [ // Polish Programmers Keyboard
265
      [["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]],
266
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u0119", "\u0118"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P"], ["[", "{"], ["]", "}"], ["\\", "|"]],
267
      [["Caps", "Caps"], ["a", "A", "\u0105", "\u0104"], ["s", "S", "\u015b", "\u015a"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L", "\u0142", "\u0141"], [";", ":"], ["'", '"'], ["Enter", "Enter"]],
268
      [["Shift", "Shift"], ["z", "Z", "\u017c", "\u017b"], ["x", "X", "\u017a", "\u0179"], ["c", "C", "\u0107", "\u0106"], ["v", "V"], ["b", "B"], ["n", "N", "\u0144", "\u0143"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]],
269
      [[" ", " ", " ", " "], ["Alt", "Alt"]]
270
    ];
271
 
272
    this.VKI_layout.Portuguese = [ // Portuguese Standard Keyboard
273
      [["`", "\u00ac", "\u00a6"], ["1", "!"], ["2", '"'], ["3", "\u00a3"], ["4", "$", "\u20ac"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]],
274
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u00e9", "\u00c9"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U", "\u00fa", "\u00da"], ["i", "I", "\u00ed", "\u00cd"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P"], ["[", "{"], ["]", "}"], ["Enter", "Enter"]],
275
      [["Caps", "Caps"], ["a", "A", "\u00e1", "\u00c1"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00e7", "\u00c7"], [";", ":"], ["'", "@"], ["#", "~"]],
276
      [["Shift", "Shift"], ["\\", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]],
277
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
278
    ];
279
 
280
    this.VKI_layout.Romanian = [ // Romanian Standard Keyboard
281
     [["\u201E", "\u201D", "\u0060", "~"], ["1", "!","~"], ["2", "\u0040", "\u02C7"], ["3", "#","\u005E"], ["4", "$", "\u02D8"], ["5", "%", "\u00B0"], ["6", "\u005E", "\u02DB"], ["7", "&", "\u0060"], ["8", "*", "\u02D9"], ["9", "(", "\u00B4"], ["0", ")", "\u02DD"], ["-", "_", "\u00A8"], ["=", "+", "\u00B8", "\u00B1"], ["Bksp", "Bksp"]],
282
     [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20AC"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P", "\u00A7"], ["\u0103", "\u0102", "[", "{"], ["\u00EE", "\u00CE", "]","}"], ["\u00E2", "\u00C2", "\\", "|"]],
283
     [["Caps", "Caps"], ["a", "A"], ["s", "S", "\u00df"], ["d", "D", "\u00f0", "\u00D0"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L", "\u0142", "\u0141"], [(this.VKI_isIElt8) ? "\u015F" : "\u0219", (this.VKI_isIElt8) ? "\u015E" : "\u0218", ";", ":"], [(this.VKI_isIElt8) ? "\u0163" : "\u021B", (this.VKI_isIElt8) ? "\u0162" : "\u021A", "\'", "\""], ["Enter", "Enter"]],
284
     [["Shift", "Shift"], ["\\", "|"], ["z", "Z"], ["x", "X"], ["c", "C", "\u00A9"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", ";", "<", "\u00AB"], [".", ":", ">", "\u00BB"], ["/", "?"], ["Shift", "Shift"]],
285
     [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
286
    ];
287
 
288
    this.VKI_layout.Russian = [ // Russian Standard Keyboard
289
      [["\u0451", "\u0401"], ["1", "!"], ["2", '"'], ["3", "\u2116"], ["4", ";"], ["5", "%"], ["6", ":"], ["7", "?"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]],
290
      [["Tab", "Tab"], ["\u0439", "\u0419"], ["\u0446", "\u0426"], ["\u0443", "\u0423"], ["\u043A", "\u041A"], ["\u0435", "\u0415"], ["\u043D", "\u041D"], ["\u0433", "\u0413"], ["\u0448", "\u0428"], ["\u0449", "\u0429"], ["\u0437", "\u0417"], ["\u0445", "\u0425"], ["\u044A", "\u042A"], ["Enter", "Enter"]],
291
      [["Caps", "Caps"], ["\u0444", "\u0424"], ["\u044B", "\u042B"], ["\u0432", "\u0412"], ["\u0430", "\u0410"], ["\u043F", "\u041F"], ["\u0440", "\u0420"], ["\u043E", "\u041E"], ["\u043B", "\u041B"], ["\u0434", "\u0414"], ["\u0436", "\u0416"], ["\u044D", "\u042D"], ["\\", "/"]],
292
      [["Shift", "Shift"], ["/", "|"], ["\u044F", "\u042F"], ["\u0447", "\u0427"], ["\u0441", "\u0421"], ["\u043C", "\u041C"], ["\u0438", "\u0418"], ["\u0442", "\u0422"], ["\u044C", "\u042C"], ["\u0431", "\u0411"], ["\u044E", "\u042E"], [".", ","], ["Shift", "Shift"]],
293
      [[" ", " "]]
294
    ];
295
 
1220 bpr 296
    this.VKI_layout.SerbianCyr = [ // Serbian Cyrillic Standard Keyboard
297
      [["`", "~"], ["1", "!"], ["2", '"'], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "&"], ["7", "/"], ["8", "("], ["9", ")"], ["0", "="], ["'", "?"], ["+", "*"], ["Bksp", "Bksp"]],
298
      [["Tab", "Tab"], ["\u0459", "\u0409"], ["\u045a", "\u040a"], ["\u0435", "\u0415", "\u20ac"], ["\u0440", "\u0420"], ["\u0442", "\u0422"], ["\u0437", "\u0417"], ["\u0443", "\u0423"], ["\u0438", "\u0418"], ["\u043e", "\u041e"], ["\u043f", "\u041f"], ["\u0448", "\u0428"], ["\u0452", "\u0402"], ["Enter", "Enter"]],
299
      [["Caps", "Caps"], ["\u0430", "\u0410"], ["\u0441", "\u0421"], ["\u0434", "\u0414"], ["\u0444", "\u0424"], ["\u0433", "\u0413"], ["\u0445", "\u0425"], ["\u0458", "\u0408"], ["\u043a", "\u041a"], ["\u043b", "\u041b"], ["\u0447", "\u0427"], ["\u045b", "\u040b"], ["\u0436", "\u0416"]],
300
      [["Shift", "Shift"], ["<", ">"], ["\u0455", "\u0405"], ["\u045f", "\u040f"], ["\u0446", "\u0426"], ["\u0432", "\u0412"], ["\u0431", "\u0411"], ["\u043d", "\u041d"], ["\u043c", "\u041c"], [",", ";", "<"], [".", ":", ">"], ["-", "_", "\u00a9"], ["Shift", "Shift"]],
301
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
302
    ];
303
 
304
    this.VKI_layout.SerbianLat = [ // Serbian Latin Standard Keyboard
305
      [["\u201a", "~"], ["1", "!", "~"], ["2", '"', "\u02c7"], ["3", "#", "^"], ["4", "$", "\u02d8"], ["5", "%", "\u00b0"], ["6", "&", "\u02db"], ["7", "/", "`"], ["8", "(", "\u02d9"], ["9", ")", "\u00b4"], ["0", "=", "\u02dd"], ["'", "?", "\u00a8"], ["+", "*", "\u00b8"], ["Bksp", "Bksp"]],
306
      [["Tab", "Tab"], ["q", "Q", "\\"], ["w", "W","|"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u0161", "\u0160", "\u00f7"], ["\u0111", "\u0110", "\u00d7"], ["Enter", "Enter"]],
307
      [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F", "["], ["g", "G", "]"], ["h", "H"], ["j", "J"], ["k", "K", "\u0142"], ["l", "L", "\u0141"], ["\u010d", "\u010c"], ["\u0107", "\u0106", "\u00df"], ["\u017e", "\u017d", "\u00a4"]],
308
      [["Shift", "Shift"], ["<", ">"], ["y", "Y"], ["x", "X"], ["c", "C"], ["v", "V", "@"], ["b", "B", "{",], ["n", "N", "}"], ["m", "M", "\u00a7"], [",", ";", "<"], [".", ":", ">"], ["-", "_", "\u00a9"], ["Shift", "Shift"]],
309
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
310
    ];
311
 
312
    this.VKI_layout.Slovak = [ // Slovak Keyboard
313
     [[";", "\u00b0"], ["+", "1", "~"], ["\u013E", "2", "\u02C7"], ["\u0161", "3", "\u005E"], ["\u010D", "4", "\u02D8"], ["\u0165", "5", "\u00B0"], ["\u017E", "6", "\u02DB"], ["\u00FD", "7", "\u0060"], ["\u00E1", "8", "\u02D9"], ["\u00ED", "9", "\u00B4"], ["\u00E9", "0", "\u02DD"], ["=", "%", "\u00A8"], ["\u00B4", "\u02c7", "\u00B8"], ["Bksp", "Bksp"]],
314
     [["Tab", "Tab"], ["q", "Q","\u005C"], ["w", "W","\u007C"], ["e", "E", "\u20AC"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P","\u0027"], ["\u00FA", "/", "\u00F7"], ["\u00E4", "(", "\u00D7"], ["Enter", "Enter"]],
315
     [["Caps", "Caps"], ["a", "A"], ["s", "S","\u0111"], ["d", "D","\u0110"], ["f", "F","\u005B"], ["g", "G","\u005D"], ["h", "H"], ["j", "J"], ["k", "K","\u0142"], ["l", "L","\u0141"], ["\u00F4", '"', "\u0024"], ["\u00A7", "!", "\u00DF",], ["\u0148", ")","\u00A4"]],
316
     [["Shift", "Shift"], ["&", "*", "\u003C"], ["y", "Y","\u003E"], ["x", "X","\u0023"], ["c", "C","\u0026"], ["v", "V","\u0040"], ["b", "B","\u007B"], ["n", "N","\u007D"], ["m", "M"], [",", "?", "<"], [".", ":", ">"], ["-", "_", "\u002A", ], ["Shift", "Shift"]],
317
     [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
318
    ];
319
 
1013 bpr 320
    this.VKI_layout.Slovenian = [ // Slovenian Standard Keyboard
321
      [["\u00a8", "\u00a8", "\u00b8"], ["1", "!", "~"], ["2", '"', "\u02c7"], ["3", "#", "^"], ["4", "$", "\u02d8"], ["5", "%", "\u00b0"], ["6", "&", "\u02db"], ["7", "/", "\u0060"], ["8", "(", "\u00B7"], ["9", ")", "\u00b4"], ["0", "=", "\u2033"], ["'", "?", "\u00a8"], ["+", "*", "\u00b8"], ["Bksp", "Bksp"]],
322
      [["Tab", "Tab"], ["q", "Q", "\\"], ["w", "W","|"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u0161", "\u0160", "\u00f7"], ["\u0111", "\u0110", "\u00d7"], ["Enter", "Enter"]],
323
      [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F", "["], ["g", "G", "]"], ["h", "H"], ["j", "J"], ["k", "K", "\u0142"], ["l", "L", "\u0141"], ["\u010D", "\u010C"], ["\u0107", "\u0106", "\u00df"], ["\u017E", "\u017D", "\u00a4"]],
324
      [["Shift", "Shift"], ["<", ">"], ["y", "Y"], ["x", "X"], ["c", "C"], ["v", "V", "@"], ["b", "B", "{",], ["n", "N", "}"], ["m", "M", "\u00a7"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]],
325
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
326
    ];
327
 
328
    this.VKI_layout["Spanish-SP"] = [ // Spanish (Spain) Standard Keyboard
329
      [["\u00ba", "\u00aa", "\\"], ["1", "!", "|"], ["2", '"', "@"], ["3", "'", "#"], ["4", "$", "~"], ["5", "%", "\u20ac"], ["6", "&","\u00ac"], ["7", "/"], ["8", "("], ["9", ")"], ["0", "="], ["'", "?"], ["\u00a1", "\u00bf"], ["Bksp", "Bksp"]],
330
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u0060", "^", "["], ["\u002b", "\u002a", "]"], ["Enter", "Enter"]],
331
      [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f1", "\u00d1"], ["\u00b4", "\u00a8", "{"], ["\u00e7", "\u00c7", "}"]],
332
      [["Shift", "Shift"], ["<", ">"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]],
333
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
334
    ];
335
 
336
    this.VKI_layout.Swedish = [ // Swedish Standard Keyboard
337
      [["\u00a7", "\u00bd"], ["1", "!"], ["2", '"', "@"], ["3", "#", "\u00a3"], ["4", "\u00a4", "$"], ["5", "%", "\u20ac"], ["6", "&"], ["7", "/", "{"], ["8", "(", "["], ["9", ")", "]"], ["0", "=", "}"], ["+", "?", "\\"], ["\u00b4", "`"], ["Bksp", "Bksp"]],
338
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["\u00e5", "\u00c5"], ["\u00a8", "^", "~"], ["Enter", "Enter"]],
339
      [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u00f6", "\u00d6"], ["\u00e4", "\u00c4"], ["'", "*"]],
340
      [["Shift", "Shift"], ["<", ">", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M", "\u03bc", "\u039c"], [",", ";"], [".", ":"], ["-", "_"], ["Shift", "Shift"]],
341
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
342
    ];
343
 
344
    this.VKI_layout["Turkish-F"] = [ // Turkish F Keyboard Layout
345
      [['+', "*", "\u00ac"], ["1", "!", "\u00b9", "\u00a1"], ["2", '"', "\u00b2"], ["3", "^", "#", "\u00b3"], ["4", "$", "\u00bc", "\u00a4"], ["5", "%", "\u00bd"], ["6", "&", "\u00be"], ["7", "'", "{"], ["8", "(", '['], ["9", ")", ']'], ["0", "=", "}"], ["/", "?", "\\", "\u00bf"], ["-", "_", "|"], ["Bksp", "Bksp"]],
346
      [["Tab", "Tab"], ["f", "F", "@"], ["g", "G"], ["\u011f", "\u011e"], ["\u0131", "\u0049", "\u00b6", "\u00ae"], ["o", "O"], ["d", "D", "\u00a5"], ["r", "R"], ["n", "N"], ["h", "H", "\u00f8", "\u00d8"], ["p", "P", "\u00a3"], ["q", "Q", "\u00a8"], ["w", "W", "~"], ["Enter", "Enter"]],
347
      [["Caps", "Caps"], ["u", "U", "\u00e6", "\u00c6"], ["i", "\u0130", "\u00df", "\u00a7"], ["e", "E", "\u20ac"], ["a", "A", " ", "\u00aa"], ["\u00fc", "\u00dc"], ["t", "T"], ["k", "K"], ["m", "M"], ["l", "L"], ["y", "Y", "\u00b4"], ["\u015f", "\u015e"], ["x", "X", "`"]],
348
      [["Shift", "Shift"], ["<", ">", "|", "\u00a6"], ["j", "J", "\u00ab", "<"], ["\u00f6", "\u00d6", "\u00bb", ">"], ["v", "V", "\u00a2", "\u00a9"], ["c", "C"], ["\u00e7", "\u00c7"], ["z", "Z"], ["s", "S", "\u00b5", "\u00ba"], ["b", "B", "\u00d7"], [".", ":", "\u00f7"], [",", ";", "-"], ["Shift", "Shift"]],
349
      [[" ", " ", " ", " "],  ["AltGr", "AltGr"]]
350
    ];
351
 
352
    this.VKI_layout["Turkish-Q"] = [ // Turkish Q Keyboard Layout
353
      [['"', "\u00e9", "<"], ["1", "!", ">"], ["2", "'", "\u00a3"], ["3", "^", "#"], ["4", "+", "$"], ["5", "%", "\u00bd"], ["6", "&"], ["7", "/", "{"], ["8", "(", '['], ["9", ")", ']'], ["0", "=", "}"], ["*", "?", "\\"], ["-", "_", "|"], ["Bksp", "Bksp"]],
354
      [["Tab", "Tab"], ["q", "Q", "@"], ["w", "W"], ["e", "E", "\u20ac"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["\u0131", "\u0049", "\u0069", "\u0130"], ["o", "O"], ["p", "P"], ["\u011f", "\u011e", "\u00a8"], ["\u00fc", "\u00dc", "~"], ["Enter", "Enter"]],
355
      [["Caps", "Caps"], ["a", "A", "\u00e6", "\u00c6"], ["s", "S", "\u00df"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], ["\u015f", "\u015e", "\u00b4"], ["\u0069", "\u0130"], [",", ";", "`"]],
356
      [["Shift", "Shift"], ["<", ">", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], ["\u00f6", "\u00d6"], ["\u00e7", "\u00c7"], [".", ":"], ["Shift", "Shift"]],
357
      [[" ", " ", " ", " "],  ["AltGr", "AltGr"]]
358
    ];
359
 
360
    this.VKI_layout.UK = [ // UK Standard Keyboard
361
      [["`", "\u00ac", "\u00a6"], ["1", "!"], ["2", '"'], ["3", "\u00a3"], ["4", "$", "\u20ac"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]],
362
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E", "\u00e9", "\u00c9"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U", "\u00fa", "\u00da"], ["i", "I", "\u00ed", "\u00cd"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P"], ["[", "{"], ["]", "}"], ["Enter", "Enter"]],
363
      [["Caps", "Caps"], ["a", "A", "\u00e1", "\u00c1"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], [";", ":"], ["'", "@"], ["#", "~"]],
364
      [["Shift", "Shift"], ["\\", "|"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]],
365
      [[" ", " ", " ", " "], ["AltGr", "AltGr"]]
366
    ];
367
 
368
    this.VKI_layout.US = [ // US Standard Keyboard
369
      [["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]],
370
      [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["[", "{"], ["]", "}"], ["\\", "|"]],
371
      [["Caps", "Caps"], ["a", "A"], ["s", "S"], ["d", "D"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L"], [";", ":"], ["'", '"'], ["Enter", "Enter"]],
372
      [["Shift", "Shift"], ["z", "Z"], ["x", "X"], ["c", "C"], ["v", "V"], ["b", "B"], ["n", "N"], ["m", "M"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]],
373
      [[" ", " "]]
374
    ];
375
 
376
    this.VKI_layout["US Int'l"] = [ // US International Keyboard
377
      [["`", "~"], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]],
378
      [["Tab", "Tab"], ["q", "Q", "\u00e4", "\u00c4"], ["w", "W", "\u00e5", "\u00c5"], ["e", "E", "\u00e9", "\u00c9"], ["r", "R", "\u00ae"], ["t", "T", "\u00fe", "\u00de"], ["y", "Y", "\u00fc", "\u00dc"], ["u", "U", "\u00fa", "\u00da"], ["i", "I", "\u00ed", "\u00cd"], ["o", "O", "\u00f3", "\u00d3"], ["p", "P", "\u00f6", "\u00d6"], ["[", "{", "\u00ab"], ["]", "}", "\u00bb"], ["\\", "|", "\u00ac", "\u00a6"]],
379
      [["Caps", "Caps"], ["a", "A", "\u00e1", "\u00c1"], ["s", "S", "\u00df", "\u00a7"], ["d", "D", "\u00f0", "\u00d0"], ["f", "F"], ["g", "G"], ["h", "H"], ["j", "J"], ["k", "K"], ["l", "L", "\u00f8", "\u00d8"], [";", ":", "\u00b6", "\u00b0"], ["'", '"', "\u00b4", "\u00a8"], ["Enter", "Enter"]],
380
      [["Shift", "Shift"], ["z", "Z", "\u00e6", "\u00c6"], ["x", "X"], ["c", "C", "\u00a9", "\u00a2"], ["v", "V"], ["b", "B"], ["n", "N", "\u00f1", "\u00d1"], ["m", "M", "\u00b5"], [",", "<", "\u00e7", "\u00c7"], [".", ">"], ["/", "?", "\u00bf"], ["Shift", "Shift"]],
381
      [[" ", " ", " ", " "], ["Alt", "Alt"]]
382
    ];
383
 
384
    /* ***** Define Dead Keys ************************************** */
385
    this.VKI_deadkey = {};
386
 
387
    // - Lay out each dead key set in one row of sub-arrays.  The rows
388
    //   below are wrapped so uppercase letters are below their
389
    //   lowercase equivalents.
390
    //
391
    // - The first letter in each sub-array is the letter pressed after
392
    //   the diacritic.  The second letter is the letter this key-combo
393
    //   will generate.
394
    //
395
    // - Note that if you have created a new keyboard layout and want
396
    //   it included in the distributed script, PLEASE TELL ME if you
397
    //   have added additional dead keys to the ones below.
398
 
399
    this.VKI_deadkey['"'] = this.VKI_deadkey['\u00a8'] = [ // Umlaut / Diaeresis / Greek Dialytika
400
      ["a", "\u00e4"], ["e", "\u00eb"], ["i", "\u00ef"], ["o", "\u00f6"], ["u", "\u00fc"], ["y", "\u00ff"], ["\u03b9", "\u03ca"], ["\u03c5", "\u03cb"],
401
      ["A", "\u00c4"], ["E", "\u00cb"], ["I", "\u00cf"], ["O", "\u00d6"], ["U", "\u00dc"], ["Y", "\u0178"], ["\u0399", "\u03aa"], ["\u03a5", "\u03ab"]
402
    ];
403
    this.VKI_deadkey['~'] = [ // Tilde
404
      ["a", "\u00e3"], ["o", "\u00f5"], ["n", "\u00f1"],
405
      ["A", "\u00c3"], ["O", "\u00d5"], ["N", "\u00d1"]
406
    ];
407
    this.VKI_deadkey['^'] = [ // Circumflex
408
      ["a", "\u00e2"], ["e", "\u00ea"], ["i", "\u00ee"], ["o", "\u00f4"], ["u", "\u00fb"], ["w", "\u0175"], ["y", "\u0177"],
409
      ["A", "\u00c2"], ["E", "\u00ca"], ["I", "\u00ce"], ["O", "\u00d4"], ["U", "\u00db"], ["W", "\u0174"], ["Y", "\u0176"]
410
    ];
411
    this.VKI_deadkey['\u02c7'] = [ // Baltic caron
412
      ["c", "\u010D"], ["s", "\u0161"], ["z", "\u017E"], ["r", "\u0159"], ["d", "\u010f"], ["t", "\u0165"], ["n", "\u0148"], ["l", "\u013e"], ["e", "\u011b"],
413
      ["C", "\u010C"], ["S", "\u0160"], ["Z", "\u017D"], ["R", "\u0158"], ["D", "\u010e"], ["T", "\u0164"], ["N", "\u0147"], ["L", "\u013d"], ["E", "\u011a"]
414
    ];
415
    this.VKI_deadkey['\u02d8'] = [ // Romanian and Turkish breve
416
      ["a", "\u0103"], ["g", "\u011f"],
417
      ["A", "\u0102"], ["G", "\u011e"]
418
    ];
419
    this.VKI_deadkey['`'] = [ // Grave
420
      ["a", "\u00e0"], ["e", "\u00e8"], ["i", "\u00ec"], ["o", "\u00f2"], ["u", "\u00f9"],
421
      ["A", "\u00c0"], ["E", "\u00c8"], ["I", "\u00cc"], ["O", "\u00d2"], ["U", "\u00d9"]
422
    ];
423
    this.VKI_deadkey["'"] = this.VKI_deadkey['\u00b4'] = this.VKI_deadkey['\u0384'] = [ // Acute / Greek Tonos
424
      ["a", "\u00e1"], ["e", "\u00e9"], ["i", "\u00ed"], ["o", "\u00f3"], ["u", "\u00fa"], ["y", "\u00fd"], ["\u03b1", "\u03ac"], ["\u03b5", "\u03ad"], ["\u03b7", "\u03ae"], ["\u03b9", "\u03af"], ["\u03bf", "\u03cc"], ["\u03c5", "\u03cd"], ["\u03c9", "\u03ce"],
425
      ["A", "\u00c1"], ["E", "\u00c9"], ["I", "\u00cd"], ["O", "\u00d3"], ["U", "\u00da"], ["Y", "\u00dd"], ["\u0391", "\u0386"], ["\u0395", "\u0388"], ["\u0397", "\u0389"], ["\u0399", "\u038a"], ["\u039f", "\u038c"], ["\u03a5", "\u038e"], ["\u03a9", "\u038f"]
426
    ];
427
    this.VKI_deadkey['\u02dd'] = [ // Hungarian Double Acute Accent
428
      ["o", "\u0151"], ["u", "\u0171"],
429
      ["O", "\u0150"], ["U", "\u0170"]
430
    ];
431
    this.VKI_deadkey['\u0385'] = [ // Greek Dialytika + Tonos
432
      ["\u03b9", "\u0390"], ["\u03c5", "\u03b0"]
433
    ];
434
    this.VKI_deadkey['\u00b0'] = this.VKI_deadkey['\u00ba'] = [ // Ring
435
      ["a", "\u00e5"], ["u", "\u016f"],
436
      ["A", "\u00c5"], ["U", "\u016e"]
437
    ];
438
    this.VKI_deadkey['\u02DB'] = [ // Ogonek
439
      ["a", "\u0106"], ["e", "\u0119"], ["i", "\u012f"], ["o", "\u01eb"], ["u", "\u0173"], ["y", "\u0177"],
440
      ["A", "\u0105"], ["E", "\u0118"], ["I", "\u012e"], ["O", "\u01ea"], ["U", "\u0172"], ["Y", "\u0176"]
441
    ];
442
    this.VKI_deadkey['\u02D9'] = [ // Dot-above
443
      ["c", "\u010B"], ["e", "\u0117"], ["g", "\u0121"], ["z", "\u017C"],
444
      ["C", "\u010A"], ["E", "\u0116"], ["G", "\u0120"], ["Z", "\u017B"]
445
    ];
1220 bpr 446
    this.VKI_deadkey['\u00B8'] = this.VKI_deadkey['\u201a'] = [ // Cedilla
1013 bpr 447
      ["c", "\u00e7"], ["s", "\u015F"],
448
      ["C", "\u00c7"], ["S", "\u015E"]
449
    ];
450
    this.VKI_deadkey[','] = [ // Comma
451
      ["s", (this.VKI_isIElt8) ? "\u015F" : "\u0219"], ["t", (this.VKI_isIElt8) ? "\u0163" : "\u021B"],
452
      ["S", (this.VKI_isIElt8) ? "\u015E" : "\u0218"], ["T", (this.VKI_isIElt8) ? "\u0162" : "\u021A"]
453
    ];
454
 
455
 
456
 
457
    /* ****************************************************************
458
     * Attach the keyboard to an element
459
     *
460
     */
461
    this.VKI_attachKeyboard = VKI_attach = function(elem) {
462
      if (elem.VKI_attached) return false;
463
      var keybut = document.createElement('img');
464
          keybut.src = "scripts/js/keyboard/keyboard.png";
465
          keybut.alt = "Keyboard interface";
466
          keybut.className = "keyboardInputInitiator";
467
          keybut.title = "Display graphical keyboard interface";
468
          keybut.elem = elem;
469
          keybut.onclick = function() { self.VKI_show(this.elem); };
470
      elem.VKI_attached = true;
1220 bpr 471
      elem.parentNode.insertBefore(keybut, (elem.dir == "rtl") ? elem : elem.nextSibling);
1013 bpr 472
      if (this.VKI_isIE) {
473
        elem.onclick = elem.onselect = elem.onkeyup = function(e) {
474
          if ((e || event).type != "keyup" || !this.readOnly)
475
            this.range = document.selection.createRange();
476
        };
477
      }
478
    };
479
 
480
 
481
    /* ***** Find tagged input & textarea elements ***************** */
482
    var inputElems = [
483
      document.getElementsByTagName('input'),
484
      document.getElementsByTagName('textarea')
485
    ];
486
    for (var x = 0, elem; elem = inputElems[x++];)
487
      for (var y = 0, ex; ex = elem[y++];)
488
        if ((ex.nodeName == "TEXTAREA" || ex.type == "text" || ex.type == "password") && ex.className.indexOf("keyboardInput") > -1)
489
          this.VKI_attachKeyboard(ex);
490
 
491
 
492
    /* ***** Build the keyboard interface ************************** */
493
    this.VKI_keyboard = document.createElement('table');
494
    this.VKI_keyboard.id = "keyboardInputMaster";
495
    this.VKI_keyboard.dir = "ltr";
496
    this.VKI_keyboard.cellSpacing = this.VKI_keyboard.border = "0";
497
 
498
    var thead = document.createElement('thead');
499
      var tr = document.createElement('tr');
500
        var th = document.createElement('th');
501
          var kblist = document.createElement('select');
502
            for (ktype in this.VKI_layout) {
503
              if (typeof this.VKI_layout[ktype] == "object") {
504
                var opt = document.createElement('option');
505
                    opt.value = ktype;
506
                    opt.appendChild(document.createTextNode(ktype));
507
                  kblist.appendChild(opt);
508
              }
509
            }
510
            if (kblist.options.length) {
511
                kblist.value = this.VKI_kt;
512
                kblist.onchange = function() {
513
                  self.VKI_kt = this.value;
514
                  self.VKI_buildKeys();
515
                  self.VKI_position();
516
                };
517
              th.appendChild(kblist);
518
            }
519
 
520
            var label = document.createElement('label');
521
              var checkbox = document.createElement('input');
522
                  checkbox.type = "checkbox";
523
                  checkbox.title = "Dead keys: " + ((this.VKI_deadkeysOn) ? "On" : "Off");
524
                  checkbox.defaultChecked = this.VKI_deadkeysOn;
525
                  checkbox.onclick = function() {
526
                    self.VKI_deadkeysOn = this.checked;
527
                    this.title = "Dead keys: " + ((this.checked) ? "On" : "Off");
528
                    self.VKI_modify("");
529
                    return true;
530
                  };
531
                label.appendChild(this.VKI_deadkeysElem = checkbox);
532
                  checkbox.checked = this.VKI_deadkeysOn;
533
            th.appendChild(label);
534
          tr.appendChild(th);
535
 
536
        var td = document.createElement('td');
537
          var clearer = document.createElement('span');
538
              clearer.id = "keyboardInputClear";
539
              clearer.appendChild(document.createTextNode("Clear"));
540
              clearer.title = "Clear this input";
541
              clearer.onmousedown = function() { this.className = "pressed"; };
542
              clearer.onmouseup = function() { this.className = ""; };
543
              clearer.onclick = function() {
544
                self.VKI_target.value = "";
545
                self.VKI_target.focus();
546
                return false;
547
              };
548
            td.appendChild(clearer);
549
 
550
          var closer = document.createElement('span');
551
              closer.id = "keyboardInputClose";
552
              closer.appendChild(document.createTextNode('X'));
553
              closer.title = "Close this window";
554
              closer.onmousedown = function() { this.className = "pressed"; };
555
              closer.onmouseup = function() { this.className = ""; };
556
              closer.onclick = function() { self.VKI_close(); };
557
            td.appendChild(closer);
558
 
559
          tr.appendChild(td);
560
        thead.appendChild(tr);
561
    this.VKI_keyboard.appendChild(thead);
562
 
563
    var tbody = document.createElement('tbody');
564
      var tr = document.createElement('tr');
565
        var td = document.createElement('td');
566
            td.colSpan = "2";
567
          var div = document.createElement('div');
568
              div.id = "keyboardInputLayout";
569
            td.appendChild(div);
570
          if (this.VKI_showVersion) {
571
            var div = document.createElement('div');
572
              var ver = document.createElement('var');
573
                  ver.appendChild(document.createTextNode("v" + this.VKI_version));
574
                div.appendChild(ver);
575
              td.appendChild(div);
576
          }
577
          tr.appendChild(td);
578
        tbody.appendChild(tr);
1220 bpr 579
    this.VKI_keyboard.appendChild(tbody);
1013 bpr 580
 
581
    if (this.VKI_isIE6) {
582
      this.VKI_iframe = document.createElement('iframe');
583
      this.VKI_iframe.style.position = "absolute";
584
      this.VKI_iframe.style.border = "0px none";
585
      this.VKI_iframe.style.filter = "mask()";
586
      this.VKI_iframe.style.zIndex = "999999";
1220 bpr 587
      this.VKI_iframe.src = this.VKI_imageURI;
1013 bpr 588
    }
589
 
590
 
591
    /* ****************************************************************
592
     * Build or rebuild the keyboard keys
593
     *
594
     */
595
    this.VKI_buildKeys = function() {
596
      this.VKI_shift = this.VKI_capslock = this.VKI_alternate = this.VKI_dead = false;
597
      this.VKI_deadkeysOn = (this.VKI_layoutDDK[this.VKI_kt]) ? false : this.VKI_keyboard.getElementsByTagName('label')[0].getElementsByTagName('input')[0].checked;
598
 
599
      var container = this.VKI_keyboard.tBodies[0].getElementsByTagName('div')[0];
600
      while (container.firstChild) container.removeChild(container.firstChild);
601
 
602
      for (var x = 0, hasDeadKey = false, lyt; lyt = this.VKI_layout[this.VKI_kt][x++];) {
603
        var table = document.createElement('table');
604
            table.cellSpacing = table.border = "0";
605
        if (lyt.length <= this.VKI_keyCenter) table.className = "keyboardInputCenter";
606
          var tbody = document.createElement('tbody');
607
            var tr = document.createElement('tr');
608
            for (var y = 0, lkey; lkey = lyt[y++];) {
609
              var td = document.createElement('td');
610
                  td.appendChild(document.createTextNode(lkey[0]));
611
 
612
                var className = [];
613
                if (this.VKI_deadkeysOn)
614
                  for (key in this.VKI_deadkey)
615
                    if (key === lkey[0]) { className.push("alive"); break; }
616
                if (lyt.length > this.VKI_keyCenter && y == lyt.length) className.push("last");
617
                if (lkey[0] == " ") className.push("space");
618
                  td.className = className.join(" ");
619
 
620
                  td.VKI_clickless = 0;
621
                  if (!td.click) {
622
                    td.click = function() {
1220 bpr 623
                      var evt = this.ownerDocument.createEvent('MouseEvents');
624
                      evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
625
                      this.dispatchEvent(evt);
1013 bpr 626
                    };
627
                  }
628
                  td.onmouseover = function() {
629
                    if (self.VKI_clickless) {
630
                      var _self = this;
631
                      clearTimeout(this.VKI_clickless);
632
                      this.VKI_clickless = setTimeout(function() { _self.click(); }, self.VKI_clicklessDelay);
633
                    }
634
                    if (this.firstChild.nodeValue != "\xa0") this.className += " hover";
635
                  };
636
                  td.onmouseout = function() {
637
                    if (self.VKI_clickless) clearTimeout(this.VKI_clickless);
638
                    this.className = this.className.replace(/ ?(hover|pressed)/g, "");
639
                  };
640
                  td.onmousedown = function() {
641
                    if (self.VKI_clickless) clearTimeout(this.VKI_clickless);
642
                    if (this.firstChild.nodeValue != "\xa0") this.className += " pressed";
643
                  };
644
                  td.onmouseup = function() {
645
                    if (self.VKI_clickless) clearTimeout(this.VKI_clickless);
646
                    this.className = this.className.replace(/ ?pressed/g, "");
647
                  };
648
                  td.ondblclick = function() { return false; };
649
 
650
                switch (lkey[1]) {
651
                  case "Caps":
652
                  case "Shift":
653
                  case "Alt":
654
                  case "AltGr":
655
                    td.onclick = (function(type) { return function() { self.VKI_modify(type); return false; }; })(lkey[1]);
656
                    break;
657
                  case "Tab":
658
                    td.onclick = function() { self.VKI_insert("\t"); return false; };
659
                    break;
660
                  case "Bksp":
661
                    td.onclick = function() {
662
                      self.VKI_target.focus();
663
                      if (self.VKI_target.setSelectionRange) {
664
                        if (self.VKI_target.readOnly && self.VKI_isWebKit) {
665
                          var rng = [self.VKI_target.selStart || 0, self.VKI_target.selEnd || 0];
666
                        } else var rng = [self.VKI_target.selectionStart, self.VKI_target.selectionEnd];
667
                        if (rng[0] < rng[1]) rng[0]++;
668
                        self.VKI_target.value = self.VKI_target.value.substr(0, rng[0] - 1) + self.VKI_target.value.substr(rng[1]);
669
                        self.VKI_target.setSelectionRange(rng[0] - 1, rng[0] - 1);
670
                        if (self.VKI_target.readOnly && self.VKI_isWebKit) {
671
                          var range = window.getSelection().getRangeAt(0);
672
                          self.VKI_target.selStart = range.startOffset;
673
                          self.VKI_target.selEnd = range.endOffset;
674
                        }
675
                      } else if (self.VKI_target.createTextRange) {
1220 bpr 676
                        try {
1013 bpr 677
                          self.VKI_target.range.select();
678
                        } catch(e) { self.VKI_target.range = document.selection.createRange(); }
679
                        if (!self.VKI_target.range.text.length) self.VKI_target.range.moveStart('character', -1);
680
                        self.VKI_target.range.text = "";
681
                      } else self.VKI_target.value = self.VKI_target.value.substr(0, self.VKI_target.value.length - 1);
682
                      if (self.VKI_shift) self.VKI_modify("Shift");
683
                      if (self.VKI_alternate) self.VKI_modify("AltGr");
684
                      self.VKI_target.focus();
685
                      return true;
686
                    };
687
                    break;
688
                  case "Enter":
689
                    td.onclick = function() {
690
                      if (self.VKI_target.nodeName != "TEXTAREA") {
691
                        self.VKI_close();
692
                        this.className = this.className.replace(/ ?(hover|pressed)/g, "");
693
                      } else self.VKI_insert("\n");
694
                      return true;
695
                    };
696
                    break;
697
                  default:
698
                    td.onclick = function() {
699
                      if (self.VKI_deadkeysOn && self.VKI_dead) {
700
                        if (self.VKI_dead != this.firstChild.nodeValue) {
701
                          for (key in self.VKI_deadkey) {
702
                            if (key == self.VKI_dead) {
703
                              if (this.firstChild.nodeValue != " ") {
704
                                for (var z = 0, rezzed = false, dk; dk = self.VKI_deadkey[key][z++];) {
705
                                  if (dk[0] == this.firstChild.nodeValue) {
706
                                    self.VKI_insert(dk[1]);
707
                                    rezzed = true;
708
                                    break;
709
                                  }
710
                                }
711
                              } else {
712
                                self.VKI_insert(self.VKI_dead);
713
                                rezzed = true;
714
                              } break;
715
                            }
716
                          }
717
                        } else rezzed = true;
718
                      } self.VKI_dead = false;
719
 
720
                      if (!rezzed && this.firstChild.nodeValue != "\xa0") {
721
                        if (self.VKI_deadkeysOn) {
722
                          for (key in self.VKI_deadkey) {
723
                            if (key == this.firstChild.nodeValue) {
724
                              self.VKI_dead = key;
725
                              this.className += " dead";
726
                              if (self.VKI_shift) self.VKI_modify("Shift");
727
                              if (self.VKI_alternate) self.VKI_modify("AltGr");
728
                              break;
729
                            }
730
                          }
731
                          if (!self.VKI_dead) self.VKI_insert(this.firstChild.nodeValue);
732
                        } else self.VKI_insert(this.firstChild.nodeValue);
733
                      }
734
 
735
                      self.VKI_modify("");
736
                      return false;
737
                    };
738
 
739
                }
740
                tr.appendChild(td);
741
              tbody.appendChild(tr);
742
            table.appendChild(tbody);
743
 
744
            for (var z = 0; z < 4; z++)
745
              if (this.VKI_deadkey[lkey[z] = lkey[z] || "\xa0"]) hasDeadKey = true;
746
        }
747
        container.appendChild(table);
748
      }
749
      this.VKI_deadkeysElem.style.display = (!this.VKI_layoutDDK[this.VKI_kt] && hasDeadKey) ? "inline" : "none";
750
    };
751
 
752
    this.VKI_buildKeys();
753
    VKI_disableSelection(this.VKI_keyboard);
754
 
755
 
756
    /* ****************************************************************
757
     * Controls modifier keys
758
     *
759
     */
760
    this.VKI_modify = function(type) {
761
      switch (type) {
762
        case "Alt":
763
        case "AltGr": this.VKI_alternate = !this.VKI_alternate; break;
764
        case "Caps": this.VKI_capslock = !this.VKI_capslock; break;
765
        case "Shift": this.VKI_shift = !this.VKI_shift; break;
766
      } var vchar = 0;
767
      if (!this.VKI_shift != !this.VKI_capslock) vchar += 1;
768
 
769
      var tables = this.VKI_keyboard.getElementsByTagName('table');
770
      for (var x = 0; x < tables.length; x++) {
771
        var tds = tables[x].getElementsByTagName('td');
772
        for (var y = 0; y < tds.length; y++) {
773
          var className = [];
774
          var lkey = this.VKI_layout[this.VKI_kt][x][y];
775
 
776
          if (tds[y].className.indexOf('hover') > -1) className.push("hover");
777
 
778
          switch (lkey[1]) {
779
            case "Alt":
780
            case "AltGr":
781
              if (this.VKI_alternate) className.push("dead");
782
              break;
783
            case "Shift":
784
              if (this.VKI_shift) className.push("dead");
785
              break;
786
            case "Caps":
787
              if (this.VKI_capslock) className.push("dead");
788
              break;
789
            case "Tab": case "Enter": case "Bksp": break;
790
            default:
791
              if (type) tds[y].firstChild.nodeValue = lkey[vchar + ((this.VKI_alternate && lkey.length == 4) ? 2 : 0)];
792
              if (this.VKI_deadkeysOn) {
793
                var char = tds[y].firstChild.nodeValue;
794
                if (this.VKI_dead) {
795
                  if (char == this.VKI_dead) className.push("dead");
796
                  for (var z = 0; z < this.VKI_deadkey[this.VKI_dead].length; z++) {
797
                    if (char == this.VKI_deadkey[this.VKI_dead][z][0]) {
798
                      className.push("target");
799
                      break;
800
                    }
801
                  }
802
                }
803
                for (key in this.VKI_deadkey)
804
                  if (key === char) { className.push("alive"); break; }
805
              }
806
          }
807
 
808
          if (y == tds.length - 1 && tds.length > this.VKI_keyCenter) className.push("last");
809
          if (lkey[0] == " ") className.push("space");
810
          tds[y].className = className.join(" ");
811
        }
812
      }
813
    };
814
 
815
 
816
    /* ****************************************************************
817
     * Insert text at the cursor
818
     *
819
     */
820
    this.VKI_insert = function(text) {
821
      this.VKI_target.focus();
1220 bpr 822
      if (this.VKI_target.maxLength) this.VKI_target.maxlength = this.VKI_target.maxLength;
823
      if (typeof this.VKI_target.maxlength == "undefined" ||
824
          this.VKI_target.maxlength < 0 ||
825
          this.VKI_target.value.length < this.VKI_target.maxlength) {
1013 bpr 826
        if (this.VKI_target.setSelectionRange) {
827
          if (this.VKI_target.readOnly && this.VKI_isWebKit) {
828
            var rng = [this.VKI_target.selStart || 0, this.VKI_target.selEnd || 0];
829
          } else var rng = [this.VKI_target.selectionStart, this.VKI_target.selectionEnd];
830
          this.VKI_target.value = this.VKI_target.value.substr(0, rng[0]) + text + this.VKI_target.value.substr(rng[1]);
831
          if (text == "\n" && window.opera) rng[0]++;
832
          this.VKI_target.setSelectionRange(rng[0] + text.length, rng[0] + text.length);
833
          if (this.VKI_target.readOnly && this.VKI_isWebKit) {
834
            var range = window.getSelection().getRangeAt(0);
835
            this.VKI_target.selStart = range.startOffset;
836
            this.VKI_target.selEnd = range.endOffset;
837
          }
838
        } else if (this.VKI_target.createTextRange) {
839
          try {
840
            this.VKI_target.range.select();
841
          } catch(e) { this.VKI_target.range = document.selection.createRange(); }
842
          this.VKI_target.range.text = text;
843
          this.VKI_target.range.collapse(true);
844
          this.VKI_target.range.select();
845
        } else this.VKI_target.value += text;
846
        if (this.VKI_shift) this.VKI_modify("Shift");
847
        if (this.VKI_alternate) this.VKI_modify("AltGr");
848
        this.VKI_target.focus();
1220 bpr 849
      } else if (this.VKI_target.createTextRange && this.VKI_target.range)
850
        this.VKI_target.range.select();
1013 bpr 851
    };
852
 
853
 
854
    /* ****************************************************************
855
     * Show the keyboard interface
856
     *
857
     */
858
    this.VKI_show = function(elem) {
859
      if (this.VKI_target = elem) {
860
        if (this.VKI_visible != elem) {
861
          if (this.VKI_isIE) {
862
            if (!this.VKI_target.range) {
863
              this.VKI_target.range = this.VKI_target.createTextRange();
864
              this.VKI_target.range.moveStart('character', this.VKI_target.value.length);
865
            } this.VKI_target.range.select();
866
          }
867
          try { this.VKI_keyboard.parentNode.removeChild(this.VKI_keyboard); } catch (e) {}
868
          if (this.VKI_clearPasswords && this.VKI_target.type == "password") this.VKI_target.value = "";
869
 
870
          var elem = this.VKI_target;
871
          this.VKI_target.keyboardPosition = "absolute";
872
          do {
873
            if (VKI_getStyle(elem, "position") == "fixed") {
874
              this.VKI_target.keyboardPosition = "fixed";
875
              break;
876
            }
877
          } while (elem = elem.offsetParent);
878
 
879
          if (this.VKI_isIE6) document.body.appendChild(this.VKI_iframe);
880
          document.body.appendChild(this.VKI_keyboard);
881
          this.VKI_keyboard.style.top = this.VKI_keyboard.style.right = this.VKI_keyboard.style.bottom = this.VKI_keyboard.style.left = "auto";
882
          this.VKI_keyboard.style.position = this.VKI_target.keyboardPosition;
883
 
884
          this.VKI_visible = this.VKI_target;
885
          this.VKI_position();
886
          this.VKI_target.focus();
887
        } else this.VKI_close();
888
      }
889
    };
890
 
891
 
892
    /* ****************************************************************
893
     * Position the keyboard
894
     *
895
     */
896
    this.VKI_position = function() {
897
      if (self.VKI_visible) {
898
        var inputElemPos = VKI_findPos(self.VKI_target);
899
        self.VKI_keyboard.style.top = inputElemPos[1] - ((self.VKI_target.keyboardPosition == "fixed" && !self.VKI_isIE && !self.VKI_isMoz) ? VKI_scrollDist()[1] : 0) + self.VKI_target.offsetHeight + 3 + "px";
900
        self.VKI_keyboard.style.left = Math.min(VKI_innerDimensions()[0] - self.VKI_keyboard.offsetWidth - 15, inputElemPos[0]) + "px";
901
        if (self.VKI_isIE6) {
902
          self.VKI_iframe.style.width = self.VKI_keyboard.offsetWidth + "px";
903
          self.VKI_iframe.style.height = self.VKI_keyboard.offsetHeight + "px";
904
          self.VKI_iframe.style.top = self.VKI_keyboard.style.top;
905
          self.VKI_iframe.style.left = self.VKI_keyboard.style.left;
906
        }
907
      }
908
    };
909
 
910
 
911
    if (window.addEventListener) {
1220 bpr 912
      window.addEventListener('resize', this.VKI_position, false);
1013 bpr 913
    } else if (window.attachEvent)
914
      window.attachEvent('onresize', this.VKI_position);
915
 
916
 
917
    /* ****************************************************************
918
     * Close the keyboard interface
919
     *
920
     */
921
    this.VKI_close = VKI_close = function() {
922
      if (this.VKI_visible) {
923
        try {
924
          this.VKI_keyboard.parentNode.removeChild(this.VKI_keyboard);
925
          if (this.VKI_isIE6) this.VKI_iframe.parentNode.removeChild(this.VKI_iframe);
926
        } catch (e) {}
927
        this.VKI_target.focus();
928
        this.VKI_target = this.VKI_visible = false;
929
      }
930
    };
931
  };
932
 
933
  function VKI_findPos(obj) {
934
    var curleft = curtop = 0;
935
    do {
936
      curleft += obj.offsetLeft;
937
      curtop += obj.offsetTop;
938
    } while (obj = obj.offsetParent);
939
    return [curleft, curtop];
940
  }
941
 
942
  function VKI_innerDimensions() {
943
    if (self.innerHeight) {
944
      return [self.innerWidth, self.innerHeight];
945
    } else if (document.documentElement && document.documentElement.clientHeight) {
946
      return [document.documentElement.clientWidth, document.documentElement.clientHeight];
947
    } else if (document.body)
948
      return [document.body.clientWidth, document.body.clientHeight];
949
    return [0, 0];
950
  }
951
 
952
  function VKI_scrollDist() {
953
    var html = document.getElementsByTagName('html')[0];
954
    if (html.scrollTop && document.documentElement.scrollTop) {
955
      return [html.scrollLeft, html.scrollTop];
956
    } else if (html.scrollTop || document.documentElement.scrollTop)
957
      return [html.scrollLeft + document.documentElement.scrollLeft, html.scrollTop + document.documentElement.scrollTop];
958
    return [0, 0];
959
  }
960
 
961
  function VKI_getStyle(obj, styleProp) {
962
    if (obj.currentStyle) {
963
      var y = obj.currentStyle[styleProp];
964
    } else if (window.getComputedStyle)
965
      var y = window.getComputedStyle(obj, null)[styleProp];
966
    return y;
967
  }
968
 
969
  function VKI_disableSelection(elem) {
970
    elem.onselectstart = function() { return false; };
971
    elem.unselectable = "on";
972
    elem.style.MozUserSelect = "none";
973
    elem.style.cursor = "default";
974
    if (window.opera) elem.onmousedown = function() { return false; };
975
  }
976
 
977
 
978
  /* ***** Attach this script to the onload event ****************** */
979
  if (window.addEventListener) {
1220 bpr 980
    window.addEventListener('load', VKI_buildKeyboardInputs, false);
1013 bpr 981
  } else if (window.attachEvent)
982
    window.attachEvent('onload', VKI_buildKeyboardInputs);