keyboard event helper and constants library
Revision | fce0f6c7920a28759e26038317c3b10c2705a7b7 (tree) |
---|---|
Time | 2017-04-13 14:53:02 |
Author | frostbane <frostbane@prog...> |
Commiter | frostbane |
(empty log message)
@@ -0,0 +1,7 @@ | ||
1 | +[branchname] | |
2 | +master = default | |
3 | +develop = develop | |
4 | +feature = feature/ | |
5 | +release = release/ | |
6 | +hotfix = hotfix/ | |
7 | +support = support/ |
@@ -0,0 +1,6 @@ | ||
1 | +syntax: regexp | |
2 | +tmp\/.* | |
3 | +.zim\/.* | |
4 | +bin/* | |
5 | +doc/* | |
6 | +node_modules/* |
@@ -0,0 +1,1 @@ | ||
1 | +node_modules/ | |
\ No newline at end of file |
@@ -0,0 +1,44 @@ | ||
1 | +# Copyright (c) 2016, 2017 Frostbane Ac. All rights reserved. # | |
2 | + | |
3 | +Redistribution and use in source and binary forms - with or without | |
4 | +modification - are permitted for any purpose, provided that | |
5 | +redistributions in source form retain this entire copyright notice and | |
6 | +indicate the origin and nature of any modifications. | |
7 | + | |
8 | +Outright copyright infringement | |
9 | + | |
10 | +* Don't just copy this and change the name. | |
11 | + | |
12 | +* Selling the unmodified original with no work done what-so-ever | |
13 | + | |
14 | +* Modifying the original work to contain hidden harmful content. | |
15 | + | |
16 | + | |
17 | +``` | |
18 | +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED | |
19 | +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
20 | +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
21 | +IN NO EVENT SHALL FROSTBANE AC BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
23 | +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | |
24 | +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |
25 | +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | |
26 | +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |
27 | +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | |
28 | +DAMAGE. | |
29 | +``` | |
30 | + | |
31 | +Redistribution and use in source and binary forms, with or without | |
32 | +modification, are permitted provided that the following conditions are | |
33 | +met: | |
34 | + | |
35 | +1. Redistributions of source code must retain the above copyright | |
36 | +notice, this list of conditions and the following disclaimer. | |
37 | + | |
38 | +2. Redistributions in binary form must reproduce the above copyright | |
39 | +notice, this list of conditions and the following disclaimer in the | |
40 | +documentation and/or other materials provided with the distribution. | |
41 | + | |
42 | +3. Neither the name of micro-dialog nor the names of its | |
43 | +contributors may be used to endorse or promote products derived from | |
44 | +this software without specific prior written permission. |
@@ -0,0 +1,26 @@ | ||
1 | +{ | |
2 | + "plugins" : [], | |
3 | + "templates": { | |
4 | + "cleverLinks" : true, | |
5 | + "monospaceLinks" : true, | |
6 | + "default" : { | |
7 | + "outputSourceFiles": true | |
8 | + }, | |
9 | + "applicationName": "micro-keyboard", | |
10 | + "disqus" : "", | |
11 | + "googleAnalytics": "", | |
12 | + "openGraph" : { | |
13 | + "title" : "", | |
14 | + "type" : "website", | |
15 | + "image" : "", | |
16 | + "site_name": "", | |
17 | + "url" : "" | |
18 | + }, | |
19 | + "meta" : { | |
20 | + "title" : "", | |
21 | + "description": "", | |
22 | + "keyword" : "" | |
23 | + }, | |
24 | + "linenums" : true | |
25 | + } | |
26 | +} |
@@ -0,0 +1,36 @@ | ||
1 | +{ | |
2 | + "name" : "micro-keyboard", | |
3 | + "version" : "v0.0.0", | |
4 | + "description" : "Key codes enumeration", | |
5 | + "repository" : { | |
6 | + "type": "hg", | |
7 | + "url" : "https://bitbucket.org/frostbane/micro-keyboard" | |
8 | + }, | |
9 | + "main" : "./microkeyboard.js", | |
10 | + "license" : "SEE LICENSE IN LICENSE.md", | |
11 | + "keywords" : [ | |
12 | + "micro-keyboard", | |
13 | + "keyboard-micro", | |
14 | + "keyboard", | |
15 | + "key", | |
16 | + "key code", | |
17 | + "keycode" | |
18 | + ], | |
19 | + "devDependencies": { | |
20 | + "jxunit" : "latest", | |
21 | + "grunt-jxunit" : "latest", | |
22 | + "jsdoc" : "latest", | |
23 | + "jsdoc-sable" : "latest", | |
24 | + "grunt" : "latest", | |
25 | + "grunt-cli" : "latest", | |
26 | + "grunt-jsdoc" : "latest", | |
27 | + "grunt-contrib-copy" : "latest", | |
28 | + "grunt-contrib-uglify": "latest" | |
29 | + }, | |
30 | + "dependencies": { | |
31 | + }, | |
32 | + "author" : { | |
33 | + "name" : "Frostbane Ac", | |
34 | + "email": "frostbane@programmer.net" | |
35 | + } | |
36 | +} |
@@ -0,0 +1,216 @@ | ||
1 | + | |
2 | +var Keyboard = (function(){ | |
3 | + "use strict"; | |
4 | + var kb = {}; | |
5 | + | |
6 | + var KeyCodes = []; | |
7 | + KeyCodes[8] = "Backspace"; | |
8 | + KeyCodes[9] = "Tab"; | |
9 | + KeyCodes[13] = "Enter"; | |
10 | + KeyCodes[16] = "Shift"; | |
11 | + KeyCodes[17] = "Ctrl"; | |
12 | + KeyCodes[18] = "Alt"; | |
13 | + KeyCodes[19] = "Pause/Break"; | |
14 | + KeyCodes[20] = "Caps Lock"; | |
15 | + KeyCodes[27] = "Esc"; | |
16 | + KeyCodes[33] = "Page Up"; | |
17 | + KeyCodes[34] = "Page Down"; | |
18 | + KeyCodes[35] = "End"; | |
19 | + KeyCodes[36] = "Home"; | |
20 | + KeyCodes[37] = "Left"; | |
21 | + KeyCodes[38] = "Up"; | |
22 | + KeyCodes[39] = "Right"; | |
23 | + KeyCodes[40] = "Down"; | |
24 | + KeyCodes[45] = "Insert"; | |
25 | + KeyCodes[46] = "Delete"; | |
26 | + KeyCodes[48] = "0"; | |
27 | + KeyCodes[49] = "1"; | |
28 | + KeyCodes[50] = "2"; | |
29 | + KeyCodes[51] = "3"; | |
30 | + KeyCodes[52] = "4"; | |
31 | + KeyCodes[53] = "5"; | |
32 | + KeyCodes[54] = "6"; | |
33 | + KeyCodes[55] = "7"; | |
34 | + KeyCodes[56] = "8"; | |
35 | + KeyCodes[57] = "9"; | |
36 | + KeyCodes[65] = "A"; | |
37 | + KeyCodes[66] = "B"; | |
38 | + KeyCodes[67] = "C"; | |
39 | + KeyCodes[68] = "D"; | |
40 | + KeyCodes[69] = "E"; | |
41 | + KeyCodes[70] = "F"; | |
42 | + KeyCodes[71] = "G"; | |
43 | + KeyCodes[72] = "H"; | |
44 | + KeyCodes[73] = "I"; | |
45 | + KeyCodes[74] = "J"; | |
46 | + KeyCodes[75] = "K"; | |
47 | + KeyCodes[76] = "L"; | |
48 | + KeyCodes[77] = "M"; | |
49 | + KeyCodes[78] = "N"; | |
50 | + KeyCodes[79] = "O"; | |
51 | + KeyCodes[80] = "P"; | |
52 | + KeyCodes[81] = "Q"; | |
53 | + KeyCodes[82] = "R"; | |
54 | + KeyCodes[83] = "S"; | |
55 | + KeyCodes[84] = "T"; | |
56 | + KeyCodes[85] = "U"; | |
57 | + KeyCodes[86] = "V"; | |
58 | + KeyCodes[87] = "W"; | |
59 | + KeyCodes[88] = "X"; | |
60 | + KeyCodes[89] = "Y"; | |
61 | + KeyCodes[90] = "Z"; | |
62 | + KeyCodes[91] = "Left Win"; | |
63 | + KeyCodes[92] = "Right Win"; | |
64 | + KeyCodes[93] = "Select"; | |
65 | + KeyCodes[96] = "NumPad 0"; | |
66 | + KeyCodes[97] = "NumPad 1"; | |
67 | + KeyCodes[98] = "NumPad 2"; | |
68 | + KeyCodes[99] = "NumPad 3"; | |
69 | + KeyCodes[100] = "NumPad 4"; | |
70 | + KeyCodes[101] = "NumPad 5"; | |
71 | + KeyCodes[102] = "NumPad 6"; | |
72 | + KeyCodes[103] = "NumPad 7"; | |
73 | + KeyCodes[104] = "NumPad 8"; | |
74 | + KeyCodes[105] = "NumPad 9"; | |
75 | + KeyCodes[106] = "NumPad *"; | |
76 | + KeyCodes[107] = "NumPad +"; | |
77 | + KeyCodes[109] = "NumPad -"; | |
78 | + KeyCodes[110] = "NumPad ."; | |
79 | + KeyCodes[111] = "NumPad /"; | |
80 | + KeyCodes[112] = "F1"; | |
81 | + KeyCodes[113] = "F2"; | |
82 | + KeyCodes[114] = "F3"; | |
83 | + KeyCodes[115] = "F4"; | |
84 | + KeyCodes[116] = "F5"; | |
85 | + KeyCodes[117] = "F6"; | |
86 | + KeyCodes[118] = "F7"; | |
87 | + KeyCodes[119] = "F8"; | |
88 | + KeyCodes[120] = "F9"; | |
89 | + KeyCodes[121] = "F10"; | |
90 | + KeyCodes[122] = "F11"; | |
91 | + KeyCodes[123] = "F12"; | |
92 | + KeyCodes[144] = "Num Lock"; | |
93 | + KeyCodes[145] = "Scroll Lock"; | |
94 | + KeyCodes[186] = ";"; | |
95 | + KeyCodes[187] = "="; | |
96 | + KeyCodes[188] = ","; | |
97 | + KeyCodes[189] = "-"; | |
98 | + KeyCodes[190] = "."; | |
99 | + KeyCodes[191] = "/"; | |
100 | + KeyCodes[192] = "`"; | |
101 | + KeyCodes[219] = "["; | |
102 | + KeyCodes[220] = "\\"; | |
103 | + KeyCodes[221] = "]"; | |
104 | + KeyCodes[222] = "'"; | |
105 | + kb.keyCodes = KeyCodes; | |
106 | + | |
107 | + | |
108 | + kb.Backspace = 8; | |
109 | + kb.Tab = 9; | |
110 | + kb.Enter = 13; | |
111 | + kb.Shift = 16; | |
112 | + kb.Ctrl = 17; | |
113 | + kb.Alt = 18; | |
114 | + kb.Pause = 19; | |
115 | + kb.Break = 19; | |
116 | + kb.CapsLock = 20; | |
117 | + kb.Esc = 27; | |
118 | + kb.PageUp = 33; | |
119 | + kb.PageDown = 34; | |
120 | + kb.End = 35; | |
121 | + kb.Home = 36; | |
122 | + kb.Left = 37; | |
123 | + kb.Up = 38; | |
124 | + kb.Right = 39; | |
125 | + kb.Down = 40; | |
126 | + kb.Insert = 45; | |
127 | + kb.Delete = 46; | |
128 | + kb._0 = 48; | |
129 | + kb._1 = 49; | |
130 | + kb._2 = 50; | |
131 | + kb._3 = 51; | |
132 | + kb._4 = 52; | |
133 | + kb._5 = 53; | |
134 | + kb._6 = 54; | |
135 | + kb._7 = 55; | |
136 | + kb._8 = 56; | |
137 | + kb._9 = 57; | |
138 | + kb._A = 65; | |
139 | + kb._B = 66; | |
140 | + kb._C = 67; | |
141 | + kb._D = 68; | |
142 | + kb._E = 69; | |
143 | + kb._F = 70; | |
144 | + kb._G = 71; | |
145 | + kb._H = 72; | |
146 | + kb._I = 73; | |
147 | + kb._J = 74; | |
148 | + kb._K = 75; | |
149 | + kb._L = 76; | |
150 | + kb._M = 77; | |
151 | + kb._N = 78; | |
152 | + kb._O = 79; | |
153 | + kb._P = 80; | |
154 | + kb._Q = 81; | |
155 | + kb._R = 82; | |
156 | + kb._S = 83; | |
157 | + kb._T = 84; | |
158 | + kb._U = 85; | |
159 | + kb._V = 86; | |
160 | + kb._W = 87; | |
161 | + kb._X = 88; | |
162 | + kb._Y = 89; | |
163 | + kb._Z = 90; | |
164 | + kb.LeftWin = 91; | |
165 | + kb.RightWin = 92; | |
166 | + kb.Select = 93; | |
167 | + kb.NumPad_0 = 96; | |
168 | + kb.NumPad_1 = 97; | |
169 | + kb.NumPad_2 = 98; | |
170 | + kb.NumPad_3 = 99; | |
171 | + kb.NumPad_4 = 100; | |
172 | + kb.NumPad_5 = 101; | |
173 | + kb.NumPad_6 = 102; | |
174 | + kb.NumPad_7 = 103; | |
175 | + kb.NumPad_8 = 104; | |
176 | + kb.NumPad_9 = 105; | |
177 | + kb.NumPad_Asterisk = 106; | |
178 | + kb.NumPad_Plus = 107; | |
179 | + kb.NumPad_Minus = 109; | |
180 | + kb.NumPad_Period = 110; | |
181 | + kb.NumPad_Slash = 111; | |
182 | + kb.F1 = 112; | |
183 | + kb.F2 = 113; | |
184 | + kb.F3 = 114; | |
185 | + kb.F4 = 115; | |
186 | + kb.F5 = 116; | |
187 | + kb.F6 = 117; | |
188 | + kb.F7 = 118; | |
189 | + kb.F8 = 119; | |
190 | + kb.F9 = 120; | |
191 | + kb.F10 = 121; | |
192 | + kb.F11 = 122; | |
193 | + kb.F12 = 123; | |
194 | + kb.NumLock = 144; | |
195 | + kb.ScrollLock = 145; | |
196 | + kb.Semicolon = 186; | |
197 | + kb.Equals = 187; | |
198 | + kb.Comma = 188; | |
199 | + kb.Minus = 189; | |
200 | + kb.Dash = 189; | |
201 | + kb.Period = 190; | |
202 | + kb.Dot = 190; | |
203 | + kb.Slash = 191; | |
204 | + kb.Grave = 192; | |
205 | + kb.OpeningBrace = 219; | |
206 | + kb.BackSlash = 220; | |
207 | + kb.ClosingBrace = 221; | |
208 | + kb.SingleQuote = 222; | |
209 | + | |
210 | + | |
211 | + return kb; | |
212 | +}()); | |
213 | + | |
214 | +// if inside a browser module will be undefined | |
215 | +if(typeof exports !== "undefined" && this.exports !== exports) | |
216 | + module.exports = Keyboard; |