simple-keyboard/docs/index.json

2695 lines
130 KiB
JSON
Raw Normal View History

2018-10-25 06:18:24 +08:00
[
{
"__docId__": 1,
"kind": "external",
"name": "Infinity",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Infinity",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 2,
"kind": "external",
"name": "NaN",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~NaN",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 3,
"kind": "external",
"name": "undefined",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~undefined",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 4,
"kind": "external",
"name": "null",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~null",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 5,
"kind": "external",
"name": "Object",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Object",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 6,
"kind": "external",
"name": "object",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~object",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 7,
"kind": "external",
"name": "Function",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Function",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 8,
"kind": "external",
"name": "function",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~function",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 9,
"kind": "external",
"name": "Boolean",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Boolean",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 10,
"kind": "external",
"name": "boolean",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~boolean",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 11,
"kind": "external",
"name": "Symbol",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Symbol",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 12,
"kind": "external",
"name": "Error",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Error",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 13,
"kind": "external",
"name": "EvalError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~EvalError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 14,
"kind": "external",
"name": "InternalError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~InternalError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 15,
"kind": "external",
"name": "RangeError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~RangeError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 16,
"kind": "external",
"name": "ReferenceError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~ReferenceError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 17,
"kind": "external",
"name": "SyntaxError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~SyntaxError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 18,
"kind": "external",
"name": "TypeError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~TypeError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 19,
"kind": "external",
"name": "URIError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~URIError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 20,
"kind": "external",
"name": "Number",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Number",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 21,
"kind": "external",
"name": "number",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~number",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 22,
"kind": "external",
"name": "Date",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Date",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 23,
"kind": "external",
"name": "String",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~String",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 24,
"kind": "external",
"name": "string",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~string",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 25,
"kind": "external",
"name": "RegExp",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~RegExp",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 26,
"kind": "external",
"name": "Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 27,
"kind": "external",
"name": "Int8Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Int8Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 28,
"kind": "external",
"name": "Uint8Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint8Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 29,
"kind": "external",
"name": "Uint8ClampedArray",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint8ClampedArray",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 30,
"kind": "external",
"name": "Int16Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Int16Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 31,
"kind": "external",
"name": "Uint16Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint16Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 32,
"kind": "external",
"name": "Int32Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Int32Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 33,
"kind": "external",
"name": "Uint32Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint32Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 34,
"kind": "external",
"name": "Float32Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Float32Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 35,
"kind": "external",
"name": "Float64Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Float64Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 36,
"kind": "external",
"name": "Map",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Map",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 37,
"kind": "external",
"name": "Set",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Set",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 38,
"kind": "external",
"name": "WeakMap",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~WeakMap",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 39,
"kind": "external",
"name": "WeakSet",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~WeakSet",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 40,
"kind": "external",
"name": "ArrayBuffer",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~ArrayBuffer",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 41,
"kind": "external",
"name": "DataView",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~DataView",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 42,
"kind": "external",
"name": "JSON",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~JSON",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 43,
"kind": "external",
"name": "Promise",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Promise",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 44,
"kind": "external",
"name": "Generator",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Generator",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 45,
"kind": "external",
"name": "GeneratorFunction",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~GeneratorFunction",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 46,
"kind": "external",
"name": "Reflect",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Reflect",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 47,
"kind": "external",
"name": "Proxy",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Proxy",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 48,
"kind": "file",
"name": "src/demo/App.js",
2018-11-25 10:12:28 +08:00
"content": "import Keyboard from '../lib';\r\nimport './css/App.css';\r\n\r\n/**\r\n * simple-keyboard demo\r\n */\r\nclass App {\r\n /**\r\n * Instantiates the demo class\r\n */\r\n constructor(){\r\n document.addEventListener('DOMContentLoaded', this.onDOMLoaded);\r\n\r\n /**\r\n * Default input name\r\n * @type {string}\r\n */\r\n this.layoutName = \"default\";\r\n }\r\n\r\n /**\r\n * Executed when the DOM is ready\r\n */\r\n onDOMLoaded = () => {\r\n /**\r\n * Creates a new simple-keyboard instance\r\n */\r\n this.keyboard = new Keyboard({\r\n debug: true,\r\n layoutName: this.layoutName,\r\n onChange: input => this.onChange(input),\r\n onKeyPress: button => this.onKeyPress(button),\r\n newLineOnEnter: true,\r\n physicalKeyboardHighlight: true,\r\n });\r\n \r\n /**\r\n * Adding preview (demo only)\r\n */\r\n document.querySelector('.simple-keyboard').insertAdjacentHTML('beforebegin', `\r\n <div class=\"simple-keyboard-preview\">\r\n <textarea class=\"input\"></textarea>\r\n </div>\r\n `);\r\n \r\n document.querySelector('.input').addEventListener('input', (event) => {\r\n this.keyboard.setInput(event.target.value);\r\n });\r\n }\r\n\r\n /**\r\n * Handles shift functionality\r\n */\r\n handleShiftButton = () => {\r\n let layoutName = this.layoutName;\r\n let shiftToggle = this.layoutName = layoutName === \"default\" ? \"shift\" : \"default\";\r\n \r\n this.keyboard.setOptions({\r\n layoutName: shiftToggle\r\n });\r\n }\r\n\r\n /**\r\n * Called when simple-keyboard input has changed\r\n */\r\n onChange = input => {\r\n document.querySelector('.input').value = input;\r\n }\r\n\r\n /**\r\n * Called when a simple-keyboard key is pressed\r\n */\r\n onKeyPress = button => {\r\n console.log(\"Button pressed\", button);\r\n \r\n /**\r\n * Shift functionality\r\n */\r\n if(button === \"{lock}\" || button === \"{shift}\")\r\n this.handleShiftButton();\r\n }\r\n\r\n}\r\n\r\nexport default App;",
2018-10-25 06:18:24 +08:00
"static": true,
2018-11-25 10:12:28 +08:00
"longname": "X:/Dev/simple-keyboard/src/demo/App.js",
2018-10-25 06:18:24 +08:00
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 49,
"kind": "class",
"name": "App",
"memberof": "src/demo/App.js",
"static": true,
"longname": "src/demo/App.js~App",
"access": "public",
"export": true,
"importPath": "simple-keyboard/src/demo/App.js",
"importStyle": "App",
"description": "simple-keyboard demo",
"lineNumber": 7,
"interface": false
},
{
"__docId__": 50,
"kind": "constructor",
"name": "constructor",
"memberof": "src/demo/App.js~App",
"generator": false,
"async": false,
"static": false,
"longname": "src/demo/App.js~App#constructor",
"access": "public",
"description": "Instantiates the demo class",
"lineNumber": 11
},
{
"__docId__": 51,
"kind": "member",
"name": "layoutName",
"memberof": "src/demo/App.js~App",
"static": false,
"longname": "src/demo/App.js~App#layoutName",
"access": "public",
"description": "Default input name",
"lineNumber": 18,
"type": {
"nullable": null,
"types": [
"string"
],
"spread": false,
"description": null
}
},
{
"__docId__": 52,
"kind": "member",
"name": "onDOMLoaded",
"memberof": "src/demo/App.js~App",
"static": false,
"longname": "src/demo/App.js~App#onDOMLoaded",
"access": "public",
"description": "Executed when the DOM is ready",
"lineNumber": 24,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 53,
"kind": "member",
"name": "keyboard",
"memberof": "src/demo/App.js~App",
"longname": "src/demo/App.js~App#keyboard",
"access": "public",
"description": "Creates a new simple-keyboard instance",
"lineNumber": 28,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 54,
"kind": "member",
"name": "handleShiftButton",
"memberof": "src/demo/App.js~App",
"static": false,
"longname": "src/demo/App.js~App#handleShiftButton",
"access": "public",
2018-10-25 08:20:28 +08:00
"description": "Handles shift functionality",
2018-11-10 00:06:46 +08:00
"lineNumber": 54,
2018-10-25 06:18:24 +08:00
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 55,
"kind": "member",
"name": "onChange",
"memberof": "src/demo/App.js~App",
"static": false,
"longname": "src/demo/App.js~App#onChange",
"access": "public",
"description": "Called when simple-keyboard input has changed",
2018-11-10 00:06:46 +08:00
"lineNumber": 66,
2018-10-25 06:18:24 +08:00
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 56,
"kind": "member",
"name": "onKeyPress",
"memberof": "src/demo/App.js~App",
"static": false,
"longname": "src/demo/App.js~App#onKeyPress",
"access": "public",
"description": "Called when a simple-keyboard key is pressed",
2018-11-10 00:06:46 +08:00
"lineNumber": 73,
2018-10-25 06:18:24 +08:00
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 57,
"kind": "file",
"name": "src/demo/index.js",
"content": "import App from './App';\r\n\r\n/**\r\n * Initializing demo\r\n */\r\nnew App();",
"static": true,
2018-11-25 10:12:28 +08:00
"longname": "X:/Dev/simple-keyboard/src/demo/index.js",
2018-10-25 06:18:24 +08:00
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 58,
"kind": "file",
"name": "src/lib/components/Keyboard.js",
2018-11-25 10:12:28 +08:00
"content": "import './Keyboard.css';\r\n\r\n// Services\r\nimport PhysicalKeyboard from '../services/PhysicalKeyboard';\r\nimport KeyboardLayout from '../services/KeyboardLayout';\r\nimport Utilities from '../services/Utilities';\r\n\r\n/**\r\n * Root class for simple-keyboard\r\n * This class:\r\n * - Parses the options\r\n * - Renders the rows and buttons\r\n * - Handles button functionality\r\n */\r\nclass SimpleKeyboard {\r\n /**\r\n * Creates an instance of SimpleKeyboard\r\n * @param {Array} params If first parameter is a string, it is considered the container class. The second parameter is then considered the options object. If first parameter is an object, it is considered the options object.\r\n */\r\n constructor(...params){\r\n let keyboardDOMQuery = typeof params[0] === \"string\" ? params[0] : '.simple-keyboard';\r\n let options = typeof params[0] === \"object\" ? params[0] : params[1];\r\n\r\n if(!options)\r\n options = {};\r\n\r\n /**\r\n * Initializing Utilities\r\n */\r\n this.utilities = new Utilities(this);\r\n\r\n /**\r\n * Processing options\r\n */\r\n this.keyboardDOM = document.querySelector(keyboardDOMQuery);\r\n\r\n /**\r\n * @type {object}\r\n * @property {object} layout Modify the keyboard layout.\r\n * @property {string} layoutName Specifies which layout should be used.\r\n * @property {object} display Replaces variable buttons (such as {bksp}) with a human-friendly name (e.g.: backspace).\r\n * @property {boolean} mergeDisplay By default, when you set the display property, you replace the default one. This setting merges them instead.\r\n * @property {string} theme A prop to add your own css classes to the keyboard wrapper. You can add multiple classes separated by a space.\r\n * @property {Array} buttonTheme A prop to add your own css classes to one or several buttons.\r\n * @property {boolean} debug Runs a console.log every time a key is pressed. Displays the buttons pressed and the current input.\r\n * @property {boolean} newLineOnEnter Specifies whether clicking the ENTER button will input a newline (\\n) or not.\r\n * @property {boolean} tabCharOnTab Specifies whether clicking the TAB button will input a tab character (\\t) or not.\r\n * @property {string} inputName Allows you to use a single simple-keyboard instance for several inputs.\r\n * @property {number} maxLength Restrains all of simple-keyboard inputs to a certain length. This should be used in addition to the input elements maxlengthattribute.\r\n * @property {object} maxLength Restrains simple-keyboards individual inputs to a certain length. This should be used in addition to the input elements maxlengthattribute.\r\n * @property {boolean} syncInstanceInputs When set to true, this option synchronizes the internal input of every simple-keyboard instance.\r\n * @property {boolean} physicalKeyboardHighlight Enable highlighting of keys pressed on physical keyboard.\r\n * @property {boolean} preventMouseDownDefault Calling preventDefault for the mousedown events keeps the focus on the input.\r\n * @property {string} physicalKeyboardHighlightTextColor Define the text color that the physical keyboard highlighted key should have.\r\n * @property {string} physicalKeyboardHighlightBgColor Define the background color that the physical keyboard highlighted key should have.\r\n * @property {function(button: string):string} onKeyPress Executes the callback function on key press. Returns button layout name (i.e.: {shift}).\r\n * @property {function(input: string):string} onChange Executes the callback function on input change. Returns the current inputs string.\r\n * @property {function} onRender Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).\r\n * @property {function} onInit Executes the callback function once simple-keyboard is rendered for the first time (on initialization).\r\n * @property {function(i
2018-10-25 06:18:24 +08:00
"static": true,
2018-11-25 10:12:28 +08:00
"longname": "X:/Dev/simple-keyboard/src/lib/components/Keyboard.js",
2018-10-25 06:18:24 +08:00
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 59,
"kind": "class",
"name": "SimpleKeyboard",
"memberof": "src/lib/components/Keyboard.js",
"static": true,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard",
"access": "public",
"export": true,
"importPath": "simple-keyboard/src/lib/components/Keyboard.js",
"importStyle": "SimpleKeyboard",
"description": "Root class for simple-keyboard\nThis class:\n- Parses the options\n- Renders the rows and buttons\n- Handles button functionality",
"lineNumber": 15,
"interface": false
},
{
"__docId__": 60,
"kind": "constructor",
"name": "constructor",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#constructor",
"access": "public",
"description": "Creates an instance of SimpleKeyboard",
"lineNumber": 20,
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "params",
"description": "If first parameter is a string, it is considered the container class. The second parameter is then considered the options object. If first parameter is an object, it is considered the options object."
}
]
},
{
"__docId__": 61,
"kind": "member",
"name": "utilities",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#utilities",
"access": "public",
"description": "Initializing Utilities",
"lineNumber": 30,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 62,
"kind": "member",
"name": "keyboardDOM",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#keyboardDOM",
"access": "public",
"description": "Processing options",
"lineNumber": 35,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 63,
"kind": "member",
"name": "options",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#options",
"access": "public",
"description": "",
2018-11-25 09:12:52 +08:00
"lineNumber": 62,
2018-10-25 06:18:24 +08:00
"properties": [
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "layout",
"description": "Modify the keyboard layout."
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "layoutName",
"description": "Specifies which layout should be used."
},
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "display",
"description": "Replaces variable buttons (such as {bksp}) with a human-friendly name (e.g.: “backspace”)."
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "mergeDisplay",
"description": "By default, when you set the display property, you replace the default one. This setting merges them instead."
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "theme",
"description": "A prop to add your own css classes to the keyboard wrapper. You can add multiple classes separated by a space."
},
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "buttonTheme",
"description": "A prop to add your own css classes to one or several buttons."
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "debug",
"description": "Runs a console.log every time a key is pressed. Displays the buttons pressed and the current input."
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "newLineOnEnter",
"description": "Specifies whether clicking the “ENTER” button will input a newline (\\n) or not."
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "tabCharOnTab",
"description": "Specifies whether clicking the “TAB” button will input a tab character (\\t) or not."
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "inputName",
"description": "Allows you to use a single simple-keyboard instance for several inputs."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "maxLength",
"description": "Restrains all of simple-keyboard inputs to a certain length. This should be used in addition to the input elements maxlengthattribute."
},
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "maxLength",
"description": "Restrains simple-keyboards individual inputs to a certain length. This should be used in addition to the input elements maxlengthattribute."
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "syncInstanceInputs",
"description": "When set to true, this option synchronizes the internal input of every simple-keyboard instance."
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "physicalKeyboardHighlight",
"description": "Enable highlighting of keys pressed on physical keyboard."
},
2018-11-25 09:12:52 +08:00
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "preventMouseDownDefault",
"description": "Calling preventDefault for the mousedown events keeps the focus on the input."
},
2018-10-25 06:18:24 +08:00
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "physicalKeyboardHighlightTextColor",
"description": "Define the text color that the physical keyboard highlighted key should have."
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "physicalKeyboardHighlightBgColor",
"description": "Define the background color that the physical keyboard highlighted key should have."
},
{
"nullable": null,
"types": [
"function(button: string):string"
],
"spread": false,
"optional": false,
"name": "onKeyPress",
"description": "Executes the callback function on key press. Returns button layout name (i.e.: “{shift}”)."
},
{
"nullable": null,
"types": [
"function(input: string):string"
],
"spread": false,
"optional": false,
"name": "onChange",
"description": "Executes the callback function on input change. Returns the current inputs string."
},
{
"nullable": null,
"types": [
"function"
],
"spread": false,
"optional": false,
"name": "onRender",
"description": "Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts)."
},
{
"nullable": null,
"types": [
"function"
],
"spread": false,
"optional": false,
"name": "onInit",
"description": "Executes the callback function once simple-keyboard is rendered for the first time (on initialization)."
},
{
"nullable": null,
"types": [
"function(inputs: object):object"
],
"spread": false,
"optional": false,
"name": "onChangeAll",
"description": "Executes the callback function on input change. Returns the input object with all defined inputs."
}
],
"type": {
"nullable": null,
"types": [
"object"
],
"spread": false,
"description": null
}
},
{
2018-11-01 07:47:03 +08:00
"__docId__": 64,
"kind": "member",
"name": "keyboardPluginClasses",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#keyboardPluginClasses",
"access": "public",
"description": "",
2018-11-25 09:12:52 +08:00
"lineNumber": 71,
2018-11-01 07:47:03 +08:00
"type": {
"nullable": null,
"types": [
"object"
],
"spread": false,
"description": null
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 86,
2018-10-31 11:33:29 +08:00
"kind": "member",
2018-10-25 06:18:24 +08:00
"name": "input",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#input",
"access": "public",
"description": "simple-keyboard uses a non-persistent internal input to keep track of the entered string (the variable `keyboard.input`).\nThis removes any dependency to input DOM elements. You can type and directly display the value in a div element, for example.",
"examples": [
"// To get entered input\nlet input = keyboard.getInput();\n\n// To clear entered input.\nkeyboard.clearInput();"
],
2018-11-25 09:12:52 +08:00
"lineNumber": 112,
2018-10-25 06:18:24 +08:00
"properties": [
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "default",
"description": "Default SimpleKeyboard internal input."
},
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "myInputName",
"description": "Example input that can be set through `options.inputName:\"myInputName\"`."
}
],
"type": {
"nullable": null,
"types": [
"object"
],
"spread": false,
"description": null
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 87,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "keyboardDOMClass",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#keyboardDOMClass",
"access": "public",
"description": "",
2018-11-25 09:12:52 +08:00
"lineNumber": 118,
2018-10-25 06:18:24 +08:00
"type": {
"nullable": null,
"types": [
"string"
],
"spread": false,
"description": null
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 88,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "buttonElements",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#buttonElements",
"access": "public",
"description": "",
2018-11-25 09:12:52 +08:00
"lineNumber": 123,
2018-10-25 06:18:24 +08:00
"type": {
"nullable": null,
"types": [
"object"
],
"spread": false,
"description": null
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 89,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "physicalKeyboardInterface",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#physicalKeyboardInterface",
"access": "public",
"description": "Physical Keyboard support",
2018-11-25 09:12:52 +08:00
"lineNumber": 147,
2018-10-25 06:18:24 +08:00
"type": {
"types": [
"*"
]
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 90,
2018-11-01 05:56:32 +08:00
"kind": "member",
"name": "modules",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#modules",
"access": "public",
"description": "Modules",
2018-11-25 09:12:52 +08:00
"lineNumber": 152,
2018-11-01 05:56:32 +08:00
"type": {
"types": [
"{}"
]
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 91,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "handleButtonClicked",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#handleButtonClicked",
"access": "public",
"description": "Handles clicks made to keyboard buttons",
2018-11-25 09:12:52 +08:00
"lineNumber": 160,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "button",
"description": "The button's layout name."
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
2018-10-31 11:33:29 +08:00
"boolean"
2018-10-25 06:18:24 +08:00
]
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 92,
2018-11-01 05:56:32 +08:00
"kind": "method",
"name": "handleButtonMouseDown",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#handleButtonMouseDown",
"access": "public",
"description": "Handles button mousedown",
2018-11-25 09:12:52 +08:00
"lineNumber": 220,
2018-11-01 05:56:32 +08:00
"params": [
{
"name": "button",
"types": [
"*"
]
},
{
"name": "e",
"types": [
"*"
]
}
],
"return": null
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 93,
2018-11-01 05:56:32 +08:00
"kind": "member",
"name": "isMouseHold",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#isMouseHold",
"access": "public",
"description": "",
2018-11-25 09:12:52 +08:00
"lineNumber": 224,
2018-11-01 05:56:32 +08:00
"type": {
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"description": null
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 94,
2018-11-01 05:56:32 +08:00
"kind": "member",
"name": "holdTimeout",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#holdTimeout",
"access": "public",
"description": "",
2018-11-25 09:12:52 +08:00
"lineNumber": 235,
2018-11-01 05:56:32 +08:00
"type": {
"nullable": null,
"types": [
"object"
],
"spread": false,
"description": null
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 95,
2018-11-01 05:56:32 +08:00
"kind": "method",
"name": "handleButtonMouseUp",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#handleButtonMouseUp",
"access": "public",
"description": "Handles button mouseup",
2018-11-25 09:12:52 +08:00
"lineNumber": 257,
2018-11-01 05:56:32 +08:00
"params": [],
"return": null
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 97,
2018-11-01 05:56:32 +08:00
"kind": "method",
"name": "handleButtonHold",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#handleButtonHold",
"access": "public",
"description": "Handles button hold",
2018-11-25 09:12:52 +08:00
"lineNumber": 267,
2018-11-01 05:56:32 +08:00
"params": [
{
"name": "button",
"types": [
"*"
]
}
],
"return": null
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 98,
2018-11-01 05:56:32 +08:00
"kind": "member",
"name": "holdInteractionTimeout",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#holdInteractionTimeout",
"access": "public",
"description": "",
2018-11-25 09:12:52 +08:00
"lineNumber": 274,
2018-11-01 05:56:32 +08:00
"type": {
"nullable": null,
"types": [
"object"
],
"spread": false,
"description": null
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 99,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "syncInstanceInputs",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#syncInstanceInputs",
"access": "public",
"description": "Send a command to all simple-keyboard instances (if you have several instances).",
2018-11-25 09:12:52 +08:00
"lineNumber": 287,
2018-10-31 11:33:29 +08:00
"params": [],
"return": null
2018-10-25 06:18:24 +08:00
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 100,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "clearInput",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#clearInput",
"access": "public",
"description": "Clear the keyboards input.",
2018-11-25 09:12:52 +08:00
"lineNumber": 297,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": true,
"name": "inputName",
"description": "optional - the internal input to select"
}
],
2018-10-31 11:33:29 +08:00
"return": null
2018-10-25 06:18:24 +08:00
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 101,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "getInput",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#getInput",
"access": "public",
"description": "Get the keyboards input (You can also get it from the onChange prop).",
2018-11-25 09:12:52 +08:00
"lineNumber": 312,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": true,
"name": "inputName",
"description": "optional - the internal input to select"
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
"*"
]
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 102,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "setInput",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#setInput",
"access": "public",
"description": "Set the keyboards input.",
2018-11-25 09:12:52 +08:00
"lineNumber": 329,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "input",
"description": "the input value"
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "inputName",
"description": "optional - the internal input to select"
}
],
2018-10-31 11:33:29 +08:00
"return": null
2018-10-25 06:18:24 +08:00
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 103,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "replaceInput",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#replaceInput",
"access": "public",
"description": "Replace the input object (`keyboard.input`)",
2018-11-25 09:12:52 +08:00
"lineNumber": 344,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "inputObj",
"description": "The input object"
}
],
2018-10-31 11:33:29 +08:00
"return": null
2018-10-25 06:18:24 +08:00
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 105,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "setOptions",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#setOptions",
"access": "public",
"description": "Set new option or modify existing ones after initialization. ",
2018-11-25 09:12:52 +08:00
"lineNumber": 352,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "option",
"description": "The option to set"
}
],
"type": {
"types": [
"*"
]
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 107,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "clear",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#clear",
"access": "public",
"description": "Remove all keyboard rows and reset keyboard values.\nUsed interally between re-renders.",
2018-11-25 09:12:52 +08:00
"lineNumber": 362,
2018-10-31 11:33:29 +08:00
"params": [],
"return": null
2018-10-25 06:18:24 +08:00
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 109,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "dispatch",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#dispatch",
"access": "public",
"description": "Send a command to all simple-keyboard instances at once (if you have multiple instances).",
2018-11-25 09:12:52 +08:00
"lineNumber": 372,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"function(instance: object, key: string)"
],
"spread": false,
"optional": false,
"name": "callback",
"description": "Function to run on every instance"
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
"*"
]
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 110,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "addButtonTheme",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#addButtonTheme",
"access": "public",
"description": "Adds/Modifies an entry to the `buttonTheme`. Basically a way to add a class to a button.",
2018-11-25 09:12:52 +08:00
"lineNumber": 388,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "buttons",
"description": "List of buttons to select (separated by a space)."
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "className",
"description": "Classes to give to the selected buttons (separated by space)."
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
2018-10-31 11:33:29 +08:00
"boolean"
2018-10-25 06:18:24 +08:00
]
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 111,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "removeButtonTheme",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#removeButtonTheme",
"access": "public",
"description": "Removes/Amends an entry to the `buttonTheme`. Basically a way to remove a class previously added to a button through buttonTheme or addButtonTheme.",
2018-11-25 09:12:52 +08:00
"lineNumber": 438,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "buttons",
"description": "List of buttons to select (separated by a space)."
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "className",
"description": "Classes to give to the selected buttons (separated by space)."
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
2018-10-31 11:33:29 +08:00
"boolean"
2018-10-25 06:18:24 +08:00
]
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 112,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "getButtonElement",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#getButtonElement",
"access": "public",
"description": "Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements is returned.",
2018-11-25 09:12:52 +08:00
"lineNumber": 490,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "button",
"description": "The button layout name to select"
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
"*"
]
}
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 113,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "handleCaret",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#handleCaret",
"access": "public",
"description": "Retrieves the current cursor position within a input or textarea (if any)",
2018-11-25 09:12:52 +08:00
"lineNumber": 508,
2018-10-31 11:33:29 +08:00
"params": [],
"return": null
2018-10-25 06:18:24 +08:00
},
{
2018-11-01 12:14:02 +08:00
"__docId__": 114,
2018-11-25 10:12:28 +08:00
"kind": "member",
"name": "caretPosition",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#caretPosition",
"access": "public",
"description": "Only first instance should insall the caret handling events",
"lineNumber": 512,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 115,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "caretEventHandler",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#caretEventHandler",
"access": "public",
"description": "Called by {@link handleCaret} when an event that warrants a cursor position update is triggered",
2018-11-25 10:12:28 +08:00
"lineNumber": 535,
2018-10-31 11:33:29 +08:00
"params": [
{
"name": "event",
"types": [
"*"
]
}
],
"return": null
2018-10-25 06:18:24 +08:00
},
{
2018-11-25 09:12:52 +08:00
"__docId__": 116,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "onInit",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#onInit",
"access": "public",
"description": "Executes the callback function once simple-keyboard is rendered for the first time (on initialization).",
2018-11-25 10:12:28 +08:00
"lineNumber": 567,
2018-10-31 11:33:29 +08:00
"params": [],
"return": null
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 117,
2018-10-31 11:33:29 +08:00
"kind": "method",
"name": "onRender",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#onRender",
"access": "public",
"description": "Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).",
2018-11-25 10:12:28 +08:00
"lineNumber": 584,
2018-10-31 11:33:29 +08:00
"params": [],
"return": null
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 118,
2018-11-01 12:14:02 +08:00
"kind": "method",
"name": "onModulesLoaded",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#onModulesLoaded",
"access": "public",
"description": "Executes the callback function once all modules have been loaded",
2018-11-25 10:12:28 +08:00
"lineNumber": 592,
2018-11-01 12:14:02 +08:00
"params": [],
"return": null
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 119,
2018-10-31 11:33:29 +08:00
"kind": "member",
"name": "registerModule",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#registerModule",
"access": "public",
"description": "Register module",
2018-11-25 10:12:28 +08:00
"lineNumber": 600,
2018-10-25 06:18:24 +08:00
"type": {
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 120,
2018-11-01 05:56:32 +08:00
"kind": "method",
"name": "loadModules",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#loadModules",
"access": "public",
"description": "Load modules",
2018-11-25 10:12:28 +08:00
"lineNumber": 610,
2018-11-01 05:56:32 +08:00
"params": [],
"return": null
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 123,
2018-10-25 06:18:24 +08:00
"kind": "member",
2018-10-31 11:33:29 +08:00
"name": "getModuleProp",
2018-10-25 06:18:24 +08:00
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
2018-10-31 11:33:29 +08:00
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#getModuleProp",
2018-10-25 06:18:24 +08:00
"access": "public",
2018-10-31 11:33:29 +08:00
"description": "Get module prop",
2018-11-25 10:12:28 +08:00
"lineNumber": 634,
2018-10-25 06:18:24 +08:00
"type": {
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 124,
2018-10-25 06:18:24 +08:00
"kind": "member",
2018-10-31 11:33:29 +08:00
"name": "getModulesList",
2018-10-25 06:18:24 +08:00
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"static": false,
2018-10-31 11:33:29 +08:00
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#getModulesList",
2018-10-25 06:18:24 +08:00
"access": "public",
2018-10-31 11:33:29 +08:00
"description": "getModulesList",
2018-11-25 10:12:28 +08:00
"lineNumber": 644,
2018-10-25 06:18:24 +08:00
"type": {
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 125,
2018-10-31 11:33:29 +08:00
"kind": "method",
"name": "render",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#render",
"access": "public",
"description": "Renders rows and buttons as per options",
2018-11-25 10:12:28 +08:00
"lineNumber": 651,
2018-10-31 11:33:29 +08:00
"params": [],
"return": null
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 127,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "initialized",
"memberof": "src/lib/components/Keyboard.js~SimpleKeyboard",
2018-10-31 11:33:29 +08:00
"static": false,
2018-10-25 06:18:24 +08:00
"longname": "src/lib/components/Keyboard.js~SimpleKeyboard#initialized",
"access": "public",
"description": "Ensures that onInit is only called once per instantiation",
2018-11-25 10:12:28 +08:00
"lineNumber": 798,
2018-10-25 06:18:24 +08:00
"type": {
"types": [
"boolean"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 128,
2018-10-25 06:18:24 +08:00
"kind": "file",
"name": "src/lib/index.js",
"content": "import SimpleKeyboard from './components/Keyboard';\r\nexport default SimpleKeyboard;\r\n",
"static": true,
2018-11-25 10:12:28 +08:00
"longname": "X:/Dev/simple-keyboard/src/lib/index.js",
2018-10-25 06:18:24 +08:00
"access": "public",
"description": null,
"lineNumber": 1
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 129,
2018-10-25 06:18:24 +08:00
"kind": "file",
"name": "src/lib/services/KeyboardLayout.js",
2018-10-31 11:33:29 +08:00
"content": "/**\r\n * Keyboard Layout Service\r\n */\r\nclass KeyboardLayout {\r\n /**\r\n * Get default simple-keyboard layout\r\n * @return {object} The default layout (US-QWERTY)\r\n */\r\n static getDefaultLayout(){\r\n return {\r\n 'default': [\r\n '` 1 2 3 4 5 6 7 8 9 0 - = {bksp}',\r\n '{tab} q w e r t y u i o p [ ] \\\\',\r\n '{lock} a s d f g h j k l ; \\' {enter}',\r\n '{shift} z x c v b n m , . / {shift}',\r\n '.com @ {space}'\r\n ],\r\n 'shift': [\r\n '~ ! @ # $ % ^ & * ( ) _ + {bksp}',\r\n '{tab} Q W E R T Y U I O P { } |',\r\n '{lock} A S D F G H J K L : \" {enter}',\r\n '{shift} Z X C V B N M < > ? {shift}',\r\n '.com @ {space}'\r\n ]\r\n } \r\n }\r\n}\r\n\r\nexport default KeyboardLayout;",
2018-10-25 06:18:24 +08:00
"static": true,
2018-11-25 10:12:28 +08:00
"longname": "X:/Dev/simple-keyboard/src/lib/services/KeyboardLayout.js",
2018-10-25 06:18:24 +08:00
"access": "public",
"description": null,
"lineNumber": 1
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 130,
2018-10-25 06:18:24 +08:00
"kind": "class",
"name": "KeyboardLayout",
"memberof": "src/lib/services/KeyboardLayout.js",
"static": true,
"longname": "src/lib/services/KeyboardLayout.js~KeyboardLayout",
"access": "public",
"export": true,
"importPath": "simple-keyboard/src/lib/services/KeyboardLayout.js",
"importStyle": "KeyboardLayout",
"description": "Keyboard Layout Service",
"lineNumber": 4,
"interface": false
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 131,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "getDefaultLayout",
"memberof": "src/lib/services/KeyboardLayout.js~KeyboardLayout",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": true,
"longname": "src/lib/services/KeyboardLayout.js~KeyboardLayout.getDefaultLayout",
"access": "public",
"description": "Get default simple-keyboard layout",
2018-10-31 11:33:29 +08:00
"lineNumber": 9,
2018-10-25 06:18:24 +08:00
"return": {
"nullable": null,
"types": [
"object"
],
"spread": false,
"description": "The default layout (US-QWERTY)"
},
2018-10-31 11:33:29 +08:00
"params": []
2018-10-25 06:18:24 +08:00
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 132,
2018-10-25 06:18:24 +08:00
"kind": "file",
"name": "src/lib/services/PhysicalKeyboard.js",
2018-11-10 00:06:46 +08:00
"content": "/**\r\n * Physical Keyboard Service\r\n */\r\nclass PhysicalKeyboard {\r\n /**\r\n * Creates an instance of the PhysicalKeyboard service\r\n */\r\n constructor(simpleKeyboardInstance){\r\n /**\r\n * @type {object} A simple-keyboard instance\r\n */\r\n this.simpleKeyboardInstance = simpleKeyboardInstance;\r\n\r\n /**\r\n * Bindings\r\n */\r\n this.initKeyboardListener = this.initKeyboardListener.bind(this);\r\n this.getSimpleKeyboardLayoutKey = this.getSimpleKeyboardLayoutKey.bind(this);\r\n\r\n /**\r\n * Initialize key listeners\r\n */\r\n this.initKeyboardListener();\r\n }\r\n\r\n /**\r\n * Initializes key event listeners\r\n */\r\n initKeyboardListener(){\r\n // Adding button style on keydown\r\n document.addEventListener(\"keydown\", (event) => {\r\n if(this.simpleKeyboardInstance.options.physicalKeyboardHighlight){\r\n let buttonPressed = this.getSimpleKeyboardLayoutKey(event);\r\n\r\n this.simpleKeyboardInstance.dispatch(instance => {\r\n let buttonDOM = instance.getButtonElement(buttonPressed) || instance.getButtonElement(`{${buttonPressed}}`);\r\n\r\n if(buttonDOM){\r\n buttonDOM.style.backgroundColor = this.simpleKeyboardInstance.options.physicalKeyboardHighlightBgColor || \"#9ab4d0\";\r\n buttonDOM.style.color = this.simpleKeyboardInstance.options.physicalKeyboardHighlightTextColor || \"white\";\r\n }\r\n });\r\n }\r\n });\r\n\r\n // Removing button style on keyup\r\n document.addEventListener(\"keyup\", (event) => {\r\n if(this.simpleKeyboardInstance.options.physicalKeyboardHighlight){\r\n let buttonPressed = this.getSimpleKeyboardLayoutKey(event);\r\n\r\n this.simpleKeyboardInstance.dispatch(instance => {\r\n let buttonDOM = instance.getButtonElement(buttonPressed) || instance.getButtonElement(`{${buttonPressed}}`);\r\n\r\n if(buttonDOM && buttonDOM.removeAttribute){\r\n buttonDOM.removeAttribute(\"style\");\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Transforms a KeyboardEvent's \"key.code\" string into a simple-keyboard layout format\r\n * @param {object} event The KeyboardEvent\r\n */\r\n getSimpleKeyboardLayoutKey(event){\r\n let output;\r\n\r\n if(\r\n event.code.includes(\"Numpad\") ||\r\n event.code.includes(\"Shift\") ||\r\n event.code.includes(\"Space\") ||\r\n event.code.includes(\"Backspace\") ||\r\n event.code.includes(\"Control\") ||\r\n event.code.includes(\"Alt\") ||\r\n event.code.includes(\"Meta\")\r\n ){\r\n output = event.code;\r\n } else {\r\n output = event.key;\r\n }\r\n\r\n /**\r\n * If button is not uppercase, casting to lowercase\r\n */\r\n if (\r\n output !== output.toUpperCase() ||\r\n (event.code[0] === \"F\" && Number.isInteger(Number(event.code[1])) && event.code.length <= 3)\r\n ) {\r\n output = output.toLowerCase();\r\n }\r\n\r\n return output;\r\n }\r\n}\r\n\r\nexport default PhysicalKeyboard;",
2018-10-25 06:18:24 +08:00
"static": true,
2018-11-25 10:12:28 +08:00
"longname": "X:/Dev/simple-keyboard/src/lib/services/PhysicalKeyboard.js",
2018-10-25 06:18:24 +08:00
"access": "public",
"description": null,
"lineNumber": 1
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 133,
2018-10-25 06:18:24 +08:00
"kind": "class",
"name": "PhysicalKeyboard",
"memberof": "src/lib/services/PhysicalKeyboard.js",
"static": true,
"longname": "src/lib/services/PhysicalKeyboard.js~PhysicalKeyboard",
"access": "public",
"export": true,
"importPath": "simple-keyboard/src/lib/services/PhysicalKeyboard.js",
"importStyle": "PhysicalKeyboard",
"description": "Physical Keyboard Service",
"lineNumber": 4,
"interface": false
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 134,
2018-10-25 06:18:24 +08:00
"kind": "constructor",
"name": "constructor",
"memberof": "src/lib/services/PhysicalKeyboard.js~PhysicalKeyboard",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/services/PhysicalKeyboard.js~PhysicalKeyboard#constructor",
"access": "public",
"description": "Creates an instance of the PhysicalKeyboard service",
"lineNumber": 8
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 135,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "simpleKeyboardInstance",
"memberof": "src/lib/services/PhysicalKeyboard.js~PhysicalKeyboard",
"static": false,
"longname": "src/lib/services/PhysicalKeyboard.js~PhysicalKeyboard#simpleKeyboardInstance",
"access": "public",
"description": "",
"lineNumber": 12,
"type": {
"nullable": null,
"types": [
"object"
],
"spread": false,
"description": null
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 138,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "initKeyboardListener",
"memberof": "src/lib/services/PhysicalKeyboard.js~PhysicalKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/services/PhysicalKeyboard.js~PhysicalKeyboard#initKeyboardListener",
"access": "public",
"description": "Initializes key event listeners",
2018-10-31 11:33:29 +08:00
"lineNumber": 29,
"params": [],
"return": null
2018-10-25 06:18:24 +08:00
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 139,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "getSimpleKeyboardLayoutKey",
"memberof": "src/lib/services/PhysicalKeyboard.js~PhysicalKeyboard",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/services/PhysicalKeyboard.js~PhysicalKeyboard#getSimpleKeyboardLayoutKey",
"access": "public",
"description": "Transforms a KeyboardEvent's \"key.code\" string into a simple-keyboard layout format",
2018-10-31 11:33:29 +08:00
"lineNumber": 66,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "event",
"description": "The KeyboardEvent"
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 140,
2018-10-25 06:18:24 +08:00
"kind": "file",
"name": "src/lib/services/Utilities.js",
2018-11-25 10:12:28 +08:00
"content": "/**\r\n * Utility Service\r\n */\r\nclass Utilities {\r\n /**\r\n * Creates an instance of the Utility service\r\n */\r\n constructor(simpleKeyboardInstance){\r\n /**\r\n * @type {object} A simple-keyboard instance\r\n */\r\n this.simpleKeyboardInstance = simpleKeyboardInstance;\r\n\r\n /**\r\n * Bindings\r\n */\r\n this.getButtonClass = this.getButtonClass.bind(this);\r\n this.getButtonDisplayName = this.getButtonDisplayName.bind(this);\r\n this.getUpdatedInput = this.getUpdatedInput.bind(this);\r\n this.updateCaretPos = this.updateCaretPos.bind(this);\r\n this.updateCaretPosAction = this.updateCaretPosAction.bind(this);\r\n this.isMaxLengthReached = this.isMaxLengthReached.bind(this);\r\n this.camelCase = this.camelCase.bind(this);\r\n this.countInArray = this.countInArray.bind(this);\r\n }\r\n\r\n /**\r\n * Adds default classes to a given button\r\n * \r\n * @param {string} button The button's layout name\r\n * @return {string} The classes to be added to the button\r\n */\r\n getButtonClass(button){\r\n let buttonTypeClass = (button.includes(\"{\") && button.includes(\"}\") && button !== '{//}') ? \"functionBtn\" : \"standardBtn\";\r\n let buttonWithoutBraces = button.replace(\"{\", \"\").replace(\"}\", \"\");\r\n let buttonNormalized = '';\r\n\r\n if(buttonTypeClass !== \"standardBtn\")\r\n buttonNormalized = ` hg-button-${buttonWithoutBraces}`;\r\n\r\n return `hg-${buttonTypeClass}${buttonNormalized}`;\r\n }\r\n\r\n /**\r\n * Default button display labels\r\n */\r\n getDefaultDiplay(){\r\n return {\r\n '{bksp}': 'backspace',\r\n '{backspace}': 'backspace',\r\n '{enter}': '< enter',\r\n '{shift}': 'shift',\r\n '{shiftleft}': 'shift',\r\n '{shiftright}': 'shift',\r\n '{alt}': 'alt',\r\n '{s}': 'shift',\r\n '{tab}': 'tab',\r\n '{lock}': 'caps',\r\n '{capslock}': 'caps',\r\n '{accept}': 'Submit',\r\n '{space}': ' ',\r\n '{//}': ' ',\r\n \"{esc}\": \"esc\",\r\n \"{escape}\": \"esc\",\r\n \"{f1}\": \"f1\",\r\n \"{f2}\": \"f2\",\r\n \"{f3}\": \"f3\",\r\n \"{f4}\": \"f4\",\r\n \"{f5}\": \"f5\",\r\n \"{f6}\": \"f6\",\r\n \"{f7}\": \"f7\",\r\n \"{f8}\": \"f8\",\r\n \"{f9}\": \"f9\",\r\n \"{f10}\": \"f10\",\r\n \"{f11}\": \"f11\",\r\n \"{f12}\": \"f12\",\r\n '{numpaddivide}': '/',\r\n '{numlock}': 'lock',\r\n \"{arrowup}\": \"↑\",\r\n \"{arrowleft}\": \"←\",\r\n \"{arrowdown}\": \"↓\",\r\n \"{arrowright}\": \"→\",\r\n \"{prtscr}\": \"print\",\r\n \"{scrolllock}\": \"scroll\",\r\n \"{pause}\": \"pause\",\r\n \"{insert}\": \"ins\",\r\n \"{home}\": \"home\",\r\n \"{pageup}\": \"up\",\r\n \"{delete}\": \"del\",\r\n \"{end}\": \"end\",\r\n \"{pagedown}\": \"down\",\r\n \"{numpadmultiply}\": \"*\",\r\n \"{numpadsubtract}\": \"-\",\r\n \"{numpadadd}\": \"+\",\r\n \"{numpadenter}\": \"enter\",\r\n \"{period}\": \".\",\r\n \"{numpaddecimal}\": \".\",\r\n \"{numpad0}\": \"0\",\r\n \"{numpad1}\": \"1\",\r\n \"{numpad2}\": \"2\",\r\n \"{numpad3}\": \"3\",\r\n \"{numpad4}\": \"4\",\r\n \"{numpad5}\": \"5\",\r\n \"{numpad6}\": \"6\",\r\n \"{numpad7}\": \"7\",\r\n \"{numpad8}\": \"8\",\r\n \"{numpad9}\": \"9\",\r\n };\r\n }\r\n /**\r\n * Returns the display (label) name for a given button\r\n * \r\n * @param {string} button The button's layout name\r\n * @param {object} display The provided display option\r\n * @param {boolean} mergeDisplay Whether the provided param value should be merged with the default one.\r\n */\r\n getButtonDisplayName(button, display, mergeDisplay){\r\n if(mergeDisplay){\r\n display = Object.assign({}, this.getDefaultDiplay(), display);\r\n } else {\r\n display = display || this.getDefaultDiplay();\r\n }\r\n\r\n return display[button] || button;\r\n }\r\n\r\n \r
2018-10-25 06:18:24 +08:00
"static": true,
2018-11-25 10:12:28 +08:00
"longname": "X:/Dev/simple-keyboard/src/lib/services/Utilities.js",
2018-10-25 06:18:24 +08:00
"access": "public",
"description": null,
"lineNumber": 1
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 141,
2018-10-25 06:18:24 +08:00
"kind": "class",
"name": "Utilities",
"memberof": "src/lib/services/Utilities.js",
"static": true,
"longname": "src/lib/services/Utilities.js~Utilities",
"access": "public",
"export": true,
"importPath": "simple-keyboard/src/lib/services/Utilities.js",
"importStyle": "Utilities",
"description": "Utility Service",
"lineNumber": 4,
"interface": false
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 142,
2018-10-25 06:18:24 +08:00
"kind": "constructor",
"name": "constructor",
"memberof": "src/lib/services/Utilities.js~Utilities",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#constructor",
"access": "public",
"description": "Creates an instance of the Utility service",
"lineNumber": 8
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 143,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "simpleKeyboardInstance",
"memberof": "src/lib/services/Utilities.js~Utilities",
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#simpleKeyboardInstance",
"access": "public",
"description": "",
"lineNumber": 12,
"type": {
"nullable": null,
"types": [
"object"
],
"spread": false,
"description": null
}
},
{
2018-11-25 09:12:52 +08:00
"__docId__": 152,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "getButtonClass",
"memberof": "src/lib/services/Utilities.js~Utilities",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#getButtonClass",
"access": "public",
"description": "Adds default classes to a given button",
2018-11-25 10:12:28 +08:00
"lineNumber": 33,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "button",
"description": "The button's layout name"
}
],
"return": {
"nullable": null,
"types": [
"string"
],
"spread": false,
"description": "The classes to be added to the button"
}
},
{
2018-11-25 09:12:52 +08:00
"__docId__": 153,
2018-10-25 06:18:24 +08:00
"kind": "method",
"name": "getDefaultDiplay",
"memberof": "src/lib/services/Utilities.js~Utilities",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#getDefaultDiplay",
"access": "public",
"description": "Default button display labels",
2018-11-25 10:12:28 +08:00
"lineNumber": 47,
2018-10-25 06:18:24 +08:00
"params": [],
"return": {
"types": [
"{\"{bksp}\": string, \"{backspace}\": string, \"{enter}\": string, \"{shift}\": string, \"{shiftleft}\": string, \"{shiftright}\": string, \"{alt}\": string, \"{s}\": string, \"{tab}\": string, \"{lock}\": string, \"{capslock}\": string, \"{accept}\": string, \"{space}\": string, \"{//}\": string, \"{esc}\": string, \"{escape}\": string, \"{f1}\": string, \"{f2}\": string, \"{f3}\": string, \"{f4}\": string, \"{f5}\": string, \"{f6}\": string, \"{f7}\": string, \"{f8}\": string, \"{f9}\": string, \"{f10}\": string, \"{f11}\": string, \"{f12}\": string, \"{numpaddivide}\": string, \"{numlock}\": string, \"{arrowup}\": string, \"{arrowleft}\": string, \"{arrowdown}\": string, \"{arrowright}\": string, \"{prtscr}\": string, \"{scrolllock}\": string, \"{pause}\": string, \"{insert}\": string, \"{home}\": string, \"{pageup}\": string, \"{delete}\": string, \"{end}\": string, \"{pagedown}\": string, \"{numpadmultiply}\": string, \"{numpadsubtract}\": string, \"{numpadadd}\": string, \"{numpadenter}\": string, \"{period}\": string, \"{numpaddecimal}\": string, \"{numpad0}\": string, \"{numpad1}\": string, \"{numpad2}\": string, \"{numpad3}\": string, \"{numpad4}\": string, \"{numpad5}\": string, \"{numpad6}\": string, \"{numpad7}\": string, \"{numpad8}\": string, \"{numpad9}\": string}"
]
}
},
{
2018-11-25 09:12:52 +08:00
"__docId__": 154,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "getButtonDisplayName",
"memberof": "src/lib/services/Utilities.js~Utilities",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#getButtonDisplayName",
"access": "public",
"description": "Returns the display (label) name for a given button",
2018-11-25 10:12:28 +08:00
"lineNumber": 117,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "button",
"description": "The button's layout name"
},
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "display",
"description": "The provided display option"
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "mergeDisplay",
"description": "Whether the provided param value should be merged with the default one."
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
"*"
]
}
},
{
2018-11-25 09:12:52 +08:00
"__docId__": 155,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "getUpdatedInput",
"memberof": "src/lib/services/Utilities.js~Utilities",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#getUpdatedInput",
"access": "public",
"description": "Returns the updated input resulting from clicking a given button",
2018-11-25 10:12:28 +08:00
"lineNumber": 137,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "button",
"description": "The button's layout name"
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "input",
"description": "The input string"
},
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "options",
"description": "The simple-keyboard options object"
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "caretPos",
"description": "The cursor's current position"
2018-11-06 06:31:11 +08:00
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "moveCaret",
"description": "Whether to update simple-keyboard's cursor"
2018-10-25 06:18:24 +08:00
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
"*"
]
}
},
{
2018-11-25 09:12:52 +08:00
"__docId__": 156,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "updateCaretPos",
"memberof": "src/lib/services/Utilities.js~Utilities",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#updateCaretPos",
"access": "public",
"description": "Moves the cursor position by a given amount",
2018-11-25 10:12:28 +08:00
"lineNumber": 186,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "length",
"description": "Represents by how many characters the input should be moved"
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "minus",
"description": "Whether the cursor should be moved to the left or not."
}
],
2018-10-31 11:33:29 +08:00
"return": null
2018-10-25 06:18:24 +08:00
},
{
2018-11-25 09:12:52 +08:00
"__docId__": 157,
2018-10-25 06:18:24 +08:00
"kind": "method",
2018-11-25 10:12:28 +08:00
"name": "updateCaretPosAction",
"memberof": "src/lib/services/Utilities.js~Utilities",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#updateCaretPosAction",
"access": "public",
"description": "Action method of updateCaretPos",
"lineNumber": 203,
"params": [
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "instance",
"description": "The instance whose position should be updated"
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "length",
"description": "Represents by how many characters the input should be moved"
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "minus",
"description": "Whether the cursor should be moved to the left or not."
}
],
"return": null
},
{
"__docId__": 158,
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "addStringAt",
"memberof": "src/lib/services/Utilities.js~Utilities",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#addStringAt",
"access": "public",
"description": "Adds a string to the input at a given position",
2018-11-25 10:12:28 +08:00
"lineNumber": 224,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "source",
"description": "The source input"
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "string",
"description": "The string to add"
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "position",
"description": "The (cursor) position where the string should be added"
2018-11-06 06:31:11 +08:00
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "moveCaret",
"description": "Whether to update simple-keyboard's cursor"
2018-10-25 06:18:24 +08:00
}
],
"return": {
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 159,
2018-10-25 06:18:24 +08:00
"kind": "method",
"name": "removeAt",
"memberof": "src/lib/services/Utilities.js~Utilities",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#removeAt",
"access": "public",
"description": "Removes an amount of characters at a given position",
2018-11-25 10:12:28 +08:00
"lineNumber": 251,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "source",
"description": "The source input"
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "position",
"description": "The (cursor) position from where the characters should be removed"
2018-11-06 06:31:11 +08:00
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "moveCaret",
"description": "Whether to update simple-keyboard's cursor"
2018-10-25 06:18:24 +08:00
}
],
"return": {
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 160,
2018-10-25 06:18:24 +08:00
"kind": "method",
"name": "handleMaxLength",
"memberof": "src/lib/services/Utilities.js~Utilities",
"generator": false,
"async": false,
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#handleMaxLength",
"access": "public",
"description": "Determines whether the maxLength has been reached. This function is called when the maxLength option it set.",
2018-11-25 10:12:28 +08:00
"lineNumber": 298,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "inputObj",
"description": ""
},
{
"nullable": null,
"types": [
"object"
],
"spread": false,
"optional": false,
"name": "options",
"description": ""
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "updatedInput",
"description": ""
}
],
"return": {
"types": [
"boolean"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 161,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "maxLengthReached",
"memberof": "src/lib/services/Utilities.js~Utilities",
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#maxLengthReached",
"access": "public",
"description": "",
2018-11-25 10:12:28 +08:00
"lineNumber": 322,
2018-10-25 06:18:24 +08:00
"type": {
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"description": null
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 165,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "isMaxLengthReached",
"memberof": "src/lib/services/Utilities.js~Utilities",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#isMaxLengthReached",
"access": "public",
"description": "Gets the current value of maxLengthReached",
2018-11-25 10:12:28 +08:00
"lineNumber": 350,
2018-10-31 11:33:29 +08:00
"params": [],
"return": {
2018-10-25 06:18:24 +08:00
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 166,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "camelCase",
"memberof": "src/lib/services/Utilities.js~Utilities",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#camelCase",
"access": "public",
"description": "Transforms an arbitrary string to camelCase",
2018-11-25 10:12:28 +08:00
"lineNumber": 359,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "string",
"description": "The string to transform."
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 167,
2018-10-31 11:33:29 +08:00
"kind": "method",
2018-10-25 06:18:24 +08:00
"name": "countInArray",
"memberof": "src/lib/services/Utilities.js~Utilities",
2018-10-31 11:33:29 +08:00
"generator": false,
"async": false,
2018-10-25 06:18:24 +08:00
"static": false,
"longname": "src/lib/services/Utilities.js~Utilities#countInArray",
"access": "public",
"description": "Counts the number of duplicates in a given array",
2018-11-25 10:12:28 +08:00
"lineNumber": 369,
2018-10-25 06:18:24 +08:00
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "array",
"description": "The haystack to search in"
},
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "value",
"description": "The needle to search for"
}
],
2018-10-31 11:33:29 +08:00
"return": {
2018-10-25 06:18:24 +08:00
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 168,
2018-10-25 06:18:24 +08:00
"kind": "file",
"name": "src/lib/tests/TestUtility.js",
"content": "/**\r\n * Test Utility Functions\r\n */\r\nexport default class TestUtility {\r\n /**\r\n * Set's a basic DOM structure to test in\r\n */\r\n setDOM = (divClass) => {\r\n this.clear();\r\n const div = document.createElement('div');\r\n div.className += divClass || \"simple-keyboard\";\r\n document.body.appendChild(div);\r\n }\r\n\r\n /**\r\n * Clears DOM structure\r\n */\r\n clear = () => {\r\n document.body.innerHTML = \"\";\r\n }\r\n\r\n /**\r\n * Test if standard buttons respect maxLength and do input a value\r\n */\r\n testLayoutStdButtons = (keyboard) => {\r\n let stdBtnCount = 0;\r\n let fullInput = '';\r\n\r\n this.iterateButtons((button) => {\r\n let label = button.getAttribute(\"data-skbtn\");\r\n\r\n if(label.includes(\"{\"))\r\n return false;\r\n\r\n // Click all standard buttons, respects maxLength\r\n button.onclick();\r\n\r\n // Recording fullInput, bypasses maxLength\r\n fullInput = keyboard.utilities.getUpdatedInput(label, fullInput, keyboard.options, null);\r\n\r\n stdBtnCount += label.length;\r\n });\r\n\r\n /**\r\n * Check if maxLength is respected\r\n */\r\n if(\r\n (\r\n typeof keyboard.options.maxLength === \"object\" &&\r\n keyboard.getInput().length !== keyboard.options.maxLength[keyboard.options.layoutName]\r\n ) ||\r\n (\r\n typeof keyboard.options.maxLength !== \"object\" &&\r\n keyboard.getInput().length !== keyboard.options.maxLength\r\n )\r\n )\r\n throw new Error(\"MAX_LENGTH_ISSUE\");\r\n else\r\n console.log(\"MAX_LENGTH PASSED:\", keyboard.options.layoutName, keyboard.getInput().length, keyboard.options.maxLength);\r\n\r\n /**\r\n * Check if all standard buttons are inputting something\r\n * (Regardless of maxLength)\r\n */\r\n if(stdBtnCount !== fullInput.length)\r\n throw new Error(\"STANDARD_BUTTONS_ISSUE\");\r\n else\r\n console.log(\"STANDARD_BUTTONS PASSED:\", keyboard.options.layoutName, stdBtnCount, fullInput.length);\r\n }\r\n\r\n /**\r\n * Test if function buttons are interactive (have an onclick)\r\n */\r\n testLayoutFctButtons = (callback) => {\r\n let fctBtnCount = 0;\r\n let fctBtnHasOnclickCount = 0;\r\n\r\n this.iterateButtons((button) => {\r\n let label = button.getAttribute(\"data-skbtn\");\r\n\r\n if(!label.includes(\"{\") && !label.includes(\"}\"))\r\n return false;\r\n\r\n fctBtnCount++;\r\n\r\n if(button.onclick){\r\n button.onclick();\r\n fctBtnHasOnclickCount++;\r\n }\r\n\r\n callback(fctBtnCount, fctBtnHasOnclickCount);\r\n });\r\n }\r\n\r\n /**\r\n * Iterates on the keyboard buttons\r\n */\r\n iterateButtons = (callback, selector) => {\r\n let rows = document.body.querySelector(selector || '.simple-keyboard').children;\r\n\r\n Array.from(rows).forEach(row => {\r\n Array.from(row.children).forEach((button) => {\r\n callback(button);\r\n });\r\n });\r\n }\r\n}",
"static": true,
2018-11-25 10:12:28 +08:00
"longname": "X:/Dev/simple-keyboard/src/lib/tests/TestUtility.js",
2018-10-25 06:18:24 +08:00
"access": "public",
"description": null,
"lineNumber": 1
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 169,
2018-10-25 06:18:24 +08:00
"kind": "class",
"name": "TestUtility",
"memberof": "src/lib/tests/TestUtility.js",
"static": true,
"longname": "src/lib/tests/TestUtility.js~TestUtility",
"access": "public",
"export": true,
"importPath": "simple-keyboard/src/lib/tests/TestUtility.js",
"importStyle": "TestUtility",
"description": "Test Utility Functions",
"lineNumber": 4,
"interface": false
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 170,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "setDOM",
"memberof": "src/lib/tests/TestUtility.js~TestUtility",
"static": false,
"longname": "src/lib/tests/TestUtility.js~TestUtility#setDOM",
"access": "public",
"description": "Set's a basic DOM structure to test in",
"lineNumber": 8,
"type": {
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 171,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "clear",
"memberof": "src/lib/tests/TestUtility.js~TestUtility",
"static": false,
"longname": "src/lib/tests/TestUtility.js~TestUtility#clear",
"access": "public",
"description": "Clears DOM structure",
"lineNumber": 18,
"type": {
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 172,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "testLayoutStdButtons",
"memberof": "src/lib/tests/TestUtility.js~TestUtility",
"static": false,
"longname": "src/lib/tests/TestUtility.js~TestUtility#testLayoutStdButtons",
"access": "public",
"description": "Test if standard buttons respect maxLength and do input a value",
"lineNumber": 25,
"type": {
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 173,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "testLayoutFctButtons",
"memberof": "src/lib/tests/TestUtility.js~TestUtility",
"static": false,
"longname": "src/lib/tests/TestUtility.js~TestUtility#testLayoutFctButtons",
"access": "public",
"description": "Test if function buttons are interactive (have an onclick)",
"lineNumber": 74,
"type": {
"types": [
"*"
]
}
},
{
2018-11-25 10:12:28 +08:00
"__docId__": 174,
2018-10-25 06:18:24 +08:00
"kind": "member",
"name": "iterateButtons",
"memberof": "src/lib/tests/TestUtility.js~TestUtility",
"static": false,
"longname": "src/lib/tests/TestUtility.js~TestUtility#iterateButtons",
"access": "public",
"description": "Iterates on the keyboard buttons",
"lineNumber": 98,
"type": {
"types": [
"*"
]
}
},
{
"kind": "index",
2018-10-29 23:47:56 +08:00
"content": "<div align=\"center\">\r\n <a href=\"https://simple-keyboard.com/demo\" title=\"View Demo\" target=\"_blank\"><img src=\"https://franciscohodge.com/project-pages/simple-keyboard/images/simplekeyboard-banner_B.png\" align=\"center\" width=\"100%\"></a>\r\n <a href=\"https://simple-keyboard.com/demo\" title=\"View Demo\" target=\"_blank\"><img src=\"https://franciscohodge.com/project-pages/simple-keyboard/images/simple-keyboard-10172018.gif\" align=\"center\" width=\"100%\"></a>\r\n <blockquote>The easily customisable and responsive on-screen virtual keyboard for Javascript projects.</blockquote>\r\n <p><a href=\"https://github.com/hodgef/simple-keyboard/blob/master/LICENSE\" target=\"_blank\"><img src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"License\"></a>\r\n <a href=\"https://www.npmjs.com/package/simple-keyboard\" target=\"_blank\"><img src=\"https://img.shields.io/npm/v/simple-keyboard.svg?style=flat\" alt=\"npm version\"></a>\r\n <a href=\"https://travis-ci.org/hodgef/simple-keyboard\" target=\"_blank\"><img src=\"https://travis-ci.org/hodgef/simple-keyboard.svg?branch=master\" alt=\"Build Status\"></a>\r\n <a href=\"https://codecov.io/gh/hodgef/simple-keyboard\" target=\"_blank\"><img src=\"https://img.shields.io/codecov/c/github/hodgef/simple-keyboard/master.svg?style=flat\" alt=\"Coverage Status\"></a>\r\n <a href=\"https://doc.esdoc.org/github.com/hodgef/simple-keyboard\" target=\"_blank\"><img src=\"https://doc.esdoc.org/github.com/hodgef/simple-keyboard/badge.svg\" alt=\"Documentation Status\"></a>\r\n </p>\r\n</div>\r\n\r\n## 📦 Installation & Usage\r\nYou can use simple-keyboard as a `<script>` tag from a CDN, or install it from npm.\r\n \r\nCheck out the [Getting Started](https://simple-keyboard.com/getting-started) docs to begin.\r\n\r\n## 📖 Documentation\r\nCheck out the [simple-keyboard documentation](https://simple-keyboard.com/documentation) site.\r\n\r\nFeel free to browse the [Q&A / Use-cases](https://simple-keyboard.com/qa-use-cases/) page for advanced use-cases.\r\n\r\n## 🚀 Demo\r\n\r\n[https://simple-keyboard.com/demo](https://simple-keyboard.com/demo)\r\n\r\n\r\n### To run demo on your own computer\r\n\r\n* Clone this repository\r\n* `npm install`\r\n* `npm start`\r\n* Visit [http://localhost:3000/](http://localhost:3000/)\r\n\r\n### Other versions\r\n\r\n* ReactJS - [react-simple-keyboard](https://github.com/hodgef/react-simple-keyboard)\r\n\r\n### Questions?\r\n\r\n<a href=\"http://franciscohodge.com/simple-keyboard/chat/join\" title=\"Join our Discord chat\" target=\"_blank\"><img src=\"https://franciscohodge.com/project-pages/simple-keyboard/images/discord.png\" align=\"center\" width=\"200\"></a>\r\n\r\n## ✅ Contributing\r\n\r\nPR's and issues are welcome. Feel free to submit any issues you have at:\r\n[https://github.com/hodgef/simple-keyboard/issues](https://github.com/hodgef/simple-keyboard/issues)\r\n",
2018-11-25 10:12:28 +08:00
"longname": "X:\\Dev\\simple-keyboard\\README.md",
2018-10-25 06:18:24 +08:00
"name": "./README.md",
"static": true,
"access": "public"
},
{
"kind": "packageJSON",
2018-11-25 10:12:28 +08:00
"content": "{\r\n \"name\": \"simple-keyboard\",\r\n \"version\": \"2.11.0\",\r\n \"description\": \"On-screen Javascript Virtual Keyboard\",\r\n \"main\": \"build/index.js\",\r\n \"scripts\": {\r\n \"start\": \"node scripts/start.js\",\r\n \"build\": \"node scripts/build.js\",\r\n \"demo\": \"node scripts/demo.js\",\r\n \"test\": \"node scripts/test.js\",\r\n \"postinstall\": \"node bin/postinstall\",\r\n \"prepare\": \"npm run build\",\r\n \"docs\": \"esdoc\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/hodgef/simple-keyboard\"\r\n },\r\n \"author\": \"Francisco Hodge <hello@franciscohodge.com> (https://github.com/hodgef)\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/hodgef/simple-keyboard/issues\"\r\n },\r\n \"homepage\": \"https://virtual-keyboard.js.org/\",\r\n \"keywords\": [\r\n \"javascript\",\r\n \"es6\",\r\n \"digital\",\r\n \"keyboard\",\r\n \"onscreen\",\r\n \"virtual\",\r\n \"screen-keyboard\",\r\n \"component\",\r\n \"virtual-keyboard\",\r\n \"touchscreen\",\r\n \"touch-screen\",\r\n \"kiosk\",\r\n \"osk\"\r\n ],\r\n \"license\": \"MIT\",\r\n \"devDependencies\": {\r\n \"@babel/core\": \"7.1.0\",\r\n \"@babel/plugin-proposal-class-properties\": \"^7.1.0\",\r\n \"@babel/preset-env\": \"^7.1.6\",\r\n \"@babel/preset-react\": \"^7.0.0\",\r\n \"@svgr/webpack\": \"4.0.3\",\r\n \"babel-core\": \"7.0.0-bridge.0\",\r\n \"babel-eslint\": \"9.0.0\",\r\n \"babel-jest\": \"23.6.0\",\r\n \"babel-loader\": \"8.0.4\",\r\n \"babel-plugin-named-asset-import\": \"^0.2.3\",\r\n \"babel-preset-react-app\": \"^6.1.0\",\r\n \"bfj\": \"6.1.1\",\r\n \"case-sensitive-paths-webpack-plugin\": \"2.1.2\",\r\n \"chalk\": \"2.4.1\",\r\n \"css-loader\": \"1.0.1\",\r\n \"dotenv\": \"6.0.0\",\r\n \"dotenv-expand\": \"4.2.0\",\r\n \"esdoc\": \"^1.1.0\",\r\n \"esdoc-ecmascript-proposal-plugin\": \"^1.0.0\",\r\n \"esdoc-standard-plugin\": \"^1.0.0\",\r\n \"eslint\": \"5.9.0\",\r\n \"eslint-config-react-app\": \"^3.0.5\",\r\n \"eslint-loader\": \"2.1.1\",\r\n \"eslint-plugin-flowtype\": \"2.50.3\",\r\n \"eslint-plugin-import\": \"2.14.0\",\r\n \"eslint-plugin-jsx-a11y\": \"6.1.2\",\r\n \"eslint-plugin-react\": \"7.11.1\",\r\n \"file-loader\": \"2.0.0\",\r\n \"fork-ts-checker-webpack-plugin-alt\": \"0.4.14\",\r\n \"fs-extra\": \"7.0.0\",\r\n \"har-validator\": \"^5.1.3\",\r\n \"html-webpack-plugin\": \"4.0.0-beta.4\",\r\n \"identity-obj-proxy\": \"3.0.0\",\r\n \"jest\": \"23.6.0\",\r\n \"jest-pnp-resolver\": \"1.0.1\",\r\n \"jest-resolve\": \"23.6.0\",\r\n \"mini-css-extract-plugin\": \"0.4.4\",\r\n \"optimize-css-assets-webpack-plugin\": \"5.0.1\",\r\n \"pnp-webpack-plugin\": \"1.2.0\",\r\n \"postcss-flexbugs-fixes\": \"4.1.0\",\r\n \"postcss-loader\": \"3.0.0\",\r\n \"postcss-preset-env\": \"6.0.6\",\r\n \"postcss-safe-parser\": \"4.0.1\",\r\n \"react\": \"^16.6.1\",\r\n \"react-app-polyfill\": \"^0.1.3\",\r\n \"react-dev-utils\": \"^6.1.1\",\r\n \"react-dom\": \"^16.6.1\",\r\n \"resolve\": \"1.8.1\",\r\n \"sass-loader\": \"7.1.0\",\r\n \"style-loader\": \"0.23.0\",\r\n \"terser-webpack-plugin\": \"1.1.0\",\r\n \"url-loader\": \"1.1.1\",\r\n \"webpack\": \"4.25.1\",\r\n \"webpack-dev-server\": \"3.1.10\",\r\n \"webpack-manifest-plugin\": \"2.0.4\",\r\n \"workbox-webpack-plugin\": \"3.6.3\"\r\n },\r\n \"eslintConfig\": {\r\n \"extends\": \"react-app\"\r\n },\r\n \"browserslist\": [\r\n \">0.2%\",\r\n \"not dead\",\r\n \"not ie <= 11\",\r\n \"not op_mini all\"\r\n ],\r\n \"jest\": {\r\n \"collectCoverageFrom\": [\r\n \"src/**/*.{js,jsx,ts,tsx}\",\r\n \"!src/**/*.d.ts\",\r\n \"!**/tests/**\"\r\n ],\r\n \"resolver\": \"jest-pnp-resolver\",\r\n \"setupFiles\": [\r\n \"react-app-polyfill/jsdom\"\r\n ],\r\n \"testMatch\": [\r\n \"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}\",\r\n
"longname": "X:\\Dev\\simple-keyboard\\package.json",
2018-10-25 06:18:24 +08:00
"name": "package.json",
"static": true,
"access": "public"
}
]