├── favicon.png ├── assets ├── imgs │ ├── arrow-down.png │ └── background.jpg ├── js │ ├── lib │ │ ├── FileSaver-1.3.2.min.js │ │ ├── jquery-linenumbers.js │ │ └── jquery-3.1.0.min.js │ └── main.js └── css │ └── style.css ├── modules ├── mukeyboard │ ├── module.meta │ └── module.js ├── digispark │ ├── module.meta │ └── module.js ├── modules.json └── arduino │ ├── lib │ ├── readme │ ├── Keyboard.h │ ├── Keyboard@1.cpp │ └── Keyboard@2.cpp │ ├── module.meta │ ├── locales │ ├── czqwertz.lang │ ├── cz.lang │ ├── uk.lang │ ├── us.lang │ ├── po.lang │ ├── pobr.lang │ ├── it.lang │ ├── be.lang │ ├── su.lang │ ├── es.lang │ ├── tr.lang │ ├── fr.lang │ ├── sample.lang │ ├── sv.lang │ ├── gr.lang │ ├── dk.lang │ └── si.lang │ └── module.js ├── readme.default ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── ISSUE_TEMPLATE.md ├── LICENSE ├── README.md ├── index.html └── Duckuino.js /favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dukweeno/Duckuino/HEAD/favicon.png -------------------------------------------------------------------------------- /assets/imgs/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dukweeno/Duckuino/HEAD/assets/imgs/arrow-down.png -------------------------------------------------------------------------------- /assets/imgs/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dukweeno/Duckuino/HEAD/assets/imgs/background.jpg -------------------------------------------------------------------------------- /modules/mukeyboard/module.meta: -------------------------------------------------------------------------------- 1 | { 2 | "displayname":"MuKeyboard", 3 | "version":"1.0", 4 | "author":"MrMoDDoM", 5 | "locales": {} 6 | } 7 | -------------------------------------------------------------------------------- /modules/digispark/module.meta: -------------------------------------------------------------------------------- 1 | { 2 | "displayname":"Digispark", 3 | "version":"1.0", 4 | "author":"@alcyonsecurity / NIXU", 5 | "locales": {} 6 | } 7 | -------------------------------------------------------------------------------- /readme.default: -------------------------------------------------------------------------------- 1 | This was compiled by Duckuino, an open-source project 2 | released under the MIT Licence and was created by Nurrl 3 | from an original idea of Plazmaz. 4 | 5 | Check the project: 6 | https://github.com/Dukweeno/Duckuino 7 | And the licence: 8 | https://github.com/Dukweeno/Duckuino/blob/master/LICENSE 9 | 10 | (c) 2016-2019 Nurrl & Plazmaz 11 | -------------------------------------------------------------------------------- /modules/modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "arduino": { 3 | "module": "module.js", 4 | "meta": "module.meta", 5 | "path": "arduino/" 6 | }, 7 | "digispark": { 8 | "module": "module.js", 9 | "meta": "module.meta", 10 | "path": "digispark/" 11 | }, 12 | "mukeyboard": { 13 | "module": "module.js", 14 | "meta": "module.meta", 15 | "path": "mukeyboard/" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Ask and discuss about new features you want in the software. 4 | title: I need dis ! 5 | labels: idea 6 | assignees: Nurrl 7 | 8 | --- 9 | 10 | ## I. Describe the feature you'd like to see: 11 | A short desciption of the feature and why you find it useful: 12 | 13 | Some idea on what should be included in the feature: 14 | 1. _____ 15 | 2. _____ 16 | 3. _____ 17 | 18 | **Additional context** 19 | Add any other context about the requested feature here. 20 | -------------------------------------------------------------------------------- /modules/arduino/lib/readme: -------------------------------------------------------------------------------- 1 | Copyright (c) Arduino LLC. All right reserved. 2 | 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Lesser General Public License for more details. 12 | 13 | You should have received a copy of the GNU Lesser General Public 14 | License along with this library; if not, write to the Free Software 15 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve the software. 4 | title: Hmm, this software is buggy.. 5 | labels: bug 6 | assignees: Nurrl 7 | 8 | --- 9 | 10 | ## I. Describe your environment 11 | 12 | - Platform: 13 | `[e.g. Desktop, Mobile]` 14 | - OS: 15 | `[e.g. iOS, Win64, Linux]` 16 | - Browser: 17 | `[e.g. Firefox, Safari]` 18 | - Version: 19 | `[e.g. 22.12.2]` 20 | 21 | ## II. Describe your problem 22 | 23 | **How to reproduce the bug** 24 | Steps to reproduce the behavior: 25 | 1. _____ 26 | 2. _____ 27 | 3. _____ 28 | 29 | **Observed behavior** 30 | A clear and concise description of what the bug is. 31 | 32 | **Expected behavior** 33 | A clear and concise description of what you expected to happen. 34 | 35 | **Additional context** 36 | Add any other context about the problem here. 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016-2017 Nurrl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 3 | 4 | Are you using the live version that could be found [here](https://nurrl.github.io/Duckuino/) ? 5 | - [ ] Yes, absolutely 6 | - [ ] No, I might try it out 7 | 13 | 14 | What type of issue is it ? 15 | - [ ] Graphical issue (UX, UI, Graphical Glitch) 16 | - [ ] Feature issue (Command not/bad implemented, Non functionnal feature) 17 | - [ ] Crash (The buttons clicks does nothing at all, Error in console) 18 | - [ ] Question (Any type about the project :D) 19 | 26 | ``` 27 | Here are relevant errors/infos outputed by the code ! 28 | ``` 29 | 30 | _Describe your problem here :D_ 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Duckuino [![release](https://img.shields.io/github/release/Dukweeno/Duckuino/all.svg)](https://github.com/Dukweeno/Duckuino/releases) [![GitHub issues](https://img.shields.io/github/issues/Dukweeno/Duckuino.svg)](https://github.com/Dukweeno/Duckuino/issues) 2 | Simple **DuckyScript** to **Arduino** converter. 3 | 4 | If you need to perform mouse emulation then use [d4n5h's Duckuino](https://github.com/d4n5h/Duckuino). 5 | 6 | *NOTE: If you are on linux, you might use the Arduino IDE from the website, not from apt, because the apt repo is not up to date.* 7 | 8 | ### Warning: Release note 9 | This release is an unstable version, for now some things may or may not work, please [*open an issue*](https://github.com/Dukweeno/Duckuino/issues/new) if you find a bug. 10 | 11 | *The stable version will be released in few days, maybe :D* 12 | ## Live version: 13 | https://dukweeno.github.io/Duckuino/ 14 | 15 | ## Why Duckuino ? 16 | You can compile **Duckyscript** to **Arduino** code directly through the [live](https://dukweeno.github.io/Duckuino/ "Duckuino Live") version, or reuse `Duckuino.js` for standalone use : 17 | ```javascript 18 | let Duck = new Duckuino(); 19 | let mods = new Modules().list; 20 | 21 | let output = Duck.compileCode("STRING This is a test string !", mods[0].module); 22 | /* ^- Here will be the final compiled code | 23 | ** and errors if applicable. | 24 | ** Here is the selected module -/ 25 | ** 26 | ** Note: You can iterate through the list and find the desired one, 27 | ** by default, `0` will be the first module. 28 | */ 29 | ``` 30 | # Members 31 | - [Plazmaz](https://github.com/Plazmaz) 32 | - [Nurrl](https://github.com/Nurrl) 33 | -------------------------------------------------------------------------------- /assets/js/lib/FileSaver-1.3.2.min.js: -------------------------------------------------------------------------------- 1 | /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ 2 | var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/constructor/i.test(e.HTMLElement),f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},d="application/octet-stream",s=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,s)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(i){u(i)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,s){if(!s){t=p(t)}var v=this,w=t.type,m=w===d,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&a)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;i(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define([],function(){return saveAs})} -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Duckuino 16 | 17 | 18 | 22 | 23 |
24 |
25 |

Input

26 |
This is where you put the DuckyScript
27 |
28 | 29 | 30 | 31 |
32 |
33 |
34 | 35 | 36 |
37 | 38 |
39 | 40 |
41 |
42 |
43 |

Export

44 |
Time to use !
45 | 46 | 47 | 49 | 50 |

Option 1: Download (Recommended)

51 |
52 | 53 | 54 |
55 | 56 |

Option 2: Copy/Paste

57 | 58 |
59 |
60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /modules/arduino/module.meta: -------------------------------------------------------------------------------- 1 | { 2 | "displayname":"Arduino", 3 | "version":"1.0", 4 | "author":"Nurrl", 5 | "locales":{ 6 | "_meta": { 7 | "header": "lib/Keyboard.h", 8 | "name": "Keyboard", 9 | "parts": [ 10 | "lib/Keyboard@1.cpp", 11 | "_locale_", 12 | "lib/Keyboard@2.cpp" 13 | ] 14 | }, 15 | "us": { 16 | "name":"United States - Default", 17 | "path": "locales/us.lang", 18 | "version":"1.0", 19 | "author":"Arduino Team" 20 | }, 21 | "uk": { 22 | "name":"United Kingdom", 23 | "path": "locales/uk.lang", 24 | "version":"1.0", 25 | "author":"" 26 | }, 27 | "fr": { 28 | "name":"France", 29 | "path": "locales/fr.lang", 30 | "version":"1.1", 31 | "author":"Leon ROUX @Nurrl" 32 | }, 33 | "be": { 34 | "name":"Belgium", 35 | "path": "locales/be.lang", 36 | "version":"1.0", 37 | "author":"" 38 | }, 39 | "sv": { 40 | "name":"Sweden", 41 | "path": "locales/sv.lang", 42 | "version":"1.0", 43 | "author":"" 44 | }, 45 | "es": { 46 | "name":"Spain", 47 | "path": "locales/es.lang", 48 | "version":"1.0", 49 | "author":"" 50 | }, 51 | "it": { 52 | "name":"Italy", 53 | "path": "locales/it.lang", 54 | "version":"1.0", 55 | "author":"" 56 | }, 57 | "po": { 58 | "name":"Portugal", 59 | "path": "locales/po.lang", 60 | "version":"1.0", 61 | "author":"" 62 | }, 63 | "pobr": { 64 | "name":"Portugal(BR)", 65 | "path": "locales/pobr.lang", 66 | "version":"1.0", 67 | "author":"" 68 | }, 69 | "gr": { 70 | "name":"Germany", 71 | "path": "locales/gr.lang", 72 | "version":"1.0", 73 | "author":"" 74 | }, 75 | "su": { 76 | "name":"Finland", 77 | "path": "locales/su.lang", 78 | "version":"1.0", 79 | "author":"" 80 | }, 81 | "cz": { 82 | "name":"Czech Republic(Qwerty)", 83 | "path": "locales/cz.lang", 84 | "version":"1.0", 85 | "author":"" 86 | }, 87 | "czqwertz": { 88 | "name":"Czech Republic(Qwertz)", 89 | "path": "locales/czqwertz.lang", 90 | "version":"1.0", 91 | "author":"" 92 | }, 93 | "dk": { 94 | "name":"Danmark", 95 | "path": "locales/dk.lang", 96 | "version":"1.0", 97 | "author":"" 98 | }, 99 | "tr": { 100 | "name":"Turkey", 101 | "path": "locales/tr.lang", 102 | "version":"1.0", 103 | "author":"" 104 | }, 105 | "si": { 106 | "name":"Slovenia", 107 | "path": "locales/si.lang", 108 | "version":"1.0", 109 | "author":"" 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /modules/arduino/lib/Keyboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Keyboard.h 3 | 4 | Copyright (c) 2015, Arduino LLC 5 | Original code (pre-library): Copyright (c) 2011, Peter Barrett 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef KEYBOARD_h 23 | #define KEYBOARD_h 24 | 25 | #include "HID.h" 26 | 27 | #if !defined(_USING_HID) 28 | 29 | #warning "Using legacy HID core (non pluggable)" 30 | 31 | #else 32 | 33 | //================================================================================ 34 | //================================================================================ 35 | // Keyboard 36 | 37 | #define KEY_LEFT_CTRL 0x80 38 | #define KEY_LEFT_SHIFT 0x81 39 | #define KEY_LEFT_ALT 0x82 40 | #define KEY_LEFT_GUI 0x83 41 | #define KEY_RIGHT_CTRL 0x84 42 | #define KEY_RIGHT_SHIFT 0x85 43 | #define KEY_RIGHT_ALT 0x86 44 | #define KEY_RIGHT_GUI 0x87 45 | 46 | #define KEY_UP_ARROW 0xDA 47 | #define KEY_DOWN_ARROW 0xD9 48 | #define KEY_LEFT_ARROW 0xD8 49 | #define KEY_RIGHT_ARROW 0xD7 50 | #define KEY_BACKSPACE 0xB2 51 | #define KEY_TAB 0xB3 52 | #define KEY_RETURN 0xB0 53 | #define KEY_ESC 0xB1 54 | #define KEY_INSERT 0xD1 55 | #define KEY_DELETE 0xD4 56 | #define KEY_PAGE_UP 0xD3 57 | #define KEY_PAGE_DOWN 0xD6 58 | #define KEY_HOME 0xD2 59 | #define KEY_END 0xD5 60 | #define KEY_CAPS_LOCK 0xC1 61 | #define KEY_F1 0xC2 62 | #define KEY_F2 0xC3 63 | #define KEY_F3 0xC4 64 | #define KEY_F4 0xC5 65 | #define KEY_F5 0xC6 66 | #define KEY_F6 0xC7 67 | #define KEY_F7 0xC8 68 | #define KEY_F8 0xC9 69 | #define KEY_F9 0xCA 70 | #define KEY_F10 0xCB 71 | #define KEY_F11 0xCC 72 | #define KEY_F12 0xCD 73 | 74 | // Low level key report: up to 6 keys and shift, ctrl etc at once 75 | typedef struct 76 | { 77 | uint8_t modifiers; 78 | uint8_t reserved; 79 | uint8_t keys[6]; 80 | } KeyReport; 81 | 82 | class Keyboard_ : public Print 83 | { 84 | private: 85 | KeyReport _keyReport; 86 | void sendReport(KeyReport* keys); 87 | public: 88 | Keyboard_(void); 89 | void begin(void); 90 | void end(void); 91 | size_t write(uint8_t k); 92 | size_t press(uint8_t k); 93 | size_t release(uint8_t k); 94 | void releaseAll(void); 95 | }; 96 | extern Keyboard_ Keyboard; 97 | 98 | #endif 99 | #endif 100 | -------------------------------------------------------------------------------- /modules/arduino/lib/Keyboard@1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Keyboard.cpp 3 | 4 | Copyright (c) 2015, Arduino LLC 5 | Original code (pre-library): Copyright (c) 2011, Peter Barrett 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #include "Keyboard.h" 23 | 24 | #if defined(_USING_HID) 25 | 26 | //================================================================================ 27 | //================================================================================ 28 | // Keyboard 29 | 30 | static const uint8_t _hidReportDescriptor[] PROGMEM = { 31 | 32 | // Keyboard 33 | 0x05, 0x01, // USAGE_PAGE (Generic Desktop) // 47 34 | 0x09, 0x06, // USAGE (Keyboard) 35 | 0xa1, 0x01, // COLLECTION (Application) 36 | 0x85, 0x02, // REPORT_ID (2) 37 | 0x05, 0x07, // USAGE_PAGE (Keyboard) 38 | 39 | 0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl) 40 | 0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI) 41 | 0x15, 0x00, // LOGICAL_MINIMUM (0) 42 | 0x25, 0x01, // LOGICAL_MAXIMUM (1) 43 | 0x75, 0x01, // REPORT_SIZE (1) 44 | 45 | 0x95, 0x08, // REPORT_COUNT (8) 46 | 0x81, 0x02, // INPUT (Data,Var,Abs) 47 | 0x95, 0x01, // REPORT_COUNT (1) 48 | 0x75, 0x08, // REPORT_SIZE (8) 49 | 0x81, 0x03, // INPUT (Cnst,Var,Abs) 50 | 51 | 0x95, 0x06, // REPORT_COUNT (6) 52 | 0x75, 0x08, // REPORT_SIZE (8) 53 | 0x15, 0x00, // LOGICAL_MINIMUM (0) 54 | 0x25, 0x65, // LOGICAL_MAXIMUM (101) 55 | 0x05, 0x07, // USAGE_PAGE (Keyboard) 56 | 57 | 0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated)) 58 | 0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application) 59 | 0x81, 0x00, // INPUT (Data,Ary,Abs) 60 | 0xc0, // END_COLLECTION 61 | }; 62 | 63 | Keyboard_::Keyboard_(void) 64 | { 65 | static HIDSubDescriptor node(_hidReportDescriptor, sizeof(_hidReportDescriptor)); 66 | HID().AppendDescriptor(&node); 67 | } 68 | 69 | void Keyboard_::begin(void) 70 | { 71 | } 72 | 73 | void Keyboard_::end(void) 74 | { 75 | } 76 | 77 | void Keyboard_::sendReport(KeyReport* keys) 78 | { 79 | HID().SendReport(2,keys,sizeof(KeyReport)); 80 | } 81 | 82 | extern 83 | const uint8_t _asciimap[128] PROGMEM; 84 | /*- ---Start of generated lib--- -*/ 85 | -------------------------------------------------------------------------------- /modules/arduino/lib/Keyboard@2.cpp: -------------------------------------------------------------------------------- 1 | /*- ---End of generated lib--- -*/ 2 | uint8_t USBPutChar(uint8_t c); 3 | 4 | // press() adds the specified key (printing, non-printing, or modifier) 5 | // to the persistent key report and sends the report. Because of the way 6 | // USB HID works, the host acts like the key remains pressed until we 7 | // call release(), releaseAll(), or otherwise clear the report and resend. 8 | size_t Keyboard_::press(uint8_t k) 9 | { 10 | uint8_t i; 11 | if (k >= 136) { // it's a non-printing key (not a modifier) 12 | k = k - 136; 13 | } else if (k >= 128) { // it's a modifier key 14 | _keyReport.modifiers |= (1<<(k-128)); 15 | k = 0; 16 | } else { // it's a printing key 17 | int oldKey = k; 18 | k = pgm_read_byte(_asciimap + k); 19 | if (!k) { 20 | setWriteError(); 21 | return 0; 22 | } 23 | if (k & 0x80) { // it's a capital letter or other character reached with shift 24 | _keyReport.modifiers |= 0x02; // the left shift modifier 25 | k &= 0x7F; 26 | } 27 | 28 | if (!_altFine) 29 | initAltGr(); 30 | if (_altGrMap[oldKey]) 31 | _keyReport.modifiers |= 0x40; 32 | } 33 | 34 | // Add k to the key report only if it's not already present 35 | // and if there is an empty slot. 36 | if (_keyReport.keys[0] != k && _keyReport.keys[1] != k && 37 | _keyReport.keys[2] != k && _keyReport.keys[3] != k && 38 | _keyReport.keys[4] != k && _keyReport.keys[5] != k) { 39 | 40 | for (i=0; i<6; i++) { 41 | if (_keyReport.keys[i] == 0x00) { 42 | _keyReport.keys[i] = k; 43 | break; 44 | } 45 | } 46 | if (i == 6) { 47 | setWriteError(); 48 | return 0; 49 | } 50 | } 51 | sendReport(&_keyReport); 52 | return 1; 53 | } 54 | 55 | // release() takes the specified key out of the persistent key report and 56 | // sends the report. This tells the OS the key is no longer pressed and that 57 | // it shouldn't be repeated any more. 58 | size_t Keyboard_::release(uint8_t k) 59 | { 60 | uint8_t i; 61 | if (k >= 136) { // it's a non-printing key (not a modifier) 62 | k = k - 136; 63 | } else if (k >= 128) { // it's a modifier key 64 | _keyReport.modifiers &= ~(1<<(k-128)); 65 | k = 0; 66 | } else { // it's a printing key 67 | int oldKey = k; 68 | k = pgm_read_byte(_asciimap + k); 69 | if (!k) { 70 | return 0; 71 | } 72 | if (k & 0x80) { // it's a capital letter or other character reached with shift 73 | _keyReport.modifiers &= ~(0x02); // the left shift modifier 74 | k &= 0x7F; 75 | } 76 | 77 | if (_altGrMap[oldKey]) 78 | _keyReport.modifiers &= ~(0x40); 79 | } 80 | 81 | // Test the key report to see if k is present. Clear it if it exists. 82 | // Check all positions in case the key is present more than once (which it shouldn't be) 83 | for (i=0; i<6; i++) { 84 | if (0 != k && _keyReport.keys[i] == k) { 85 | _keyReport.keys[i] = 0x00; 86 | } 87 | } 88 | 89 | sendReport(&_keyReport); 90 | return 1; 91 | } 92 | 93 | void Keyboard_::releaseAll(void) 94 | { 95 | _keyReport.keys[0] = 0; 96 | _keyReport.keys[1] = 0; 97 | _keyReport.keys[2] = 0; 98 | _keyReport.keys[3] = 0; 99 | _keyReport.keys[4] = 0; 100 | _keyReport.keys[5] = 0; 101 | _keyReport.modifiers = 0; 102 | sendReport(&_keyReport); 103 | } 104 | 105 | size_t Keyboard_::write(uint8_t c) 106 | { 107 | uint8_t p = press(c); // Keydown 108 | release(c); // Keyup 109 | return p; // just return the result of press() since release() almost always returns 1 110 | } 111 | 112 | Keyboard_ Keyboard; 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /modules/arduino/locales/czqwertz.lang: -------------------------------------------------------------------------------- 1 | #define SHIFT 0x80 2 | const uint8_t _asciimap[128] = 3 | { 4 | 0x00, // NUL 0 5 | 0x00, // SOH 1 6 | 0x00, // STX 2 7 | 0x00, // ETX 3 8 | 0x00, // EOT 4 9 | 0x00, // ENQ 5 10 | 0x00, // ACK 6 11 | 0x00, // BEL 7 12 | 0x2a, // BS 8 13 | 0x2b, // TAB 9 14 | 0x28, // LF 10 15 | 0x00, // VT 11 16 | 0x00, // FF 12 17 | 0x00, // CR 13 18 | 0x00, // SO 14 19 | 0x00, // SI 15 20 | 0x00, // DEL 16 21 | 0x00, // DC1 17 22 | 0x00, // DC2 18 23 | 0x00, // DC3 19 24 | 0x00, // DC4 20 25 | 0x00, // NAK 21 26 | 0x00, // SYN 22 27 | 0x00, // ETB 23 28 | 0x00, // CAN 24 29 | 0x00, // EM 25 30 | 0x00, // SUB 26 31 | 0x00, // ESC 27 32 | 0x00, // FS 28 33 | 0x00, // GS 29 34 | 0x00, // RS 30 35 | 0x00, // US 31 36 | 0x2c, // ' ' 32 37 | 0x34 | SHIFT, // ! 33 38 | 0x33 | SHIFT, // " 34 39 | 0x1b, // # 35 + AltGr 40 | 0x33, // $ 36 + AltGr 41 | 0x2d | SHIFT, // % 37 42 | 0x06, // & 38 + AltGr 43 | 0x31 | SHIFT, // ' 39 44 | 0x30 | SHIFT, // ( 40 45 | 0x30, // ) 41 46 | 0x38, // * 42 + AltGr 47 | 0x1e, // + 43 48 | 0x36, // , 44 49 | 0x38, // - 45 50 | 0x37, // . 46 51 | 0x2f | SHIFT, // / 47 52 | 0x27 | SHIFT, // 0 48 53 | 0x1e | SHIFT, // 1 49 54 | 0x1f | SHIFT, // 2 50 55 | 0x20 | SHIFT, // 3 51 56 | 0x21 | SHIFT, // 4 52 57 | 0x22 | SHIFT, // 5 53 58 | 0x23 | SHIFT, // 6 54 59 | 0x24 | SHIFT, // 7 55 60 | 0x25 | SHIFT, // 8 56 61 | 0x26 | SHIFT, // 9 57 62 | 0x37 | SHIFT, // : 58 63 | 0x35, // ; 59 64 | 0x36, // < 60 + AltGr 65 | 0x2d, // = 61 66 | 0x37, // > 62 + AltGr 67 | 0x36 | SHIFT, // ? 63 68 | 0x19, // @ 64 + AltGr 69 | 0x04 | SHIFT, // A 65 70 | 0x05 | SHIFT, // B 66 71 | 0x06 | SHIFT, // C 67 72 | 0x07 | SHIFT, // D 68 73 | 0x08 | SHIFT, // E 69 74 | 0x09 | SHIFT, // F 70 75 | 0x0a | SHIFT, // G 71 76 | 0x0b | SHIFT, // H 72 77 | 0x0c | SHIFT, // I 73 78 | 0x0d | SHIFT, // J 74 79 | 0x0e | SHIFT, // K 75 80 | 0x0f | SHIFT, // L 76 81 | 0x10 | SHIFT, // M 77 82 | 0x11 | SHIFT, // N 78 83 | 0x12 | SHIFT, // O 79 84 | 0x13 | SHIFT, // P 80 85 | 0x14 | SHIFT, // Q 81 86 | 0x15 | SHIFT, // R 82 87 | 0x16 | SHIFT, // S 83 88 | 0x17 | SHIFT, // T 84 89 | 0x18 | SHIFT, // U 85 90 | 0x19 | SHIFT, // V 86 91 | 0x1a | SHIFT, // W 87 92 | 0x1b | SHIFT, // X 88 93 | 0x1d | SHIFT, // Y 89 94 | 0x1c | SHIFT, // Z 90 95 | 0x09, // [ 91 + AltGr 96 | 0x14, // bsl 92 + AltGr 97 | 0x0a, // ] 93 + AltGr 98 | 0x20, // ^ 94 + AltGr 99 | 0x38 | SHIFT, // _ 95 100 | 0x24, // ` 96 + AltGr 101 | 0x04, // a 97 102 | 0x05, // b 98 103 | 0x06, // c 99 104 | 0x07, // d 100 105 | 0x08, // e 101 106 | 0x09, // f 102 107 | 0x0a, // g 103 108 | 0x0b, // h 104 109 | 0x0c, // i 105 110 | 0x0d, // j 106 111 | 0x0e, // k 107 112 | 0x0f, // l 108 113 | 0x10, // m 109 114 | 0x11, // n 110 115 | 0x12, // o 111 116 | 0x13, // p 112 117 | 0x14, // q 113 118 | 0x15, // r 114 119 | 0x16, // s 115 120 | 0x17, // t 116 121 | 0x18, // u 117 122 | 0x19, // v 118 123 | 0x1a, // w 119 124 | 0x1b, // x 120 125 | 0x1d, // y 121 126 | 0x1c, // z 122 127 | 0x05, // { 123 + AltGr 128 | 0x1a, // | 124 + AltGr 129 | 0x11, // } 125 + AltGr 130 | 0x1e, // ~ 126 + AltGr 131 | 0x00 // DEL 127 132 | }; 133 | bool _altGrMap[128]; 134 | bool _altFine = false; 135 | 136 | void initAltGr() { 137 | _altFine = true; 138 | 139 | _altGrMap[35] = true; 140 | _altGrMap[36] = true; 141 | _altGrMap[38] = true; 142 | _altGrMap[42] = true; 143 | _altGrMap[60] = true; 144 | _altGrMap[62] = true; 145 | _altGrMap[64] = true; 146 | _altGrMap[91] = true; 147 | _altGrMap[92] = true; 148 | _altGrMap[93] = true; 149 | _altGrMap[94] = true; 150 | _altGrMap[96] = true; 151 | _altGrMap[123] = true; 152 | _altGrMap[124] = true; 153 | _altGrMap[125] = true; 154 | _altGrMap[126] = true; 155 | } 156 | -------------------------------------------------------------------------------- /modules/arduino/locales/cz.lang: -------------------------------------------------------------------------------- 1 | #define SHIFT 0x80 2 | const uint8_t _asciimap[128] = 3 | { 4 | 0x00, // NUL 0 5 | 0x00, // SOH 1 6 | 0x00, // STX 2 7 | 0x00, // ETX 3 8 | 0x00, // EOT 4 9 | 0x00, // ENQ 5 10 | 0x00, // ACK 6 11 | 0x00, // BEL 7 12 | 0x2a, // BS 8 13 | 0x2b, // TAB 9 14 | 0x28, // LF 10 15 | 0x00, // VT 11 16 | 0x00, // FF 12 17 | 0x00, // CR 13 18 | 0x00, // SO 14 19 | 0x00, // SI 15 20 | 0x00, // DEL 16 21 | 0x00, // DC1 17 22 | 0x00, // DC2 18 23 | 0x00, // DC3 19 24 | 0x00, // DC4 20 25 | 0x00, // NAK 21 26 | 0x00, // SYN 22 27 | 0x00, // ETB 23 28 | 0x00, // CAN 24 29 | 0x00, // EM 25 30 | 0x00, // SUB 26 31 | 0x00, // ESC 27 32 | 0x00, // FS 28 33 | 0x00, // GS 29 34 | 0x00, // RS 30 35 | 0x00, // US 31 36 | 0x2c, // ' ' 32 37 | 0x34 | SHIFT, // ! 33 38 | 0x33 | SHIFT, // " 34 39 | 0x20, // # 35 + AltGr 40 | 0x21, // $ 36 + AltGr 41 | 0x2d | SHIFT, // % 37 42 | 0x24, // & 38 + AltGr 43 | 0x31 | SHIFT, // ' 39 44 | 0x30 | SHIFT, // ( 40 45 | 0x30, // ) 41 46 | 0x25, // * 42 + AltGr 47 | 0x1e, // + 43 48 | 0x36, // , 44 49 | 0x38, // - 45 50 | 0x37, // . 46 51 | 0x2f | SHIFT, // / 47 52 | 0x27 | SHIFT, // 0 48 53 | 0x1e | SHIFT, // 1 49 54 | 0x1f | SHIFT, // 2 50 55 | 0x20 | SHIFT, // 3 51 56 | 0x21 | SHIFT, // 4 52 57 | 0x22 | SHIFT, // 5 53 58 | 0x23 | SHIFT, // 6 54 59 | 0x24 | SHIFT, // 7 55 60 | 0x25 | SHIFT, // 8 56 61 | 0x26 | SHIFT, // 9 57 62 | 0x37 | SHIFT, // : 58 63 | 0x35, // ; 59 64 | 0x36, // < 60 + AltGr 65 | 0x2d, // = 61 66 | 0x37, // > 62 + AltGr 67 | 0x36 | SHIFT, // ? 63 68 | 0x1f, // @ 64 + AltGr 69 | 0x04 | SHIFT, // A 65 70 | 0x05 | SHIFT, // B 66 71 | 0x06 | SHIFT, // C 67 72 | 0x07 | SHIFT, // D 68 73 | 0x08 | SHIFT, // E 69 74 | 0x09 | SHIFT, // F 70 75 | 0x0a | SHIFT, // G 71 76 | 0x0b | SHIFT, // H 72 77 | 0x0c | SHIFT, // I 73 78 | 0x0d | SHIFT, // J 74 79 | 0x0e | SHIFT, // K 75 80 | 0x0f | SHIFT, // L 76 81 | 0x10 | SHIFT, // M 77 82 | 0x11 | SHIFT, // N 78 83 | 0x12 | SHIFT, // O 79 84 | 0x13 | SHIFT, // P 80 85 | 0x14 | SHIFT, // Q 81 86 | 0x15 | SHIFT, // R 82 87 | 0x16 | SHIFT, // S 83 88 | 0x17 | SHIFT, // T 84 89 | 0x18 | SHIFT, // U 85 90 | 0x19 | SHIFT, // V 86 91 | 0x1a | SHIFT, // W 87 92 | 0x1b | SHIFT, // X 88 93 | 0x1c | SHIFT, // Y 89 94 | 0x1d | SHIFT, // Z 90 95 | 0x2f, // [ 91 + AltGr 96 | 0x31, // bsl 92 + AltGr 97 | 0x30, // ] 93 + AltGr 98 | 0x23, // ^ 94 + AltGr 99 | 0x38 | SHIFT, // _ 95 100 | 0x35, // ` 96 + AltGr 101 | 0x04, // a 97 102 | 0x05, // b 98 103 | 0x06, // c 99 104 | 0x07, // d 100 105 | 0x08, // e 101 106 | 0x09, // f 102 107 | 0x0a, // g 103 108 | 0x0b, // h 104 109 | 0x0c, // i 105 110 | 0x0d, // j 106 111 | 0x0e, // k 107 112 | 0x0f, // l 108 113 | 0x10, // m 109 114 | 0x11, // n 110 115 | 0x12, // o 111 116 | 0x13, // p 112 117 | 0x14, // q 113 118 | 0x15, // r 114 119 | 0x16, // s 115 120 | 0x17, // t 116 121 | 0x18, // u 117 122 | 0x19, // v 118 123 | 0x1a, // w 119 124 | 0x1b, // x 120 125 | 0x1c, // y 121 126 | 0x1d, // z 122 127 | 0x2f | SHIFT, // { 123 + AltGr 128 | 0x31 | SHIFT, // | 124 + AltGr 129 | 0x30 | SHIFT, // } 125 + AltGr 130 | 0x35 | SHIFT, // ~ 126 + AltGr 131 | 0x00 // DEL 127 132 | }; 133 | bool _altGrMap[128]; 134 | bool _altFine = false; 135 | 136 | void initAltGr() { 137 | _altFine = true; 138 | 139 | _altGrMap[35] = true; 140 | _altGrMap[36] = true; 141 | _altGrMap[38] = true; 142 | _altGrMap[42] = true; 143 | _altGrMap[60] = true; 144 | _altGrMap[62] = true; 145 | _altGrMap[64] = true; 146 | _altGrMap[91] = true; 147 | _altGrMap[92] = true; 148 | _altGrMap[93] = true; 149 | _altGrMap[94] = true; 150 | _altGrMap[96] = true; 151 | _altGrMap[123] = true; 152 | _altGrMap[124] = true; 153 | _altGrMap[125] = true; 154 | _altGrMap[126] = true; 155 | } 156 | -------------------------------------------------------------------------------- /modules/arduino/locales/uk.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * Local generated by Matthew Milan. https://devleaf.com 3 | */ 4 | 5 | #define SHIFT 0x80 6 | const uint8_t _asciimap[128] = 7 | { 8 | 0x00, // NUL 9 | 0x00, // SOH 10 | 0x00, // STX 11 | 0x00, // ETX 12 | 0x00, // EOT 13 | 0x00, // ENQ 14 | 0x00, // ACK 15 | 0x00, // BEL 16 | 0x2a, // BS Backspace 17 | 0x2b, // TAB Tab 18 | 0x28, // LF Enter 19 | 0x00, // VT 20 | 0x00, // FF 21 | 0x00, // CR 22 | 0x00, // SO 23 | 0x00, // SI 24 | 0x00, // DEL 25 | 0x00, // DC1 26 | 0x00, // DC2 27 | 0x00, // DC3 28 | 0x00, // DC4 29 | 0x00, // NAK 30 | 0x00, // SYN 31 | 0x00, // ETB 32 | 0x00, // CAN 33 | 0x00, // EM 34 | 0x00, // SUB 35 | 0x00, // ESC 36 | 0x00, // FS 37 | 0x00, // GS 38 | 0x00, // RS 39 | 0x00, // US 40 | 41 | 0x2c, // ' ' 42 | 0x1e|SHIFT, // ! 43 | 0x1f|SHIFT, // " , 44 | 0x31, // # 45 | 0x21|SHIFT, // $ 46 | 0x22|SHIFT, // % 47 | 0x24|SHIFT, // & 48 | 0x34, // ' 49 | 0x26|SHIFT, // ( 50 | 0x27|SHIFT, // ) 51 | 0x25|SHIFT, // * 52 | 0x2e|SHIFT, // + 53 | 0x36, // , 54 | 0x2d, // - 55 | 0x37, // . 56 | 0x38, // / 57 | 0x27, // 0 58 | 0x1e, // 1 59 | 0x1f, // 2 60 | 0x20, // 3 61 | 0x21, // 4 62 | 0x22, // 5 63 | 0x23, // 6 64 | 0x24, // 7 65 | 0x25, // 8 66 | 0x26, // 9 67 | 0x33|SHIFT, // : 68 | 0x33, // ; 69 | 0x36|SHIFT, // < 70 | 0x2e, // = 71 | 0x37|SHIFT, // > 72 | 0x38|SHIFT, // ? 73 | 0x34|SHIFT, // @ 74 | 0x04|SHIFT, // A 75 | 0x05|SHIFT, // B 76 | 0x06|SHIFT, // C 77 | 0x07|SHIFT, // D 78 | 0x08|SHIFT, // E 79 | 0x09|SHIFT, // F 80 | 0x0a|SHIFT, // G 81 | 0x0b|SHIFT, // H 82 | 0x0c|SHIFT, // I 83 | 0x0d|SHIFT, // J 84 | 0x0e|SHIFT, // K 85 | 0x0f|SHIFT, // L 86 | 0x10|SHIFT, // M 87 | 0x11|SHIFT, // N 88 | 0x12|SHIFT, // O 89 | 0x13|SHIFT, // P 90 | 0x14|SHIFT, // Q 91 | 0x15|SHIFT, // R 92 | 0x16|SHIFT, // S 93 | 0x17|SHIFT, // T 94 | 0x18|SHIFT, // U 95 | 0x19|SHIFT, // V 96 | 0x1a|SHIFT, // W 97 | 0x1b|SHIFT, // X 98 | 0x1c|SHIFT, // Y 99 | 0x1d|SHIFT, // Z 100 | 0x2f, // [ 101 | 0x64, // bslash 102 | 0x30, // ] 103 | 0x23|SHIFT, // ^ 104 | 0x2d|SHIFT, // _ 105 | 0x35, // ` 106 | 0x04, // a 107 | 0x05, // b 108 | 0x06, // c 109 | 0x07, // d 110 | 0x08, // e 111 | 0x09, // f 112 | 0x0a, // g 113 | 0x0b, // h 114 | 0x0c, // i 115 | 0x0d, // j 116 | 0x0e, // k 117 | 0x0f, // l 118 | 0x10, // m 119 | 0x11, // n 120 | 0x12, // o 121 | 0x13, // p 122 | 0x14, // q 123 | 0x15, // r 124 | 0x16, // s 125 | 0x17, // t 126 | 0x18, // u 127 | 0x19, // v 128 | 0x1a, // w 129 | 0x1b, // x 130 | 0x1c, // y 131 | 0x1d, // z 132 | 0x2f|SHIFT, // { 133 | 0x64|SHIFT, // | 134 | 0x30|SHIFT, // } 135 | 0x31|SHIFT, // ~ 136 | 0 // DEL 137 | }; 138 | 139 | // Init var 140 | bool _altGrMap[128]; 141 | bool _altFine = false; 142 | 143 | // Individually define all needed char 144 | void initAltGr() {_altFine = true;} 145 | -------------------------------------------------------------------------------- /modules/arduino/locales/us.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * _asciimap took from Keyboard.cpp, don't need to be modified 3 | */ 4 | 5 | #define SHIFT 0x80 6 | const uint8_t _asciimap[128] = 7 | { 8 | 0x00, // NUL 9 | 0x00, // SOH 10 | 0x00, // STX 11 | 0x00, // ETX 12 | 0x00, // EOT 13 | 0x00, // ENQ 14 | 0x00, // ACK 15 | 0x00, // BEL 16 | 0x2a, // BS Backspace 17 | 0x2b, // TAB Tab 18 | 0x28, // LF Enter 19 | 0x00, // VT 20 | 0x00, // FF 21 | 0x00, // CR 22 | 0x00, // SO 23 | 0x00, // SI 24 | 0x00, // DEL 25 | 0x00, // DC1 26 | 0x00, // DC2 27 | 0x00, // DC3 28 | 0x00, // DC4 29 | 0x00, // NAK 30 | 0x00, // SYN 31 | 0x00, // ETB 32 | 0x00, // CAN 33 | 0x00, // EM 34 | 0x00, // SUB 35 | 0x00, // ESC 36 | 0x00, // FS 37 | 0x00, // GS 38 | 0x00, // RS 39 | 0x00, // US 40 | 41 | 0x2c, // ' ' 42 | 0x1e|SHIFT, // ! 43 | 0x34|SHIFT, // " 44 | 0x20|SHIFT, // # 45 | 0x21|SHIFT, // $ 46 | 0x22|SHIFT, // % 47 | 0x24|SHIFT, // & 48 | 0x34, // ' 49 | 0x26|SHIFT, // ( 50 | 0x27|SHIFT, // ) 51 | 0x25|SHIFT, // * 52 | 0x2e|SHIFT, // + 53 | 0x36, // , 54 | 0x2d, // - 55 | 0x37, // . 56 | 0x38, // / 57 | 0x27, // 0 58 | 0x1e, // 1 59 | 0x1f, // 2 60 | 0x20, // 3 61 | 0x21, // 4 62 | 0x22, // 5 63 | 0x23, // 6 64 | 0x24, // 7 65 | 0x25, // 8 66 | 0x26, // 9 67 | 0x33|SHIFT, // : 68 | 0x33, // ; 69 | 0x36|SHIFT, // < 70 | 0x2e, // = 71 | 0x37|SHIFT, // > 72 | 0x38|SHIFT, // ? 73 | 0x1f|SHIFT, // @ 74 | 0x04|SHIFT, // A 75 | 0x05|SHIFT, // B 76 | 0x06|SHIFT, // C 77 | 0x07|SHIFT, // D 78 | 0x08|SHIFT, // E 79 | 0x09|SHIFT, // F 80 | 0x0a|SHIFT, // G 81 | 0x0b|SHIFT, // H 82 | 0x0c|SHIFT, // I 83 | 0x0d|SHIFT, // J 84 | 0x0e|SHIFT, // K 85 | 0x0f|SHIFT, // L 86 | 0x10|SHIFT, // M 87 | 0x11|SHIFT, // N 88 | 0x12|SHIFT, // O 89 | 0x13|SHIFT, // P 90 | 0x14|SHIFT, // Q 91 | 0x15|SHIFT, // R 92 | 0x16|SHIFT, // S 93 | 0x17|SHIFT, // T 94 | 0x18|SHIFT, // U 95 | 0x19|SHIFT, // V 96 | 0x1a|SHIFT, // W 97 | 0x1b|SHIFT, // X 98 | 0x1c|SHIFT, // Y 99 | 0x1d|SHIFT, // Z 100 | 0x2f, // [ 101 | 0x31, // bslash 102 | 0x30, // ] 103 | 0x23|SHIFT, // ^ 104 | 0x2d|SHIFT, // _ 105 | 0x35, // ` 106 | 0x04, // a 107 | 0x05, // b 108 | 0x06, // c 109 | 0x07, // d 110 | 0x08, // e 111 | 0x09, // f 112 | 0x0a, // g 113 | 0x0b, // h 114 | 0x0c, // i 115 | 0x0d, // j 116 | 0x0e, // k 117 | 0x0f, // l 118 | 0x10, // m 119 | 0x11, // n 120 | 0x12, // o 121 | 0x13, // p 122 | 0x14, // q 123 | 0x15, // r 124 | 0x16, // s 125 | 0x17, // t 126 | 0x18, // u 127 | 0x19, // v 128 | 0x1a, // w 129 | 0x1b, // x 130 | 0x1c, // y 131 | 0x1d, // z 132 | 0x2f|SHIFT, // { 133 | 0x31|SHIFT, // | 134 | 0x30|SHIFT, // } 135 | 0x35|SHIFT, // ~ 136 | 0 // DEL 137 | }; 138 | 139 | // Init var 140 | bool _altGrMap[128]; 141 | bool _altFine = false; 142 | 143 | // Individually define all needed char 144 | void initAltGr() {_altFine = true;} 145 | -------------------------------------------------------------------------------- /modules/arduino/locales/po.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * _asciimap took from Keyboard.cpp, 3 | * Updated by brigadinhos with the correct keys for pt_PT keyboard 4 | */ 5 | 6 | #define SHIFT 0x80 7 | const uint8_t _asciimap[128] = 8 | { 9 | 0x00, // NUL 10 | 0x00, // SOH 11 | 0x00, // STX 12 | 0x00, // ETX 13 | 0x00, // EOT 14 | 0x00, // ENQ 15 | 0x00, // ACK 16 | 0x00, // BEL 17 | 0x2a, // BS Backspace 18 | 0x2b, // TAB Tab 19 | 0x28, // LF Enter 20 | 0x00, // VT 21 | 0x00, // FF 22 | 0x00, // CR 23 | 0x00, // SO 24 | 0x00, // SI 25 | 0x00, // DEL 26 | 0x00, // DC1 27 | 0x00, // DC2 28 | 0x00, // DC3 29 | 0x00, // DC4 30 | 0x00, // NAK 31 | 0x00, // SYN 32 | 0x00, // ETB 33 | 0x00, // CAN 34 | 0x00, // EM 35 | 0x00, // SUB 36 | 0x00, // ESC 37 | 0x00, // FS 38 | 0x00, // GS 39 | 0x00, // RS 40 | 0x00, // US 41 | 0x2c, // ' ' 42 | 0x1e|SHIFT, // ! 43 | 0x1f|SHIFT, // " 44 | 0x20|SHIFT, // # 45 | 0x21|SHIFT, // $ 46 | 0x22|SHIFT, // % 47 | 0x23|SHIFT, // & 48 | 0x2d, // ' 49 | 0x25|SHIFT, // ( 50 | 0x26|SHIFT, // ) 51 | 0x2f|SHIFT, // * 52 | 0x2f, // + 53 | 0x36, // , 54 | 0x38, // - 55 | 0x37, // . 56 | 0x24|SHIFT, // / 57 | 0x27, // 0 58 | 0x1e, // 1 59 | 0x1f, // 2 60 | 0x20, // 3 61 | 0x21, // 4 62 | 0x22, // 5 63 | 0x23, // 6 64 | 0x24, // 7 65 | 0x25, // 8 66 | 0x26, // 9 67 | 0x37|SHIFT, // : 68 | 0x36|SHIFT, // ; 69 | 0x64, // < 70 | 0x27|SHIFT, // = 71 | 0x64|SHIFT, // > 72 | 0x2d|SHIFT, // ? 73 | 0x1f, // @ 74 | 0x04|SHIFT, // A 75 | 0x05|SHIFT, // B 76 | 0x06|SHIFT, // C 77 | 0x07|SHIFT, // D 78 | 0x08|SHIFT, // E 79 | 0x09|SHIFT, // F 80 | 0x0a|SHIFT, // G 81 | 0x0b|SHIFT, // H 82 | 0x0c|SHIFT, // I 83 | 0x0d|SHIFT, // J 84 | 0x0e|SHIFT, // K 85 | 0x0f|SHIFT, // L 86 | 0x10|SHIFT, // M 87 | 0x11|SHIFT, // N 88 | 0x12|SHIFT, // O 89 | 0x13|SHIFT, // P 90 | 0x14|SHIFT, // Q 91 | 0x15|SHIFT, // R 92 | 0x16|SHIFT, // S 93 | 0x17|SHIFT, // T 94 | 0x18|SHIFT, // U 95 | 0x19|SHIFT, // V 96 | 0x1a|SHIFT, // W 97 | 0x1b|SHIFT, // X 98 | 0x1c|SHIFT, // Y 99 | 0x1d|SHIFT, // Z 100 | 0x25, // [ 101 | 0x35, // bslash 102 | 0x26, // ] 103 | 0x31|SHIFT, // ^ 104 | 0x38|SHIFT, // _ 105 | 0x30|SHIFT, // ` 106 | 0x04, // a 107 | 0x05, // b 108 | 0x06, // c 109 | 0x07, // d 110 | 0x08, // e 111 | 0x09, // f 112 | 0x0a, // g 113 | 0x0b, // h 114 | 0x0c, // i 115 | 0x0d, // j 116 | 0x0e, // k 117 | 0x0f, // l 118 | 0x10, // m 119 | 0x11, // n 120 | 0x12, // o 121 | 0x13, // p 122 | 0x14, // q 123 | 0x15, // r 124 | 0x16, // s 125 | 0x17, // t 126 | 0x18, // u 127 | 0x19, // v 128 | 0x1a, // w 129 | 0x1b, // x 130 | 0x1c, // y 131 | 0x1d, // z 132 | 0x24, // { 133 | 0x35|SHIFT, // | 134 | 0x27, // } 135 | 0x31, // ~ 136 | 0 // DEL 137 | }; 138 | 139 | // Init var 140 | bool _altGrMap[128]; 141 | bool _altFine = false; 142 | 143 | // Individually define all needed char 144 | void initAltGr() { 145 | _altFine = true; 146 | 147 | _altGrMap[91] = true; // [ 148 | _altGrMap[93] = true; // ] 149 | 150 | _altGrMap[123] = true; // { 151 | _altGrMap[125] = true; // } 152 | 153 | _altGrMap[64] = true; // @ 154 | } 155 | -------------------------------------------------------------------------------- /modules/arduino/locales/pobr.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * _asciimap took from Keyboard.cpp, 3 | * Updated by diegochaves with the correct keys for pt_BR keyboard 4 | */ 5 | 6 | #define SHIFT 0x80 7 | const uint8_t _asciimap[128] = 8 | { 9 | 0x00, // NUL 10 | 0x00, // SOH 11 | 0x00, // STX 12 | 0x00, // ETX 13 | 0x00, // EOT 14 | 0x00, // ENQ 15 | 0x00, // ACK 16 | 0x00, // BEL 17 | 0x2a, // BS Backspace 18 | 0x2b, // TAB Tab 19 | 0x28, // LF Enter 20 | 0x00, // VT 21 | 0x00, // FF 22 | 0x00, // CR 23 | 0x00, // SO 24 | 0x00, // SI 25 | 0x00, // DEL 26 | 0x00, // DC1 27 | 0x00, // DC2 28 | 0x00, // DC3 29 | 0x00, // DC4 30 | 0x00, // NAK 31 | 0x00, // SYN 32 | 0x00, // ETB 33 | 0x00, // CAN 34 | 0x00, // EM 35 | 0x00, // SUB 36 | 0x00, // ESC 37 | 0x00, // FS 38 | 0x00, // GS 39 | 0x00, // RS 40 | 0x00, // US 41 | 0x2c, // ' ' 42 | 0x1e|SHIFT, // ! 43 | 0x35|SHIFT, // " 44 | 0x20|SHIFT, // # 45 | 0x21|SHIFT, // $ 46 | 0x22|SHIFT, // % 47 | 0x24|SHIFT, // & 48 | 0x35, // ' 49 | 0x26|SHIFT, // ( 50 | 0x27|SHIFT, // ) 51 | 0x25|SHIFT, // * 52 | 0x2e|SHIFT, // + 53 | 0x36, // , 54 | 0x2d, // - 55 | 0x37, // . 56 | 0x14, // / 57 | 0x27, // 0 58 | 0x1e, // 1 59 | 0x1f, // 2 60 | 0x20, // 3 61 | 0x21, // 4 62 | 0x22, // 5 63 | 0x23, // 6 64 | 0x24, // 7 65 | 0x25, // 8 66 | 0x26, // 9 67 | 0x38|SHIFT, // : 68 | 0x38, // ; 69 | 0x36|SHIFT, // < 70 | 0x2e, // = 71 | 0x37|SHIFT, // > 72 | 0x1a, // ? 73 | 0x1f|SHIFT, // @ 74 | 0x04|SHIFT, // A 75 | 0x05|SHIFT, // B 76 | 0x06|SHIFT, // C 77 | 0x07|SHIFT, // D 78 | 0x08|SHIFT, // E 79 | 0x09|SHIFT, // F 80 | 0x0a|SHIFT, // G 81 | 0x0b|SHIFT, // H 82 | 0x0c|SHIFT, // I 83 | 0x0d|SHIFT, // J 84 | 0x0e|SHIFT, // K 85 | 0x0f|SHIFT, // L 86 | 0x10|SHIFT, // M 87 | 0x11|SHIFT, // N 88 | 0x12|SHIFT, // O 89 | 0x13|SHIFT, // P 90 | 0x14|SHIFT, // Q 91 | 0x15|SHIFT, // R 92 | 0x16|SHIFT, // S 93 | 0x17|SHIFT, // T 94 | 0x18|SHIFT, // U 95 | 0x19|SHIFT, // V 96 | 0x1a|SHIFT, // W 97 | 0x1b|SHIFT, // X 98 | 0x1c|SHIFT, // Y 99 | 0x1d|SHIFT, // Z 100 | 0x30, // [ 101 | 0x30, // bslash 102 | 0x31, // ] 103 | 0x34|SHIFT, // ^ 104 | 0x2d|SHIFT, // _ 105 | 0x2f|SHIFT, // ` 106 | 0x04, // a 107 | 0x05, // b 108 | 0x06, // c 109 | 0x07, // d 110 | 0x08, // e 111 | 0x09, // f 112 | 0x0a, // g 113 | 0x0b, // h 114 | 0x0c, // i 115 | 0x0d, // j 116 | 0x0e, // k 117 | 0x0f, // l 118 | 0x10, // m 119 | 0x11, // n 120 | 0x12, // o 121 | 0x13, // p 122 | 0x14, // q 123 | 0x15, // r 124 | 0x16, // s 125 | 0x17, // t 126 | 0x18, // u 127 | 0x19, // v 128 | 0x1a, // w 129 | 0x1b, // x 130 | 0x1c, // y 131 | 0x1d, // z 132 | 0x30|SHIFT, // { 133 | 0x2f|SHIFT, // | 134 | 0x31|SHIFT, // } 135 | 0x34, // ~ 136 | 0 // DEL 137 | }; 138 | 139 | // Init var 140 | bool _altGrMap[128]; 141 | bool _altFine = false; 142 | 143 | // Individually define all needed char 144 | void initAltGr() { 145 | _altFine = true; 146 | _altGrMap[47] = true; // / 147 | _altGrMap[63] = true; // ? 148 | } -------------------------------------------------------------------------------- /assets/js/lib/jquery-linenumbers.js: -------------------------------------------------------------------------------- 1 | function getCharByRow(e) { 2 | let name = Math.random().toString(36).substr(2, 12); 3 | let span = ''; 11 | $('body').append(span); 12 | 13 | $('#' + name).text('*'); 14 | let inith = $('#' + name).height(); 15 | 16 | let chars; 17 | for (chars = 1; $('#' + name).height() <= inith; chars++) 18 | $('#' + name).text("*".repeat(chars)); 19 | 20 | $('#' + name).remove(); 21 | return chars - 2; 22 | } 23 | 24 | function update(ev, self, opts, linebox) { 25 | /* Interpret keydown as change */ 26 | if (ev.type == 'keydown') { 27 | setTimeout(() => $(self).trigger('change'), 0); 28 | return; 29 | } 30 | 31 | /* Make sure height is right */ 32 | $(linebox).css('height', 33 | ($(self).height() 34 | + parseInt($(self).css('padding-top')) 35 | + parseInt($(self).css('padding-bottom'))) + 'px'); 36 | 37 | /* Get the number of printable char in line */ 38 | let charbr = getCharByRow($(self)); 39 | 40 | // Split value into lines 41 | let lines = $(self).val().split('\n'); 42 | // declare output var 43 | let output=''; 44 | // declare spacers and max_spacers vars, and set defaults 45 | let max_spacers = ''; 46 | for(i=0; i < opts.digits; i++) 47 | max_spacers += ' '; 48 | // Loop through and process each line 49 | $.each(lines, function(k, v) { 50 | // Add a line if not blank 51 | if (k != 0) 52 | output += '\n'; 53 | // Determine the appropriate number of leading spaces 54 | let lencheck = k + opts.start + '!'; 55 | let spacers = max_spacers.substr(lencheck.length - 1); 56 | // Add the line with out line number, to the output variable 57 | if (k >= Math.pow(10, opts.digits) - 1) 58 | output += "\n" 59 | else { 60 | output += spacers + (k + opts.start) + ':'; 61 | if (v != "") 62 | output += "\n--".repeat((v.length - 1) / charbr); 63 | } 64 | }); 65 | 66 | // Give the text area out modified content. 67 | $(linebox).val(output); 68 | // Change scroll position as they type, makes sure they stay in sync 69 | $(linebox).scrollTop($(self).scrollTop()); 70 | 71 | } 72 | 73 | /* On JQuery ready */ 74 | (function($) { 75 | $.fn.linenumbers = function(inopts){ 76 | let opts = $.extend({ 77 | width: 42, 78 | start: 1, 79 | digits: 3 80 | }, inopts); 81 | $('[data-name="linenumbers"]').remove(); 82 | 83 | return this.each(function() { 84 | let self = this; 85 | 86 | /* Generate the line number text-area */ 87 | $(this).before(''); 88 | 89 | /* Get the generated text-area and style it */ 90 | let linebox = $(self).parent().find('textarea[data-name="linenumbers"]'); 91 | $(linebox).css('width', opts.width + 'px'); 92 | $(linebox).css('height', 93 | ($(this).height() 94 | + parseInt($(this).css('padding-top')) 95 | + parseInt($(this).css('padding-bottom'))) + 'px'); 96 | $(linebox).css('padding-right', '0'); 97 | $(linebox).css('position', 'absolute'); 98 | $(linebox).css('overflow', 'hidden'); 99 | $(linebox).css('border-top-right-radius', '0'); 100 | $(linebox).css('border-bottom-right-radius', '0'); 101 | 102 | $(this).css({'padding-left': 103 | (opts.width + parseInt($(self).css('padding-left'))) + 'px', 104 | 'overflow': 'hidden'}); 105 | 106 | /* Update on events */ 107 | $(this).on('keydown keyup change', (ev) => update(ev, self, opts, linebox)); 108 | $(window).resize((ev) => update(ev, self, opts, linebox)); 109 | 110 | /* Scroll with the base text-area */ 111 | $(this).scroll(function() { 112 | $(linebox).scrollTop($(this).scrollTop()); 113 | }); 114 | 115 | /* Fire it off once to get things started */ 116 | $(this).trigger('change'); 117 | }); 118 | }; 119 | })(jQuery); 120 | -------------------------------------------------------------------------------- /modules/arduino/locales/it.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * The following character can't be typed: 3 | * "èéòçà°ù§ì£5€`~" 4 | * As you see you get the wrong character. Spaces mean you get nothing or the script crashes. 5 | */ 6 | 7 | #define SHIFT 0x80 8 | const uint8_t _asciimap[128] = 9 | { 10 | 0x00, // NUL 11 | 0x00, // SOH 12 | 0x00, // STX 13 | 0x00, // ETX 14 | 0x00, // EOT 15 | 0x00, // ENQ 16 | 0x00, // ACK 17 | 0x00, // BEL 18 | 0x2a, // BS Backspace 19 | 0x2b, // TAB Tab 20 | 0x28, // LF Enter 21 | 0x00, // VT 22 | 0x00, // FF 23 | 0x00, // CR 24 | 0x00, // SO 25 | 0x00, // SI 26 | 0x00, // DEL 27 | 0x00, // DC1 28 | 0x00, // DC2 29 | 0x00, // DC3 30 | 0x00, // DC4 31 | 0x00, // NAK 32 | 0x00, // SYN 33 | 0x00, // ETB 34 | 0x00, // CAN 35 | 0x00, // EM 36 | 0x00, // SUB 37 | 0x00, // ESC 38 | 0x00, // FS 39 | 0x00, // GS 40 | 0x00, // RS 41 | 0x00, // US 42 | 43 | 0x2c, // ' ' 44 | 0x1e|SHIFT, // ! 45 | 0x1f|SHIFT, // " 46 | 0x34, // # 47 | 0x21|SHIFT, // $ 48 | 0x22|SHIFT, // % 49 | 0x23|SHIFT, // & 50 | 0x2d, // ' 51 | 0x25|SHIFT, // ( 52 | 0x26|SHIFT, // ) 53 | 0x30|SHIFT, // * 54 | 0x30, // + 55 | 0x36, // , 56 | 0x38, // - 57 | 0x37, // . 58 | 0x24|SHIFT, // / 59 | 0x27, // 0 60 | 0x1e, // 1 61 | 0x1f, // 2 62 | 0x20, // 3 63 | 0x21, // 4 64 | 0x22, // 5 65 | 0x23, // 6 66 | 0x24, // 7 67 | 0x25, // 8 68 | 0x26, // 9 69 | 0x37|SHIFT, // : 70 | 0x36|SHIFT, // ; 71 | 0x64, // < 72 | 0x27|SHIFT, // = 73 | 0x64|SHIFT, // > 74 | 0x2d|SHIFT, // ? 75 | 0x33, // @ 76 | 0x04|SHIFT, // A 77 | 0x05|SHIFT, // B 78 | 0x06|SHIFT, // C 79 | 0x07|SHIFT, // D 80 | 0x08|SHIFT, // E 81 | 0x09|SHIFT, // F 82 | 0x0a|SHIFT, // G 83 | 0x0b|SHIFT, // H 84 | 0x0c|SHIFT, // I 85 | 0x0d|SHIFT, // J 86 | 0x0e|SHIFT, // K 87 | 0x0f|SHIFT, // L 88 | 0x10|SHIFT, // M 89 | 0x11|SHIFT, // N 90 | 0x12|SHIFT, // O 91 | 0x13|SHIFT, // P 92 | 0x14|SHIFT, // Q 93 | 0x15|SHIFT, // R 94 | 0x16|SHIFT, // S 95 | 0x17|SHIFT, // T 96 | 0x18|SHIFT, // U 97 | 0x19|SHIFT, // V 98 | 0x1a|SHIFT, // W 99 | 0x1b|SHIFT, // X 100 | 0x1c|SHIFT, // Y 101 | 0x1d|SHIFT, // Z 102 | 0x2f, // [ 103 | 0x35, // bslash 104 | 0x30, // ] 105 | 0x2e|SHIFT, // ^ 106 | 0x38|SHIFT, // _ 107 | 0x39, // ` 108 | 0x04, // a 109 | 0x05, // b 110 | 0x06, // c 111 | 0x07, // d 112 | 0x08, // e 113 | 0x09, // f 114 | 0x0a, // g 115 | 0x0b, // h 116 | 0x0c, // i 117 | 0x0d, // j 118 | 0x0e, // k 119 | 0x0f, // l 120 | 0x10, // m 121 | 0x11, // n 122 | 0x12, // o 123 | 0x13, // p 124 | 0x14, // q 125 | 0x15, // r 126 | 0x16, // s 127 | 0x17, // t 128 | 0x18, // u 129 | 0x19, // v 130 | 0x1a, // w 131 | 0x1b, // x 132 | 0x1c, // y 133 | 0x1d, // z 134 | 0x2f|SHIFT, // { 135 | 0x35|SHIFT, // | 136 | 0x30|SHIFT, // } 137 | 0x34, // ~ 138 | 0 // DEL 139 | }; 140 | 141 | // Init var 142 | bool _altGrMap[128]; 143 | bool _altFine = false; 144 | 145 | // Individually define all needed char 146 | void initAltGr() { 147 | _altFine = true; 148 | 149 | _altGrMap[35] = true; // # 150 | _altGrMap[64] = true; // @ 151 | 152 | _altGrMap[91] = true; // [ 153 | _altGrMap[93] = true; // ] 154 | 155 | _altGrMap[123] = true; // { 156 | _altGrMap[125] = true; // } 157 | _altGrMap[126] = true; // ~ 158 | } 159 | -------------------------------------------------------------------------------- /modules/arduino/locales/be.lang: -------------------------------------------------------------------------------- 1 | #define SHIFT 0x80 2 | const uint8_t _asciimap[128] = 3 | { 4 | 0x00, // NUL 5 | 0x00, // SOH 6 | 0x00, // STX 7 | 0x00, // ETX 8 | 0x00, // EOT 9 | 0x00, // ENQ 10 | 0x00, // ACK 11 | 0x00, // BEL 12 | 0x2a, // BS Backspace 13 | 0x2b, // TAB Tab 14 | 0x28, // LF Enter 15 | 0x00, // VT 16 | 0x00, // FF 17 | 0x00, // CR 18 | 0x00, // SO 19 | 0x00, // SI 20 | 0x00, // DEL 21 | 0x00, // DC1 22 | 0x00, // DC2 23 | 0x00, // DC3 24 | 0x00, // DC4 25 | 0x00, // NAK 26 | 0x00, // SYN 27 | 0x00, // ETB 28 | 0x00, // CAN 29 | 0x00, // EM 30 | 0x00, // SUB 31 | 0x00, // ESC 32 | 0x00, // FS 33 | 0x00, // GS 34 | 0x00, // RS 35 | 0x00, // US 36 | 0x2c, // ' ' 37 | 0x25, // ! 38 | 0x20, // " 39 | 0x20, // # 40 | 0x30, // $ 41 | 0x34|SHIFT, // % 42 | 0x1e, // & 43 | 0x21, // ' 44 | 0x22, // ( 45 | 0x2d, // ) 46 | 0x30|SHIFT, // * 47 | 0x38|SHIFT, // + 48 | 0x10, // , 49 | 0x2e, // - 50 | 0x36|SHIFT, // . 51 | 0x37|SHIFT, // / 52 | 0x27|SHIFT, // 0 53 | 0x1e|SHIFT, // 1 54 | 0x1f|SHIFT, // 2 55 | 0x20|SHIFT, // 3 56 | 0x21|SHIFT, // 4 57 | 0x22|SHIFT, // 5 58 | 0x23|SHIFT, // 6 59 | 0x24|SHIFT, // 7 60 | 0x25|SHIFT, // 8 61 | 0x26|SHIFT, // 9 62 | 0x37, // : 63 | 0x36, // ; 64 | 0x64, // < 65 | 0x38, // = 66 | 0x64|SHIFT, // > 67 | 0x10|SHIFT, // ? 68 | 0x27, // @ 69 | 0x14|SHIFT, // A 70 | 0x05|SHIFT, // B 71 | 0x06|SHIFT, // C 72 | 0x07|SHIFT, // D 73 | 0x08|SHIFT, // E 74 | 0x09|SHIFT, // F 75 | 0x0a|SHIFT, // G 76 | 0x0b|SHIFT, // H 77 | 0x0c|SHIFT, // I 78 | 0x0d|SHIFT, // J 79 | 0x0e|SHIFT, // K 80 | 0x0f|SHIFT, // L 81 | 0x33|SHIFT, // M 82 | 0x11|SHIFT, // N 83 | 0x12|SHIFT, // O 84 | 0x13|SHIFT, // P 85 | 0x04|SHIFT, // Q 86 | 0x15|SHIFT, // R 87 | 0x16|SHIFT, // S 88 | 0x17|SHIFT, // T 89 | 0x18|SHIFT, // U 90 | 0x19|SHIFT, // V 91 | 0x1d|SHIFT, // W 92 | 0x1b|SHIFT, // X 93 | 0x1c|SHIFT, // Y 94 | 0x1a|SHIFT, // Z 95 | 0x22, // [ 96 | 0x64, // bslash 97 | 0x30, // ] 98 | 0x22, // ^ 99 | 0x2e|SHIFT, // _ 100 | 0x24, // ` 101 | 0x14, // a 102 | 0x05, // b 103 | 0x06, // c 104 | 0x07, // d 105 | 0x08, // e 106 | 0x09, // f 107 | 0x0a, // g 108 | 0x0b, // h 109 | 0x0c, // i 110 | 0x0d, // j 111 | 0x0e, // k 112 | 0x0f, // l 113 | 0x33, // m 114 | 0x11, // n 115 | 0x12, // o 116 | 0x13, // p 117 | 0x04, // q 118 | 0x15, // r 119 | 0x16, // s 120 | 0x17, // t 121 | 0x18, // u 122 | 0x19, // v 123 | 0x1d, // w 124 | 0x1b, // x 125 | 0x1c, // y 126 | 0x1a, // z 127 | 0x21, // { 128 | 0x1e, // | 129 | 0x27, // } 130 | 0x38, // ~ 131 | 0 // DEL 132 | }; 133 | 134 | // Init var 135 | bool _altGrMap[128]; 136 | bool _altFine = false; 137 | 138 | // Individually define all needed char 139 | void initAltGr() { 140 | _altFine = true; 141 | 142 | _altGrMap[35] = true; // # 143 | _altGrMap[64] = true; // @ 144 | _altGrMap[91] = true; // [ 145 | _altGrMap[92] = true; // bslash fixed 146 | _altGrMap[93] = true; // ] 147 | _altGrMap[96] = true; // ` 148 | _altGrMap[123] = true; // { 149 | _altGrMap[124] = true; // | fixed 150 | _altGrMap[125] = true; // } fixed 151 | _altGrMap[127] = true; // ~ 152 | } 153 | -------------------------------------------------------------------------------- /modules/arduino/locales/su.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * Characters produced by dead keys (^ ~ `) do not work 3 | */ 4 | 5 | #define SHIFT 0x80 6 | const uint8_t _asciimap[128] = 7 | { 8 | 0x00, // NUL 9 | 0x00, // SOH 10 | 0x00, // STX 11 | 0x00, // ETX 12 | 0x00, // EOT 13 | 0x00, // ENQ 14 | 0x00, // ACK 15 | 0x00, // BEL 16 | 0x2a, // BS Backspace 17 | 0x2b, // TAB Tab 18 | 0x28, // LF Enter 19 | 0x00, // VT 20 | 0x00, // FF 21 | 0x00, // CR 22 | 0x00, // SO 23 | 0x00, // SI 24 | 0x00, // DEL 25 | 0x00, // DC1 26 | 0x00, // DC2 27 | 0x00, // DC3 28 | 0x00, // DC4 29 | 0x00, // NAK 30 | 0x00, // SYN 31 | 0x00, // ETB 32 | 0x00, // CAN 33 | 0x00, // EM 34 | 0x00, // SUB 35 | 0x00, // ESC 36 | 0x00, // FS 37 | 0x00, // GS 38 | 0x00, // RS 39 | 0x00, // US 40 | 41 | 0x2c, // ' ' 42 | 0x1e|SHIFT, // ! 43 | 0x1f|SHIFT, // " 44 | 0x20|SHIFT, // # 45 | 0x21, // $ 46 | 0x22|SHIFT, // % 47 | 0x23|SHIFT, // & 48 | 0x31, // ' 49 | 0x25|SHIFT, // ( 50 | 0x26|SHIFT, // ) 51 | 0x31|SHIFT, // * 52 | 0x2d, // + 53 | 0x36, // , 54 | 0x38, // - 55 | 0x37, // . 56 | 0x24|SHIFT, // / 57 | 0x27, // 0 58 | 0x1e, // 1 59 | 0x1f, // 2 60 | 0x20, // 3 61 | 0x21, // 4 62 | 0x22, // 5 63 | 0x23, // 6 64 | 0x24, // 7 65 | 0x25, // 8 66 | 0x26, // 9 67 | 0x37|SHIFT, // : 68 | 0x36|SHIFT, // ; 69 | 0x64, // < 70 | 0x27|SHIFT, // = 71 | 0x64|SHIFT, // > 72 | 0x2d|SHIFT, // ? 73 | 0x1f, // @ 74 | 0x04|SHIFT, // A 75 | 0x05|SHIFT, // B 76 | 0x06|SHIFT, // C 77 | 0x07|SHIFT, // D 78 | 0x08|SHIFT, // E 79 | 0x09|SHIFT, // F 80 | 0x0a|SHIFT, // G 81 | 0x0b|SHIFT, // H 82 | 0x0c|SHIFT, // I 83 | 0x0d|SHIFT, // J 84 | 0x0e|SHIFT, // K 85 | 0x0f|SHIFT, // L 86 | 0x10|SHIFT, // M 87 | 0x11|SHIFT, // N 88 | 0x12|SHIFT, // O 89 | 0x13|SHIFT, // P 90 | 0x14|SHIFT, // Q 91 | 0x15|SHIFT, // R 92 | 0x16|SHIFT, // S 93 | 0x17|SHIFT, // T 94 | 0x18|SHIFT, // U 95 | 0x19|SHIFT, // V 96 | 0x1a|SHIFT, // W 97 | 0x1b|SHIFT, // X 98 | 0x1c|SHIFT, // Y 99 | 0x1d|SHIFT, // Z 100 | 0x25, // [ 101 | 0x2d, // bslash 102 | 0x26, // ] 103 | 0x23, // ^ 104 | 0x38|SHIFT, // _ 105 | 0x2d|SHIFT, // ` 106 | 0x04, // a 107 | 0x05, // b 108 | 0x06, // c 109 | 0x07, // d 110 | 0x08, // e 111 | 0x09, // f 112 | 0x0a, // g 113 | 0x0b, // h 114 | 0x0c, // i 115 | 0x0d, // j 116 | 0x0e, // k 117 | 0x0f, // l 118 | 0x10, // m 119 | 0x11, // n 120 | 0x12, // o 121 | 0x13, // p 122 | 0x14, // q 123 | 0x15, // r 124 | 0x16, // s 125 | 0x17, // t 126 | 0x18, // u 127 | 0x19, // v 128 | 0x1a, // w 129 | 0x1b, // x 130 | 0x1c, // y 131 | 0x1d, // z 132 | 0x24, // { 133 | 0x36, // | 134 | 0x27, // } 135 | 0x2d, // ~ 136 | 0 // DEL 137 | }; 138 | 139 | // Init var 140 | bool _altGrMap[128]; 141 | bool _altFine = false; 142 | 143 | // Individually define all needed char 144 | void initAltGr() { 145 | _altFine = true; 146 | _altGrMap[36] = true; // $ 147 | _altGrMap[64] = true; // @ 148 | _altGrMap[91] = true; // [ 149 | _altGrMap[92] = true; // bslash 150 | _altGrMap[93] = true; // ] 151 | _altGrMap[94] = true; // ^ 152 | _altGrMap[96] = true; // ` 153 | _altGrMap[123] = true; // { 154 | _altGrMap[124] = true; // | 155 | _altGrMap[125] = true; // } 156 | _altGrMap[126] = true; // ~ 157 | } 158 | -------------------------------------------------------------------------------- /modules/arduino/locales/es.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * _asciimap took from Keyboard.cpp, 3 | * Updated by Borja Garduño with the correct keys, 4 | * and ~, ^ and `, fixed by BlueArduino20. 5 | */ 6 | 7 | #define SHIFT 0x80 8 | const uint8_t _asciimap[128] = 9 | { 10 | 0x00, // NUL 11 | 0x00, // SOH 12 | 0x00, // STX 13 | 0x00, // ETX 14 | 0x00, // EOT 15 | 0x00, // ENQ 16 | 0x00, // ACK 17 | 0x00, // BEL 18 | 0x2a, // BS Backspace 19 | 0x2b, // TAB Tab 20 | 0x28, // LF Enter 21 | 0x00, // VT 22 | 0x00, // FF 23 | 0x00, // CR 24 | 0x00, // SO 25 | 0x00, // SI 26 | 0x00, // DEL 27 | 0x00, // DC1 28 | 0x00, // DC2 29 | 0x00, // DC3 30 | 0x00, // DC4 31 | 0x00, // NAK 32 | 0x00, // SYN 33 | 0x00, // ETB 34 | 0x00, // CAN 35 | 0x00, // EM 36 | 0x00, // SUB 37 | 0x00, // ESC 38 | 0x00, // FS 39 | 0x00, // GS 40 | 0x00, // RS 41 | 0x00, // US 42 | 43 | 0x2c, // ' ' 44 | 0x1e|SHIFT, // ! 45 | 0x1f|SHIFT, // " 46 | 0x20, // # 47 | 0x21|SHIFT, // $ 48 | 0x22|SHIFT, // % 49 | 0x23|SHIFT, // & 50 | 0x2d, // ' 51 | 0x25|SHIFT, // ( 52 | 0x26|SHIFT, // ) 53 | 0x30|SHIFT, // * 54 | 0x30, // + 55 | 0x36, // , 56 | 0x38, // - 57 | 0x37, // . 58 | 0x24|SHIFT, // / 59 | 0x27, // 0 60 | 0x1e, // 1 61 | 0x1f, // 2 62 | 0x20, // 3 63 | 0x21, // 4 64 | 0x22, // 5 65 | 0x23, // 6 66 | 0x24, // 7 67 | 0x25, // 8 68 | 0x26, // 9 69 | 0x37|SHIFT, // : 70 | 0x36|SHIFT, // ; 71 | 0x64, // < 72 | 0x27|SHIFT, // = 73 | 0x64|SHIFT, // > 74 | 0x2d|SHIFT, // ? 75 | 0x1f, // @ 76 | 0x04|SHIFT, // A 77 | 0x05|SHIFT, // B 78 | 0x06|SHIFT, // C 79 | 0x07|SHIFT, // D 80 | 0x08|SHIFT, // E 81 | 0x09|SHIFT, // F 82 | 0x0a|SHIFT, // G 83 | 0x0b|SHIFT, // H 84 | 0x0c|SHIFT, // I 85 | 0x0d|SHIFT, // J 86 | 0x0e|SHIFT, // K 87 | 0x0f|SHIFT, // L 88 | 0x10|SHIFT, // M 89 | 0x11|SHIFT, // N 90 | 0x12|SHIFT, // O 91 | 0x13|SHIFT, // P 92 | 0x14|SHIFT, // Q 93 | 0x15|SHIFT, // R 94 | 0x16|SHIFT, // S 95 | 0x17|SHIFT, // T 96 | 0x18|SHIFT, // U 97 | 0x19|SHIFT, // V 98 | 0x1a|SHIFT, // W 99 | 0x1b|SHIFT, // X 100 | 0x1c|SHIFT, // Y 101 | 0x1d|SHIFT, // Z 102 | 0x2f, // [ 103 | 0x35, // bslash 104 | 0x30, // ] 105 | 0x2f|SHIFT, // ^ 106 | 0x38|SHIFT, // _ 107 | 0x2f, // ` 108 | 0x04, // a 109 | 0x05, // b 110 | 0x06, // c 111 | 0x07, // d 112 | 0x08, // e 113 | 0x09, // f 114 | 0x0a, // g 115 | 0x0b, // h 116 | 0x0c, // i 117 | 0x0d, // j 118 | 0x0e, // k 119 | 0x0f, // l 120 | 0x10, // m 121 | 0x11, // n 122 | 0x12, // o 123 | 0x13, // p 124 | 0x14, // q 125 | 0x15, // r 126 | 0x16, // s 127 | 0x17, // t 128 | 0x18, // u 129 | 0x19, // v 130 | 0x1a, // w 131 | 0x1b, // x 132 | 0x1c, // y 133 | 0x1d, // z 134 | 0x34, // { 135 | 0x1e, // | 136 | 0x32, // } 137 | 0x21, // ^ 138 | 0 // DEL 139 | 140 | }; 141 | 142 | // Init var 143 | bool _altGrMap[128]; 144 | bool _altFine = false; 145 | 146 | // Individually define all needed char 147 | void initAltGr() { 148 | _altFine = true; 149 | 150 | _altGrMap[126] = true; // ~ 151 | _altGrMap[123] = true; // { 152 | _altGrMap[91] = true; // [ 153 | _altGrMap[93] = true; // ] 154 | _altGrMap[125] = true; // } 155 | _altGrMap[92] = true; // bslash 156 | _altGrMap[124] = true; // | 157 | _altGrMap[64] = true; // @ 158 | _altGrMap[35] = true; // # 159 | } 160 | -------------------------------------------------------------------------------- /modules/arduino/locales/tr.lang: -------------------------------------------------------------------------------- 1 | /* Grave Accent(`) not working yet. AltGr + , combination work only from keyboard. */ 2 | 3 | #define SHIFT 0x80 4 | const uint8_t _asciimap[128] = 5 | { 6 | 0x00, // NUL 7 | 0x00, // SOH 8 | 0x00, // STX 9 | 0x00, // ETX 10 | 0x00, // EOT 11 | 0x00, // ENQ 12 | 0x00, // ACK 13 | 0x00, // BEL 14 | 0x2a, // BS Backspace 15 | 0x2b, // TAB Tab 16 | 0x28, // LF Enter 17 | 0x00, // VT 18 | 0x00, // FF 19 | 0x00, // CR 20 | 0x00, // SO 21 | 0x00, // SI 22 | 0x00, // DEL 23 | 0x00, // DC1 24 | 0x00, // DC2 25 | 0x00, // DC3 26 | 0x00, // DC4 27 | 0x00, // NAK 28 | 0x00, // SYN 29 | 0x00, // ETB 30 | 0x00, // CAN 31 | 0x00, // EM 32 | 0x00, // SUB 33 | 0x00, // ESC 34 | 0x00, // FS 35 | 0x00, // GS 36 | 0x00, // RS 37 | 0x00, // US 38 | 39 | 0x2c, // ' ' 40 | 0x1e|SHIFT, // ! 41 | 0x35, // " 42 | 0x20, // # 43 | 0x21, // $ 44 | 0x22|SHIFT, // % 45 | 0x23|SHIFT, // & 46 | 0x1f|SHIFT, // ' 47 | 0x25|SHIFT, // ( 48 | 0x26|SHIFT, // ) 49 | 0x2d, // * 50 | 0x21|SHIFT, // + 51 | 0x31, // , 52 | 0x2e, // - 53 | 0x38, // . 54 | 0x24|SHIFT, // / 55 | 0x27, // 0 56 | 0x1e, // 1 57 | 0x1f, // 2 58 | 0x20, // 3 59 | 0x21, // 4 60 | 0x22, // 5 61 | 0x23, // 6 62 | 0x24, // 7 63 | 0x25, // 8 64 | 0x26, // 9 65 | 0x38|SHIFT, // : 66 | 0x31|SHIFT, // ; 67 | 0x64, // < 68 | 0x27|SHIFT, // = 69 | 0x64|SHIFT, // > 70 | 0x2d|SHIFT, // ? 71 | 0x14, // @ 72 | 0x04|SHIFT, // A 73 | 0x05|SHIFT, // B 74 | 0x06|SHIFT, // C 75 | 0x07|SHIFT, // D 76 | 0x08|SHIFT, // E 77 | 0x09|SHIFT, // F 78 | 0x0a|SHIFT, // G 79 | 0x0b|SHIFT, // H 80 | 0x0c|SHIFT, // I 81 | 0x0d|SHIFT, // J 82 | 0x0e|SHIFT, // K 83 | 0x0f|SHIFT, // L 84 | 0x10|SHIFT, // M 85 | 0x11|SHIFT, // N 86 | 0x12|SHIFT, // O 87 | 0x13|SHIFT, // P 88 | 0x14|SHIFT, // Q 89 | 0x15|SHIFT, // R 90 | 0x16|SHIFT, // S 91 | 0x17|SHIFT, // T 92 | 0x18|SHIFT, // U 93 | 0x19|SHIFT, // V 94 | 0x1a|SHIFT, // W 95 | 0x1b|SHIFT, // X 96 | 0x1c|SHIFT, // Y 97 | 0x1d|SHIFT, // Z 98 | 0x25, // [ 99 | 0x2d, // bslash 100 | 0x26, // ] 101 | 0x20|SHIFT, // ^ 102 | 0x2e|SHIFT, // _ 103 | 0x35, // ` //DOES NOT WORK 104 | 0x04, // a 105 | 0x05, // b 106 | 0x06, // c 107 | 0x07, // d 108 | 0x08, // e 109 | 0x09, // f 110 | 0x0a, // g 111 | 0x0b, // h 112 | 0x34, // i 113 | 0x0d, // j 114 | 0x0e, // k 115 | 0x0f, // l 116 | 0x10, // m 117 | 0x11, // n 118 | 0x12, // o 119 | 0x13, // p 120 | 0x14, // q 121 | 0x15, // r 122 | 0x16, // s 123 | 0x17, // t 124 | 0x18, // u 125 | 0x19, // v 126 | 0x1a, // w 127 | 0x1b, // x 128 | 0x1c, // y 129 | 0x1d, // z 130 | 0x24, // { 131 | 0x64, // | 132 | 0x27, // } 133 | 0x30, // ~ 134 | 0 // DEL 135 | }; 136 | 137 | // Init var 138 | bool _altGrMap[128]; 139 | bool _altFine = false; 140 | 141 | // Individually define all needed char 142 | void initAltGr() { 143 | _altFine = true; 144 | 145 | _altGrMap[126] = true; // ~ 146 | _altGrMap[123] = true; // { 147 | _altGrMap[64] = true; // @ 148 | _altGrMap[91] = true; // [ 149 | _altGrMap[92] = true; // bslash 150 | _altGrMap[93] = true; // ] 151 | //_altGrMap[96] = true; // ` DOES NOT WORK YET. 152 | _altGrMap[124] = true; // | 153 | _altGrMap[35] = true; // # 154 | _altGrMap[36] = true; // $ 155 | _altGrMap[125] = true; // } 156 | } 157 | -------------------------------------------------------------------------------- /modules/arduino/locales/fr.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * _asciimap took from internet, fixed by Thecakeisgit 3 | */ 4 | 5 | #define SHIFT 0x80 6 | const uint8_t _asciimap[128] = 7 | { 8 | 0x00, // NUL 9 | 0x00, // SOH 10 | 0x00, // STX 11 | 0x00, // ETX 12 | 0x00, // EOT 13 | 0x00, // ENQ 14 | 0x00, // ACK 15 | 0x00, // BEL 16 | 0x2a, // BS Backspace 17 | 0x2b, // TAB Tab 18 | 0x28, // LF Enter 19 | 0x00, // VT 20 | 0x00, // FF 21 | 0x00, // CR 22 | 0x00, // SO 23 | 0x00, // SI 24 | 0x00, // DEL 25 | 0x00, // DC1 26 | 0x00, // DC2 27 | 0x00, // DC3 28 | 0x00, // DC4 29 | 0x00, // NAK 30 | 0x00, // SYN 31 | 0x00, // ETB 32 | 0x00, // CAN 33 | 0x00, // EM 34 | 0x00, // SUB 35 | 0x00, // ESC 36 | 0x00, // FS 37 | 0x00, // GS 38 | 0x00, // RS 39 | 0x00, // US 40 | 41 | 0x2c, // ' ' 42 | 0x38, // ! 43 | 0x20, // " 44 | 0x20, // # 45 | 0x30, // $ 46 | 0x34|SHIFT, // % 47 | 0x1e, // & 48 | 0x21, // ' 49 | 0x22, // ( 50 | 0x2d, // ) 51 | 0x31, // * 52 | 0x2e|SHIFT, // + 53 | 0x10, // , 54 | 0x23, // - 55 | 0x36|SHIFT, // . 56 | 0x37|SHIFT, // / 57 | 0x27|SHIFT, // 0 58 | 0x1e|SHIFT, // 1 59 | 0x1f|SHIFT, // 2 60 | 0x20|SHIFT, // 3 61 | 0x21|SHIFT, // 4 62 | 0x22|SHIFT, // 5 63 | 0x23|SHIFT, // 6 64 | 0x24|SHIFT, // 7 65 | 0x25|SHIFT, // 8 66 | 0x26|SHIFT, // 9 67 | 0x37, // : 68 | 0x36, // ; 69 | 0x64, // < 70 | 0x2e, // = 71 | 0x64|SHIFT, // > 72 | 0x10|SHIFT, // ? 73 | 0x27, // @ 74 | 0x14|SHIFT, // A 75 | 0x05|SHIFT, // B 76 | 0x06|SHIFT, // C 77 | 0x07|SHIFT, // D 78 | 0x08|SHIFT, // E 79 | 0x09|SHIFT, // F 80 | 0x0a|SHIFT, // G 81 | 0x0b|SHIFT, // H 82 | 0x0c|SHIFT, // I 83 | 0x0d|SHIFT, // J 84 | 0x0e|SHIFT, // K 85 | 0x0f|SHIFT, // L 86 | 0x33|SHIFT, // M 87 | 0x11|SHIFT, // N 88 | 0x12|SHIFT, // O 89 | 0x13|SHIFT, // P 90 | 0x04|SHIFT, // Q 91 | 0x15|SHIFT, // R 92 | 0x16|SHIFT, // S 93 | 0x17|SHIFT, // T 94 | 0x18|SHIFT, // U 95 | 0x19|SHIFT, // V 96 | 0x1d|SHIFT, // W 97 | 0x1b|SHIFT, // X 98 | 0x1c|SHIFT, // Y 99 | 0x1a|SHIFT, // Z 100 | 0x22, // [ 101 | 0x25, // bslash 102 | 0x2d, // ] 103 | 0x26, // ^ 104 | 0x25, // _ 105 | 0x24, // ` 106 | 0x14, // a 107 | 0x05, // b 108 | 0x06, // c 109 | 0x07, // d 110 | 0x08, // e 111 | 0x09, // f 112 | 0x0a, // g 113 | 0x0b, // h 114 | 0x0c, // i 115 | 0x0d, // j 116 | 0x0e, // k 117 | 0x0f, // l 118 | 0x33, // m 119 | 0x11, // n 120 | 0x12, // o 121 | 0x13, // p 122 | 0x04, // q 123 | 0x15, // r 124 | 0x16, // s 125 | 0x17, // t 126 | 0x18, // u 127 | 0x19, // v 128 | 0x1d, // w 129 | 0x1b, // x 130 | 0x1c, // y 131 | 0x1a, // z 132 | 0x21, // { 133 | 0x23, // | 134 | 0x2e, // } 135 | 0x1f, // ~ 136 | 0 // DEL 137 | }; 138 | 139 | // Init var 140 | bool _altGrMap[128]; 141 | bool _altFine = false; 142 | 143 | // Individually define all needed char 144 | void initAltGr() { 145 | _altFine = true; 146 | 147 | _altGrMap[35] = true; // # 148 | _altGrMap[64] = true; // @ 149 | 150 | _altGrMap[91] = true; // [ 151 | _altGrMap[92] = true; // bslash 152 | _altGrMap[93] = true; // ] 153 | _altGrMap[94] = true; // ^ 154 | 155 | _altGrMap[96] = true; // ` 156 | 157 | _altGrMap[123] = true; // { 158 | _altGrMap[124] = true; // | 159 | _altGrMap[125] = true; // } 160 | _altGrMap[126] = true; // ~ 161 | } 162 | 163 | -------------------------------------------------------------------------------- /modules/arduino/locales/sample.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * This is the sample _asciimap that you need to modify 3 | * to make it work with your locale. 4 | * This file is organized in 2 modifiable parts : 5 | * - The _asciimap var. 6 | * - The initAltGr() function (with the _altGrMap var). 7 | * 8 | * The modification are made on the _asciimap to fit with 9 | * the commented char when tested, and _altGrMap is optional, 10 | * you need to use it only if this is needed by you keyMap. 11 | * 12 | * Example : to make '@' you need to do 'AltGR' + '0', so 13 | * you add _altGrMap[n] = true; in function intAltGr(), where 14 | * n is the rank of the key (in this case the key is '0' so 15 | * n=64). 16 | */ 17 | 18 | #define SHIFT 0x80 19 | const uint8_t _asciimap[128] = 20 | { 21 | 0x00, // NUL 22 | 0x00, // SOH 23 | 0x00, // STX 24 | 0x00, // ETX 25 | 0x00, // EOT 26 | 0x00, // ENQ 27 | 0x00, // ACK 28 | 0x00, // BEL 29 | 0x2a, // BS Backspace 30 | 0x2b, // TAB Tab 31 | 0x28, // LF Enter 32 | 0x00, // VT 33 | 0x00, // FF 34 | 0x00, // CR 35 | 0x00, // SO 36 | 0x00, // SI 37 | 0x00, // DEL 38 | 0x00, // DC1 39 | 0x00, // DC2 40 | 0x00, // DC3 41 | 0x00, // DC4 42 | 0x00, // NAK 43 | 0x00, // SYN 44 | 0x00, // ETB 45 | 0x00, // CAN 46 | 0x00, // EM 47 | 0x00, // SUB 48 | 0x00, // ESC 49 | 0x00, // FS 50 | 0x00, // GS 51 | 0x00, // RS 52 | 0x00, // US 53 | 54 | 0x2c, // ' ' 55 | 0x1e|SHIFT, // ! 56 | 0x34|SHIFT, // " 57 | 0x20|SHIFT, // # 58 | 0x21|SHIFT, // $ 59 | 0x22|SHIFT, // % 60 | 0x24|SHIFT, // & 61 | 0x34, // ' 62 | 0x26|SHIFT, // ( 63 | 0x27|SHIFT, // ) 64 | 0x25|SHIFT, // * 65 | 0x2e|SHIFT, // + 66 | 0x36, // , 67 | 0x2d, // - 68 | 0x37, // . 69 | 0x38, // / 70 | 0x27, // 0 71 | 0x1e, // 1 72 | 0x1f, // 2 73 | 0x20, // 3 74 | 0x21, // 4 75 | 0x22, // 5 76 | 0x23, // 6 77 | 0x24, // 7 78 | 0x25, // 8 79 | 0x26, // 9 80 | 0x33|SHIFT, // : 81 | 0x33, // ; 82 | 0x36|SHIFT, // < 83 | 0x2e, // = 84 | 0x37|SHIFT, // > 85 | 0x38|SHIFT, // ? 86 | 0x1f|SHIFT, // @ 87 | 0x04|SHIFT, // A 88 | 0x05|SHIFT, // B 89 | 0x06|SHIFT, // C 90 | 0x07|SHIFT, // D 91 | 0x08|SHIFT, // E 92 | 0x09|SHIFT, // F 93 | 0x0a|SHIFT, // G 94 | 0x0b|SHIFT, // H 95 | 0x0c|SHIFT, // I 96 | 0x0d|SHIFT, // J 97 | 0x0e|SHIFT, // K 98 | 0x0f|SHIFT, // L 99 | 0x10|SHIFT, // M 100 | 0x11|SHIFT, // N 101 | 0x12|SHIFT, // O 102 | 0x13|SHIFT, // P 103 | 0x14|SHIFT, // Q 104 | 0x15|SHIFT, // R 105 | 0x16|SHIFT, // S 106 | 0x17|SHIFT, // T 107 | 0x18|SHIFT, // U 108 | 0x19|SHIFT, // V 109 | 0x1a|SHIFT, // W 110 | 0x1b|SHIFT, // X 111 | 0x1c|SHIFT, // Y 112 | 0x1d|SHIFT, // Z 113 | 0x2f, // [ 114 | 0x31, // bslash 115 | 0x30, // ] 116 | 0x23|SHIFT, // ^ 117 | 0x2d|SHIFT, // _ 118 | 0x35, // ` 119 | 0x04, // a 120 | 0x05, // b 121 | 0x06, // c 122 | 0x07, // d 123 | 0x08, // e 124 | 0x09, // f 125 | 0x0a, // g 126 | 0x0b, // h 127 | 0x0c, // i 128 | 0x0d, // j 129 | 0x0e, // k 130 | 0x0f, // l 131 | 0x10, // m 132 | 0x11, // n 133 | 0x12, // o 134 | 0x13, // p 135 | 0x14, // q 136 | 0x15, // r 137 | 0x16, // s 138 | 0x17, // t 139 | 0x18, // u 140 | 0x19, // v 141 | 0x1a, // w 142 | 0x1b, // x 143 | 0x1c, // y 144 | 0x1d, // z 145 | 0x2f|SHIFT, // { 146 | 0x31|SHIFT, // | 147 | 0x30|SHIFT, // } 148 | 0x35|SHIFT, // ~ 149 | 0 // DEL 150 | }; 151 | 152 | // Init var 153 | bool _altGrMap[128]; 154 | bool _altFine = false; 155 | 156 | // Individually define all needed char 157 | void initAltGr() {_altFine = true;} 158 | -------------------------------------------------------------------------------- /modules/arduino/locales/sv.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * This is based off of the Danish locale. 3 | * Due to how the Swedish keyboard works, some characters (~, ^, `) have to be pressed twice. On ubuntu two presses creates one character, 4 | * on Windows one press creates no charater and two presses creates two. 5 | * 6 | * This means that the required test string is "!"#$%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^^``_abcdefghijklmnopqrstuvwxyz{|}~~ @" 7 | */ 8 | 9 | #define SHIFT 0x80 10 | const uint8_t _asciimap[128] = 11 | { 12 | 0x00, // NUL 13 | 0x00, // SOH 14 | 0x00, // STX 15 | 0x00, // ETX 16 | 0x00, // EOT 17 | 0x00, // ENQ 18 | 0x00, // ACK 19 | 0x00, // BEL 20 | 0x2a, // BS Backspace 21 | 0x2b, // TAB Tab 22 | 0x28, // LF Enter 23 | 0x00, // VT 24 | 0x00, // FF 25 | 0x00, // CR 26 | 0x00, // SO 27 | 0x00, // SI 28 | 0x00, // DEL 29 | 0x00, // DC1 30 | 0x00, // DC2 31 | 0x00, // DC3 32 | 0x00, // DC4 33 | 0x00, // NAK 34 | 0x00, // SYN 35 | 0x00, // ETB 36 | 0x00, // CAN 37 | 0x00, // EM 38 | 0x00, // SUB 39 | 0x00, // ESC 40 | 0x00, // FS 41 | 0x00, // GS 42 | 0x00, // RS 43 | 0x00, // US 44 | 45 | 0x2c, // ' ' 46 | 0x1e|SHIFT, // ! 47 | 0x1f|SHIFT, // " 48 | 0x20|SHIFT, // # 49 | 0x21, // $ 50 | 0x22|SHIFT, // % 51 | 0x23|SHIFT, // & 52 | 0x31, // ' 53 | 0x25|SHIFT, // ( 54 | 0x26|SHIFT, // ) 55 | 0x31|SHIFT, // * 56 | 0x2d, // + 57 | 0x36, // , 58 | 0x38, // - 59 | 0x37, // . 60 | 0x24|SHIFT, // / 61 | 0x27, // 0 62 | 0x1e, // 1 63 | 0x1f, // 2 64 | 0x20, // 3 65 | 0x21, // 4 66 | 0x22, // 5 67 | 0x23, // 6 68 | 0x24, // 7 69 | 0x25, // 8 70 | 0x26, // 9 71 | 0x37|SHIFT, // : 72 | 0x36|SHIFT, // ; 73 | 0x64, // < 74 | 0x27|SHIFT, // = 75 | 0x64|SHIFT, // > 76 | 0x2d|SHIFT, // ? 77 | 0x1f, // @ 78 | 0x04|SHIFT, // A 79 | 0x05|SHIFT, // B 80 | 0x06|SHIFT, // C 81 | 0x07|SHIFT, // D 82 | 0x08|SHIFT, // E 83 | 0x09|SHIFT, // F 84 | 0x0a|SHIFT, // G 85 | 0x0b|SHIFT, // H 86 | 0x0c|SHIFT, // I 87 | 0x0d|SHIFT, // J 88 | 0x0e|SHIFT, // K 89 | 0x0f|SHIFT, // L 90 | 0x10|SHIFT, // M 91 | 0x11|SHIFT, // N 92 | 0x12|SHIFT, // O 93 | 0x13|SHIFT, // P 94 | 0x14|SHIFT, // Q 95 | 0x15|SHIFT, // R 96 | 0x16|SHIFT, // S 97 | 0x17|SHIFT, // T 98 | 0x18|SHIFT, // U 99 | 0x19|SHIFT, // V 100 | 0x1a|SHIFT, // W 101 | 0x1b|SHIFT, // X 102 | 0x1c|SHIFT, // Y 103 | 0x1d|SHIFT, // Z 104 | 0x25, // [ 105 | 0x2d, // bslash 106 | 0x26, // ] 107 | 0x30|SHIFT, // ^ 108 | 0x38|SHIFT, // _ 109 | 0x2e|SHIFT, // ` 110 | 0x04, // a 111 | 0x05, // b 112 | 0x06, // c 113 | 0x07, // d 114 | 0x08, // e 115 | 0x09, // f 116 | 0x0a, // g 117 | 0x0b, // h 118 | 0x0c, // i 119 | 0x0d, // j 120 | 0x0e, // k 121 | 0x0f, // l 122 | 0x10, // m 123 | 0x11, // n 124 | 0x12, // o 125 | 0x13, // p 126 | 0x14, // q 127 | 0x15, // r 128 | 0x16, // s 129 | 0x17, // t 130 | 0x18, // u 131 | 0x19, // v 132 | 0x1a, // w 133 | 0x1b, // x 134 | 0x1c, // y 135 | 0x1d, // z 136 | 0x24, // { 137 | 0x64, // | 138 | 0x27, // } 139 | 0x30, // ~ 140 | 0 // DEL 141 | }; 142 | 143 | // Init var 144 | bool _altGrMap[128]; 145 | bool _altFine = false; 146 | 147 | // Individually define all needed char 148 | void initAltGr() { 149 | _altFine = true; 150 | 151 | _altGrMap[36] = true; // $ 152 | _altGrMap[64] = true; // @ 153 | _altGrMap[91] = true; // [ 154 | _altGrMap[92] = true; // bslash 155 | _altGrMap[93] = true; // ] 156 | _altGrMap[123] = true; // { 157 | _altGrMap[124] = true; // | 158 | _altGrMap[125] = true; // } 159 | _altGrMap[126] = true; // ~ 160 | } 161 | -------------------------------------------------------------------------------- /modules/arduino/locales/gr.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * The following character can't be typed: 3 | * "ß´üöä°§ÜÖIJ³€µ" 4 | * If you try to type these you get this result: ('"' can be typed) 5 | * "t ä´z qk 2 " 6 | * As you see you get the wrong character. Spaces mean you get nothing or the script crashes. 7 | */ 8 | 9 | #define SHIFT 0x80 10 | const uint8_t _asciimap[128] = 11 | { 12 | 0x00, // NUL 0 13 | 0x00, // SOH 14 | 0x00, // STX 15 | 0x00, // ETX 16 | 0x00, // EOT 17 | 0x00, // ENQ 18 | 0x00, // ACK 19 | 0x00, // BEL 20 | 0x2a, // BS Backspace 21 | 0x2b, // TAB Tab 22 | 0x28, // LF Enter 10 23 | 0x00, // VT 24 | 0x00, // FF 25 | 0x00, // CR 26 | 0x00, // SO 27 | 0x00, // SI 28 | 0x00, // DEL 29 | 0x00, // DC1 30 | 0x00, // DC2 31 | 0x00, // DC3 32 | 0x00, // DC4 20 33 | 0x00, // NAK 34 | 0x00, // SYN 35 | 0x00, // ETB 36 | 0x00, // CAN 37 | 0x00, // EM 38 | 0x00, // SUB 39 | 0x00, // ESC 40 | 0x00, // FS 41 | 0x00, // GS 42 | 0x00, // RS 30 43 | 0x00, // US 44 | 45 | 0x2c, // ' ' 46 | 0x1e|SHIFT, // ! 47 | 0x1f|SHIFT, // " 48 | 0x31, // # 49 | 0x21|SHIFT, // $ 50 | 0x22|SHIFT, // % 51 | 0x23|SHIFT, // & 52 | 0x31|SHIFT, // ' 53 | 0x25|SHIFT, // ( 40 54 | 0x26|SHIFT, // ) 55 | 0x30|SHIFT, // * 56 | 0x30, // + 57 | 0x36, // , 58 | 0x38, // - 59 | 0x37, // . 60 | 0x24|SHIFT, // / 61 | 0x27, // 0 62 | 0x1e, // 1 63 | 0x1f, // 2 50 64 | 0x20, // 3 65 | 0x21, // 4 66 | 0x22, // 5 67 | 0x23, // 6 68 | 0x24, // 7 69 | 0x25, // 8 70 | 0x26, // 9 71 | 0x37|SHIFT, // : 72 | 0x36|SHIFT, // ; 73 | 0x64, // < 60 74 | 0x27|SHIFT, // = 75 | 0x64|SHIFT, // > 76 | 0x2d|SHIFT, // ? 77 | 0x14, // @ 78 | 0x04|SHIFT, // A 79 | 0x05|SHIFT, // B 80 | 0x06|SHIFT, // C 81 | 0x07|SHIFT, // D 82 | 0x08|SHIFT, // E 83 | 0x09|SHIFT, // F 70 84 | 0x0a|SHIFT, // G 85 | 0x0b|SHIFT, // H 86 | 0x0c|SHIFT, // I 87 | 0x0d|SHIFT, // J 88 | 0x0e|SHIFT, // K 89 | 0x0f|SHIFT, // L 90 | 0x10|SHIFT, // M 91 | 0x11|SHIFT, // N 92 | 0x12|SHIFT, // O 93 | 0x13|SHIFT, // P 80 94 | 0x14|SHIFT, // Q 95 | 0x15|SHIFT, // R 96 | 0x16|SHIFT, // S 97 | 0x17|SHIFT, // T 98 | 0x18|SHIFT, // U 99 | 0x19|SHIFT, // V 100 | 0x1a|SHIFT, // W 101 | 0x1b|SHIFT, // X 102 | 0x1d|SHIFT, // Y 103 | 0x1c|SHIFT, // Z 90 104 | 0x25, // [ 105 | 0x2d, // bslash 106 | 0x26, // ] 107 | 0x35, // ^ 108 | 0x38|SHIFT, // _ 109 | 0x2e|SHIFT, // ` 110 | 0x04, // a 111 | 0x05, // b 112 | 0x06, // c 113 | 0x07, // d 100 114 | 0x08, // e 115 | 0x09, // f 116 | 0x0a, // g 117 | 0x0b, // h 118 | 0x0c, // i 119 | 0x0d, // j 120 | 0x0e, // k 121 | 0x0f, // l 122 | 0x10, // m 123 | 0x11, // n 110 124 | 0x12, // o 125 | 0x13, // p 126 | 0x14, // q 127 | 0x15, // r 128 | 0x16, // s 129 | 0x17, // t 130 | 0x18, // u 131 | 0x19, // v 132 | 0x1a, // w 133 | 0x1b, // x 120 134 | 0x1d, // y 135 | 0x1c, // z 136 | 0x24, // { 137 | 0x64, // | 138 | 0x27, // } 139 | 0x30, // ~ 140 | 0 // DEL 127 141 | }; 142 | 143 | // Init var 144 | bool _altGrMap[128]; 145 | bool _altFine = false; 146 | 147 | // Individually define all needed char 148 | void initAltGr() { 149 | _altFine = true; 150 | 151 | _altGrMap[126] = true; // ~ 152 | _altGrMap[123] = true; // { 153 | _altGrMap[91] = true; // [ 154 | _altGrMap[93] = true; // ] 155 | _altGrMap[125] = true; // } 156 | _altGrMap[92] = true; // bslash 157 | _altGrMap[124] = true; // | 158 | _altGrMap[64] = true; // | 159 | } 160 | -------------------------------------------------------------------------------- /modules/arduino/locales/dk.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * Due to how the danish keyboard works some characters (~, ^, `) have to be pressed twice, on ubuntu two presses creates one character, on windows one press creates no charater and two presses creates two. 3 | * 4 | * This means that the required test string is "!\"#$%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^^``_abcdefghijklmnopqrstuvwxyz{|}~~ @" 5 | * Note that the two backslashes are just escaping the backslash. Backslashes don't have to be pressed twice on danish keyboards. 6 | */ 7 | 8 | #define SHIFT 0x80 9 | const uint8_t _asciimap[128] = 10 | { 11 | 0x00, // NUL 12 | 0x00, // SOH 13 | 0x00, // STX 14 | 0x00, // ETX 15 | 0x00, // EOT 16 | 0x00, // ENQ 17 | 0x00, // ACK 18 | 0x00, // BEL 19 | 0x2a, // BS Backspace 20 | 0x2b, // TAB Tab 21 | 0x28, // LF Enter 22 | 0x00, // VT 23 | 0x00, // FF 24 | 0x00, // CR 25 | 0x00, // SO 26 | 0x00, // SI 27 | 0x00, // DEL 28 | 0x00, // DC1 29 | 0x00, // DC2 30 | 0x00, // DC3 31 | 0x00, // DC4 32 | 0x00, // NAK 33 | 0x00, // SYN 34 | 0x00, // ETB 35 | 0x00, // CAN 36 | 0x00, // EM 37 | 0x00, // SUB 38 | 0x00, // ESC 39 | 0x00, // FS 40 | 0x00, // GS 41 | 0x00, // RS 42 | 0x00, // US 43 | 44 | 0x2c, // ' ' 45 | 0x1e|SHIFT, // ! 46 | 0x1f|SHIFT, // " 47 | 0x20|SHIFT, // # 48 | 0x21, // $ 49 | 0x22|SHIFT, // % 50 | 0x23|SHIFT, // & 51 | 0x31, // ' 52 | 0x25|SHIFT, // ( 53 | 0x26|SHIFT, // ) 54 | 0x31|SHIFT, // * 55 | 0x2d, // + 56 | 0x36, // , 57 | 0x38, // - 58 | 0x37, // . 59 | 0x24|SHIFT, // / 60 | 0x27, // 0 61 | 0x1e, // 1 62 | 0x1f, // 2 63 | 0x20, // 3 64 | 0x21, // 4 65 | 0x22, // 5 66 | 0x23, // 6 67 | 0x24, // 7 68 | 0x25, // 8 69 | 0x26, // 9 70 | 0x37|SHIFT, // : 71 | 0x36|SHIFT, // ; 72 | 0x64, // < 73 | 0x27|SHIFT, // = 74 | 0x64|SHIFT, // > 75 | 0x2d|SHIFT, // ? 76 | 0x1f, // @ 77 | 0x04|SHIFT, // A 78 | 0x05|SHIFT, // B 79 | 0x06|SHIFT, // C 80 | 0x07|SHIFT, // D 81 | 0x08|SHIFT, // E 82 | 0x09|SHIFT, // F 83 | 0x0a|SHIFT, // G 84 | 0x0b|SHIFT, // H 85 | 0x0c|SHIFT, // I 86 | 0x0d|SHIFT, // J 87 | 0x0e|SHIFT, // K 88 | 0x0f|SHIFT, // L 89 | 0x10|SHIFT, // M 90 | 0x11|SHIFT, // N 91 | 0x12|SHIFT, // O 92 | 0x13|SHIFT, // P 93 | 0x14|SHIFT, // Q 94 | 0x15|SHIFT, // R 95 | 0x16|SHIFT, // S 96 | 0x17|SHIFT, // T 97 | 0x18|SHIFT, // U 98 | 0x19|SHIFT, // V 99 | 0x1a|SHIFT, // W 100 | 0x1b|SHIFT, // X 101 | 0x1c|SHIFT, // Y 102 | 0x1d|SHIFT, // Z 103 | 0x25, // [ 104 | 0x64, // bslash 105 | 0x26, // ] 106 | 0x30|SHIFT, // ^ 107 | 0x38|SHIFT, // _ 108 | 0x2e|SHIFT, // ` 109 | 0x04, // a 110 | 0x05, // b 111 | 0x06, // c 112 | 0x07, // d 113 | 0x08, // e 114 | 0x09, // f 115 | 0x0a, // g 116 | 0x0b, // h 117 | 0x0c, // i 118 | 0x0d, // j 119 | 0x0e, // k 120 | 0x0f, // l 121 | 0x10, // m 122 | 0x11, // n 123 | 0x12, // o 124 | 0x13, // p 125 | 0x14, // q 126 | 0x15, // r 127 | 0x16, // s 128 | 0x17, // t 129 | 0x18, // u 130 | 0x19, // v 131 | 0x1a, // w 132 | 0x1b, // x 133 | 0x1c, // y 134 | 0x1d, // z 135 | 0x24, // { 136 | 0x2e, // | 137 | 0x27, // } 138 | 0x30, // ~ 139 | 0 // DEL 140 | }; 141 | 142 | // Init var 143 | bool _altGrMap[128]; 144 | bool _altFine = false; 145 | 146 | // Individually define all needed char 147 | void initAltGr() { 148 | _altFine = true; 149 | 150 | _altGrMap[36] = true; // $ 151 | _altGrMap[64] = true; // @ 152 | _altGrMap[91] = true; // [ 153 | _altGrMap[92] = true; // bslash 154 | _altGrMap[93] = true; // ] 155 | _altGrMap[123] = true; // { 156 | _altGrMap[124] = true; // | 157 | _altGrMap[125] = true; // } 158 | _altGrMap[126] = true; // ~ 159 | } 160 | -------------------------------------------------------------------------------- /modules/arduino/locales/si.lang: -------------------------------------------------------------------------------- 1 | /* 2 | * Due to how the slovenian keyboard works, some characters (~, ^, `) have to be pressed twice. 3 | * There are two ways to do it. 4 | * Example for ~: 5 | * #1: AltGr + 1 + 1 6 | * #2: AltGr + 1 + SPACE 7 | * 8 | * This means that the required test string can also be done in two ways. 9 | * #1 "!\"#$%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^^``_abcdefghijklmnopqrstuvwxyz{|}~~ @" 10 | * #2 "!\"#$%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ` _abcdefghijklmnopqrstuvwxyz{|}~ @" 11 | * 12 | * Note that the two backslashes are just escaping the backslash. Backslashes don't have to be pressed twice on slovenian keyboards. 13 | */ 14 | 15 | #define SHIFT 0x80 16 | const uint8_t _asciimap[128] = 17 | { 18 | 0x00, // NUL 19 | 0x00, // SOH 20 | 0x00, // STX 21 | 0x00, // ETX 22 | 0x00, // EOT 23 | 0x00, // ENQ 24 | 0x00, // ACK 25 | 0x00, // BEL 26 | 0x2a, // BS Backspace 27 | 0x2b, // TAB Tab 28 | 0x28, // LF Enter 29 | 0x00, // VT 30 | 0x00, // FF 31 | 0x00, // CR 32 | 0x00, // SO 33 | 0x00, // SI 34 | 0x00, // DEL 35 | 0x00, // DC1 36 | 0x00, // DC2 37 | 0x00, // DC3 38 | 0x00, // DC4 39 | 0x00, // NAK 40 | 0x00, // SYN 41 | 0x00, // ETB 42 | 0x00, // CAN 43 | 0x00, // EM 44 | 0x00, // SUB 45 | 0x00, // ESC 46 | 0x00, // FS 47 | 0x00, // GS 48 | 0x00, // RS 49 | 0x00, // US 50 | 51 | 0x2c, // ' ' 52 | 0x1e|SHIFT, // ! 53 | 0x1f|SHIFT, // " 54 | 0x20|SHIFT, // # 55 | 0x21|SHIFT, // $ 56 | 0x22|SHIFT, // % 57 | 0x23|SHIFT, // & 58 | 0x2d, // ' 59 | 0x25|SHIFT, // ( 60 | 0x26|SHIFT, // ) 61 | 0x2e|SHIFT, // * 62 | 0x2e, // + 63 | 0x36, // , 64 | 0x38, // - 65 | 0x37, // . 66 | 0x24|SHIFT, // / 67 | 0x27, // 0 68 | 0x1e, // 1 69 | 0x1f, // 2 70 | 0x20, // 3 71 | 0x21, // 4 72 | 0x22, // 5 73 | 0x23, // 6 74 | 0x24, // 7 75 | 0x25, // 8 76 | 0x26, // 9 77 | 0x37|SHIFT, // : 78 | 0x36|SHIFT, // ; 79 | 0x64, // < 80 | 0x27|SHIFT, // = 81 | 0x64|SHIFT, // > 82 | 0x2d|SHIFT, // ? 83 | 0x19, // @ 84 | 0x04|SHIFT, // A 85 | 0x05|SHIFT, // B 86 | 0x06|SHIFT, // C 87 | 0x07|SHIFT, // D 88 | 0x08|SHIFT, // E 89 | 0x09|SHIFT, // F 90 | 0x0a|SHIFT, // G 91 | 0x0b|SHIFT, // H 92 | 0x0c|SHIFT, // I 93 | 0x0d|SHIFT, // J 94 | 0x0e|SHIFT, // K 95 | 0x0f|SHIFT, // L 96 | 0x10|SHIFT, // M 97 | 0x11|SHIFT, // N 98 | 0x12|SHIFT, // O 99 | 0x13|SHIFT, // P 100 | 0x14|SHIFT, // Q 101 | 0x15|SHIFT, // R 102 | 0x16|SHIFT, // S 103 | 0x17|SHIFT, // T 104 | 0x18|SHIFT, // U 105 | 0x19|SHIFT, // V 106 | 0x1a|SHIFT, // W 107 | 0x1b|SHIFT, // X 108 | 0x1d|SHIFT, // Y 109 | 0x1c|SHIFT, // Z 110 | 0x09, // [ 111 | 0x14, // bslash 112 | 0x0a, // ] 113 | 0x20, // ^ 114 | 0x38|SHIFT, // _ 115 | 0x24, // ` 116 | 0x04, // a 117 | 0x05, // b 118 | 0x06, // c 119 | 0x07, // d 120 | 0x08, // e 121 | 0x09, // f 122 | 0x0a, // g 123 | 0x0b, // h 124 | 0x0c, // i 125 | 0x0d, // j 126 | 0x0e, // k 127 | 0x0f, // l 128 | 0x10, // m 129 | 0x11, // n 130 | 0x12, // o 131 | 0x13, // p 132 | 0x14, // q 133 | 0x15, // r 134 | 0x16, // s 135 | 0x17, // t 136 | 0x18, // u 137 | 0x19, // v 138 | 0x1a, // w 139 | 0x1b, // x 140 | 0x1d, // y 141 | 0x1c, // z 142 | 0x05, // { 143 | 0x1a, // | 144 | 0x11, // } 145 | 0x1e, // ~ 146 | 0 // DEL 147 | }; 148 | bool _altGrMap[128]; 149 | bool _altFine = false; 150 | 151 | void initAltGr() { 152 | _altFine = true; 153 | 154 | _altGrMap[64] = true; // @ 155 | _altGrMap[91] = true; // [ 156 | _altGrMap[92] = true; // bslash 157 | _altGrMap[93] = true; // ] 158 | _altGrMap[94] = true; // ^ 159 | _altGrMap[96] = true; // ` 160 | _altGrMap[123] = true; // { 161 | _altGrMap[124] = true; // | 162 | _altGrMap[125] = true; // } 163 | _altGrMap[126] = true; // ~ 164 | } 165 | -------------------------------------------------------------------------------- /assets/css/style.css: -------------------------------------------------------------------------------- 1 | /* Main css stylesheet */ 2 | 3 | @import 'https://fonts.googleapis.com/css?family=Lato:900,300'; 4 | 5 | html, body { 6 | /* Margin & Padding */ 7 | margin: 0; padding: 0; 8 | 9 | /* Global text params */ 10 | font-family: Lato, sans-serif; 11 | font-size: 16px; 12 | 13 | /* Background */ 14 | background-size: cover; 15 | background-image: url(../imgs/background.jpg); 16 | background-repeat: no-repeat; 17 | background-position: center; 18 | background-attachment: fixed; 19 | 20 | /* Size */ 21 | height: 100%; width: 100%; 22 | } 23 | 24 | /* Text */ 25 | h1 { 26 | margin: 0; 27 | } 28 | h6 { 29 | margin: 0; 30 | opacity: .7; 31 | } 32 | 33 | /* Textareas */ 34 | textarea { 35 | width: 100%; height: 50vh; 36 | border: none; border-radius: 4px; 37 | padding: 8px; 38 | 39 | word-wrap: break-word; 40 | word-break: break-all; 41 | box-sizing: border-box; 42 | resize: none; 43 | } 44 | 45 | /* Buttons */ 46 | button { 47 | /* Style */ 48 | color: black; 49 | cursor: pointer; 50 | background-color: white; 51 | border: 1px solid white; 52 | 53 | /* Size */ 54 | width: 128px; 55 | height: 32px; 56 | 57 | /* Animation */ 58 | transition: .2s; 59 | } 60 | button:not(:disabled):hover { 61 | /* Style */ 62 | background-color: transparent; 63 | color: white; 64 | 65 | /* Animation */ 66 | transition: .2s; 67 | } 68 | button:disabled { 69 | /* Style */ 70 | color: white; 71 | background-color: transparent; 72 | 73 | /* Back pattern */ 74 | background-size: 32px 32px; 75 | background-image: linear-gradient(135deg, rgba(255, 255, 255, 1) 25%, transparent 25%, 76 | transparent 50%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 1) 75%, 77 | transparent 75%, transparent); 78 | 79 | cursor: default; 80 | 81 | /* Opacity */ 82 | opacity: .5; 83 | } 84 | 85 | /* Top bar */ 86 | .menu { 87 | position: absolute; 88 | top: 0; 89 | 90 | width: 100%; 91 | } 92 | .menu a { 93 | float: right; 94 | margin: 16px; 95 | 96 | text-transform: uppercase; 97 | text-decoration: none; 98 | color: white; 99 | 100 | transition: .2s; 101 | } 102 | .menu a:hover { 103 | transition: .2s; 104 | color: black; 105 | } 106 | 107 | /* Page organization */ 108 | .group { 109 | /* Size */ 110 | width: 100%; height: 100%; 111 | 112 | /* Center parts */ 113 | display: flex; 114 | flex-wrap: wrap; 115 | } 116 | 117 | .part { 118 | /* Position */ 119 | margin: 0 1.5%; padding: 16px; 120 | align-self: center; 121 | width: 30%; 122 | float: left; 123 | 124 | box-sizing: border-box; 125 | border-radius: 4px; 126 | 127 | /* Separation */ 128 | /*box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);*/ 129 | 130 | /* Text */ 131 | color: white; 132 | } 133 | 134 | @media (max-width: 860px) { 135 | .part { 136 | width: 100%; 137 | } 138 | 139 | .input { 140 | margin-top: 28px; 141 | } 142 | } 143 | 144 | /* Elements */ 145 | .process { 146 | /* Center text */ 147 | text-align: center; 148 | } 149 | 150 | /* Info/error tooltip */ 151 | .tooltip { 152 | position: relative; 153 | width: 100%; 154 | 155 | display: none; 156 | z-index: 2; 157 | } 158 | .tooltip > span { 159 | /* Size */ 160 | position: absolute; 161 | width: 90%; 162 | 163 | /* Position */ 164 | left: 50%; 165 | transform: translateX(-50%); 166 | margin-top: 12px; 167 | z-index: -1; 168 | 169 | /* Style */ 170 | text-align: left; 171 | border-radius: 4px; 172 | white-space: pre-wrap; 173 | padding: 4px; 174 | color: white; 175 | } 176 | .tooltip > span::before { 177 | content: ""; 178 | position: absolute; 179 | bottom: 100%; 180 | left: 50%; 181 | margin-left: -8px; 182 | border-width: 8px; 183 | border-style: solid; 184 | } 185 | .tooltip.info > span {background-color: #029bc9;} 186 | .tooltip.info > span::before {border-color: transparent transparent #029bc9 transparent;} 187 | 188 | .tooltip.error > span {background-color: #cc0000;} 189 | .tooltip.error > span::before {border-color: transparent transparent #cc0000 transparent;} 190 | 191 | .combined-but > button { 192 | width: 112px; 193 | border-right: 0; 194 | } 195 | .combined-but > select { 196 | /* Postion */ 197 | position: absolute; 198 | 199 | /* Style */ 200 | color: transparent; 201 | border: 1px solid white; 202 | 203 | -webkit-appearance: none; 204 | -moz-appearance: none; 205 | appearance: none; 206 | 207 | background: url(../imgs/arrow-down.png) no-repeat white center; 208 | 209 | /* Size */ 210 | width: 16px; 211 | height: 32px; 212 | } 213 | .combined-but > select option { 214 | /* Style */ 215 | color: black; 216 | } 217 | .combined-but > select:disabled { 218 | /* Postion */ 219 | opacity: .5; 220 | } 221 | -------------------------------------------------------------------------------- /assets/js/main.js: -------------------------------------------------------------------------------- 1 | $(function() { /* Wait for jQuery */ 2 | 3 | 4 | /* Textarea */ 5 | $(".input > #input").linenumbers(); 6 | 7 | /* Init lets */ 8 | let isCodeCompiled = false; 9 | let Duck = new Duckuino(); 10 | let mods = new Modules().list; 11 | 12 | try { 13 | let isFileSaverSupported = !!new Blob(); 14 | } catch (e) {} 15 | 16 | /* Compile button enable/disable */ 17 | $(".input > #input").keyup(function() { 18 | // Disable export when input is changed 19 | $(".copy-but").prop("disabled", true); 20 | $(".export .copy-but").text("Copy !"); 21 | $(".dl-but button").prop("disabled", true); 22 | $(".dl-but select").prop("disabled", true); 23 | 24 | if($(this).val() !== "") { 25 | $(".process-but button").prop("disabled", false); 26 | $(".process-but select").prop("disabled", false); 27 | } else { 28 | $(".process-but button").prop("disabled", true); 29 | $(".process-but select").prop("disabled", true); 30 | } 31 | }); 32 | 33 | /* Reset buttons */ 34 | $(".copy-but").prop("disabled", true); 35 | $(".export .copy-but").text("Copy !"); 36 | $(".dl-but button").prop("disabled", true); 37 | $(".dl-but select").prop("disabled", true); 38 | 39 | /* Compile button click */ 40 | $(".process-but button").click(function() { 41 | let duckyScript = $(".input > #input").val(); 42 | let selectedModule = mods[$(".process-but select").find(":selected").val()]; 43 | 44 | /* Load Duckuino & Compile */ 45 | let compilerOut = Duck.compileCode(duckyScript, selectedModule.module); 46 | 47 | /* Check for error */ 48 | if(compilerOut.returnCode === 0) { 49 | /* Set textarea text */ 50 | $(".export > textarea").val(compilerOut.compiledCode); 51 | 52 | /* Enable buttons */ 53 | $(".copy-but").prop("disabled", false); 54 | $(".export .copy-but").text("Copy !"); 55 | 56 | /* Reset & (Re)Populate locales */ 57 | $(".dl-but select").empty(); 58 | $(".dl-but button").prop("disabled", true); 59 | $(".dl-but select").prop("disabled", true); 60 | for (let y in selectedModule.meta.locales) { 61 | let l = selectedModule.meta.locales[y]; 62 | if (y == "_meta") 63 | continue; 64 | $(".dl-but select").append(""); 65 | /* Enable button only if there is one locale */ 66 | $(".dl-but button").prop("disabled", false); 67 | $(".dl-but select").prop("disabled", false); 68 | } 69 | 70 | /* Show compilation infos */ 71 | $(".process .tooltip > span").text(compilerOut.returnMessage); 72 | $(".process .tooltip").removeClass("error"); $(".process .tooltip").addClass("info"); 73 | $(".process .tooltip").show(); 74 | } else { 75 | /* Disable buttons and show compilation error */ 76 | $(".dl-but button").prop("disabled", true); 77 | $(".dl-but select").prop("disabled", true); 78 | $(".copy-but").prop("disabled", true); 79 | 80 | /* Compilation error */ 81 | $(".process .tooltip > span").text(compilerOut.returnMessage); 82 | $(".process .tooltip").removeClass("info"); $(".process .tooltip").addClass("error"); 83 | $(".process .tooltip").show(); 84 | } 85 | }); 86 | 87 | /* List modules */ 88 | for (let x in mods) { 89 | let m = mods[x]; 90 | $(".process-but select") 91 | .append(""); 92 | } 93 | 94 | /* Download button */ 95 | $(".dl-but button").click(function() { 96 | let compilerOut = $(".export > textarea").val(); 97 | 98 | let sketchName = "Sketch"; 99 | let zipHandler = new JSZip(); 100 | 101 | // Add the payload as .ino 102 | zipHandler.file(sketchName + "/" + sketchName + ".ino", compilerOut); 103 | 104 | // Add readme 105 | zipHandler.file("readme", $.ajax({ 106 | url: 'readme.default', 107 | mimeType: 'text/plain', 108 | type: 'get', 109 | success: function(data) {return data;} 110 | })); 111 | 112 | // Craft the lib 113 | let lib = ""; 114 | let selectedModule = mods[$(".process-but select").find(":selected").val()]; 115 | let selectedLocale = selectedModule.meta.locales[$(".dl-but select").find(":selected").val()]; 116 | for (let x in selectedModule.meta.locales._meta.parts) { 117 | let p = selectedModule.meta.locales._meta.parts[x]; 118 | if (p == '_locale_') 119 | lib += selectedLocale.data; 120 | else 121 | lib += p; 122 | } 123 | 124 | // Append all to the zip 125 | zipHandler.file( 126 | sketchName + "/" + selectedModule.meta.locales._meta.name + ".cpp", lib); 127 | zipHandler.file( 128 | sketchName + "/" + selectedModule.meta.locales._meta.name + ".h", 129 | selectedModule.meta.locales._meta.header); 130 | 131 | // Download 132 | zipHandler.generateAsync({type:"blob"}) 133 | .then(function(content) { 134 | saveAs(content, sketchName + ".zip"); 135 | } 136 | ); 137 | }); 138 | 139 | /* Copy to clipboard button */ 140 | $(".copy-but").click(function() { 141 | let copyTextarea = $(".export > textarea"); 142 | copyTextarea.select(); 143 | 144 | try { 145 | document.execCommand('copy'); 146 | 147 | $(".copy-but").text("Copied !"); 148 | $(".copy-but").prop("disabled", true); 149 | } catch (e) {/* Error */} 150 | }); 151 | }); 152 | -------------------------------------------------------------------------------- /modules/arduino/module.js: -------------------------------------------------------------------------------- 1 | /* jshint laxbreak: true */ 2 | 3 | new Object({ 4 | functionMap: { /* Functions */ 5 | REM: function(argList, µ) { 6 | argList.shift(); 7 | 8 | µ.setData('nodelay', true); 9 | return ' // ' + argList.join(' ') + '\n'; 10 | }, 11 | 12 | TYPE: function(argList, µ) { 13 | argList.shift(); 14 | 15 | if(argList.length < 1) { 16 | µ.throwError("No argument provided for TYPE"); 17 | return; 18 | } 19 | 20 | if(µ.keyMap[argList[0]] !== undefined) { 21 | return ' typeKey(\'' + µ.keyMap[argList[0]] + '\');\n\n'; 22 | } else { 23 | µ.throwError("Unknown command or key: '" + argList[0] + "'"); 24 | return; 25 | } 26 | }, 27 | 28 | STRING: function(argList, µ) { 29 | argList.shift(); 30 | 31 | if(argList.length < 1) { 32 | µ.throwError("No argument provided for STRING"); 33 | return; 34 | } 35 | 36 | var textString = argList.join(' '); 37 | 38 | // Replace all '"' by '\"' and all '\' by '\\' 39 | textString = textString.split('\\').join('\\\\').split('"').join('\\"'); 40 | 41 | if(textString !== '') { 42 | return ' Keyboard.print(F("' + textString + '"));\n\n'; 43 | } 44 | }, 45 | 46 | DELAY: function(argList, µ) { 47 | argList.shift(); 48 | 49 | if(argList.length < 1) { 50 | µ.throwError("No argument provided for DELAY"); 51 | return; 52 | } 53 | 54 | if(!isNaN(argList[0])) { 55 | µ.setData('nodelay', true); 56 | 57 | return ' delay(' + argList[0] + ');\n'; 58 | } else { 59 | µ.throwError("Invalid argument, DELAY only acceptes numbers"); 60 | return; 61 | } 62 | }, 63 | 64 | DEFAULTDELAY: function(argList, µ) { // Not working .-. 65 | argList.shift(); 66 | 67 | if(argList.length < 1) { 68 | µ.throwError("No argument provided for DEFAULTDELAY"); 69 | return; 70 | } 71 | 72 | if(!isNaN(argList[0])) { 73 | µ.setData('defaultdelay', argList[0]); 74 | µ.setData('nodelay', true); 75 | 76 | return ''; 77 | } else { 78 | µ.throwError("Invalid argument, DEFAULTDELAY only acceptes numbers"); 79 | return; 80 | } 81 | }, 82 | DEFAULT_DELAY: function() {return this.DEFAULTDELAY.apply(this, [].slice.call(arguments));}, 83 | 84 | REPEAT: function(argList, µ) { 85 | argList.shift(); 86 | 87 | if(argList.length < 1) { 88 | µ.throwError("No argument provided for REPLAY"); 89 | return; 90 | } 91 | 92 | var lastOutput = µ.trimLast(); 93 | if(lastOutput === '') { 94 | throwError("Nothing to REPLAY, this is the first line"); 95 | return; 96 | } 97 | 98 | lastOutput = ' ' + lastOutput.trim() + '\n'; 99 | lastOutput = lastOutput.replace(/^ /gm,' '); 100 | 101 | if(!isNaN(argList[0])) { 102 | µ.setData('nodelay', true); 103 | 104 | return ' for(int i = 0; i < ' + argList[0] + '; i++) {\n' + lastOutput + ' }\n\n'; 105 | } else { 106 | µ.throwError("Invalid argument, REPLAY only acceptes numbers"); 107 | return; 108 | } 109 | }, 110 | REPLAY: function() {return this.REPEAT.apply(this, [].slice.call(arguments));} 111 | }, 112 | 113 | commandMap: { /* Key that can be typed */ 114 | ESCAPE:'KEY_ESC', 115 | ESC:'KEY_ESC', 116 | GUI:'KEY_LEFT_GUI', 117 | WINDOWS:'KEY_LEFT_GUI', 118 | COMMAND:'KEY_LEFT_GUI', 119 | MENU:'229', 120 | APP:'229', 121 | END:'KEY_END', 122 | SPACE:'\' \'', 123 | TAB:'KEY_TAB', 124 | PRINTSCREEN:'206', 125 | ENTER:'KEY_RETURN', 126 | RETURN:'KEY_RETURN', 127 | UPARROW:'KEY_UP_ARROW', 128 | DOWNARROW:'KEY_DOWN_ARROW', 129 | LEFTARROW:'KEY_LEFT_ARROW', 130 | RIGHTARROW:'KEY_RIGHT_ARROW', 131 | UP:'KEY_UP_ARROW', 132 | DOWN:'KEY_DOWN_ARROW', 133 | LEFT:'KEY_LEFT_ARROW', 134 | RIGHT:'KEY_RIGHT_ARROW', 135 | CAPSLOCK:'KEY_CAPS_LOCK', 136 | DELETE:'KEY_DELETE', 137 | DEL:'KEY_DELETE', 138 | F1:'KEY_F1', 139 | F2:'KEY_F2', 140 | F3:'KEY_F3', 141 | F4:'KEY_F4', 142 | F5:'KEY_F5', 143 | F6:'KEY_F6', 144 | F7:'KEY_F7', 145 | F8:'KEY_F8', 146 | F9:'KEY_F9', 147 | F10:'KEY_F10', 148 | F11:'KEY_F11', 149 | F12:'KEY_F12', 150 | PAGEUP:'KEY_PAGE_UP', 151 | PAGEDOWN:'KEY_PAGE_DOWN' 152 | }, 153 | 154 | comboMap: { /* Key that can only be used in combos */ 155 | ALT:'KEY_LEFT_ALT', 156 | SHIFT:'KEY_LEFT_SHIFT', 157 | CTRL:'KEY_LEFT_CTRL', 158 | CONTROL:'KEY_LEFT_CTRL' 159 | }, 160 | 161 | keyMap: { /* Normal keys */ 162 | a:'\'a\'', 163 | b:'\'b\'', 164 | c:'\'c\'', 165 | d:'\'d\'', 166 | e:'\'e\'', 167 | f:'\'f\'', 168 | g:'\'g\'', 169 | h:'\'h\'', 170 | i:'\'i\'', 171 | j:'\'j\'', 172 | k:'\'k\'', 173 | l:'\'l\'', 174 | m:'\'m\'', 175 | n:'\'n\'', 176 | o:'\'o\'', 177 | p:'\'p\'', 178 | q:'\'q\'', 179 | r:'\'r\'', 180 | s:'\'s\'', 181 | t:'\'t\'', 182 | u:'\'u\'', 183 | v:'\'v\'', 184 | w:'\'w\'', 185 | x:'\'x\'', 186 | y:'\'y\'', 187 | z:'\'z\'' 188 | }, 189 | 190 | postLine: function(lineStr, µ) { 191 | var processedLine = lineStr; 192 | 193 | /* If the defaultdelay has been set, push delay to the line start */ 194 | if(µ.getData('defaultdelay') !== undefined && µ.getData('nodelay') == false) 195 | processedLine = ' delay(' + µ.getData('defaultdelay') + ');\n' + processedLine; 196 | 197 | /* Reset the nodelay statement */ 198 | µ.setData('nodelay', false); 199 | 200 | return processedLine; 201 | }, 202 | 203 | computeKeys: function(keyArray) { /* Function who returns the code for keys combos */ 204 | var toReturn = ''; 205 | if(keyArray.length == 1) { 206 | toReturn = ' typeKey(' + keyArray[0] + ');\n\n'; 207 | } else { 208 | for(var i = 0; i < keyArray.length; i++) { 209 | toReturn += ' Keyboard.press(' + keyArray[i] + ');\n'; 210 | } 211 | 212 | toReturn += ' Keyboard.releaseAll();\n\n'; 213 | } 214 | 215 | return toReturn; 216 | }, 217 | 218 | getFinalCode: function(code) { /* Function who returns the usable code */ 219 | return '/**\n' 220 | + ' * Made with Duckuino, an open-source project.\n' 221 | + ' * Check the license at \'https://github.com/Dukweeno/Duckuino/blob/master/LICENSE\'\n' 222 | + ' */\n\n' 223 | + '#include "Keyboard.h"\n\n' 224 | + 'void typeKey(uint8_t key)\n' 225 | + '{\n' 226 | + ' Keyboard.press(key);\n' 227 | + ' delay(50);\n' 228 | + ' Keyboard.release(key);\n' 229 | + '}\n\n' 230 | + '/* Init function */\n' 231 | + 'void setup()\n' 232 | + '{\n' 233 | + ' // Begining the Keyboard stream\n' 234 | + ' Keyboard.begin();\n\n' 235 | + ' // Wait 500ms\n' 236 | + ' delay(500);\n' 237 | + '\n' 238 | + code 239 | + ' // Ending stream\n' 240 | + ' Keyboard.end();\n' 241 | + '}\n\n' 242 | + '/* Unused endless loop */\n' 243 | + 'void loop() {}'; 244 | } 245 | }); 246 | -------------------------------------------------------------------------------- /modules/mukeyboard/module.js: -------------------------------------------------------------------------------- 1 | /* jshint laxbreak: true */ 2 | 3 | new Object({ 4 | functionMap: { /* Functions */ 5 | REM: function(argList, µ) { 6 | argList.shift(); 7 | 8 | µ.setData('nodelay', true); 9 | return ' // ' + argList.join(' ') + '\n'; 10 | }, 11 | 12 | TYPE: function(argList, µ) { 13 | argList.shift(); 14 | 15 | if(argList.length < 1) { 16 | µ.throwError("No argument provided for TYPE"); 17 | return; 18 | } 19 | 20 | if(µ.keyMap[argList[0]] !== undefined) { 21 | return ' typeKey(\'' + µ.keyMap[argList[0]] + '\');\n\n'; 22 | } else { 23 | µ.throwError("Unknown command or key: '" + argList[0] + "'"); 24 | return; 25 | } 26 | }, 27 | 28 | STRING: function(argList, µ) { 29 | argList.shift(); 30 | 31 | if(argList.length < 1) { 32 | µ.throwError("No argument provided for STRING"); 33 | return; 34 | } 35 | 36 | var textString = argList.join(' '); 37 | 38 | // Replace all '"' by '\"' and all '\' by '\\' 39 | textString = textString.split('\\').join('\\\\').split('"').join('\\"'); 40 | 41 | if(textString !== '') { 42 | return ' Keyboard.print(F("' + textString + '"));\n\n'; 43 | } 44 | }, 45 | 46 | DELAY: function(argList, µ) { 47 | argList.shift(); 48 | 49 | if(argList.length < 1) { 50 | µ.throwError("No argument provided for DELAY"); 51 | return; 52 | } 53 | 54 | if(!isNaN(argList[0])) { 55 | µ.setData('nodelay', true); 56 | 57 | return ' wait(' + argList[0] + ');\n'; 58 | } else { 59 | µ.throwError("Invalid argument, DELAY only acceptes numbers"); 60 | return; 61 | } 62 | }, 63 | 64 | DEFAULTDELAY: function(argList, µ) { // Not working .-. 65 | argList.shift(); 66 | 67 | if(argList.length < 1) { 68 | µ.throwError("No argument provided for DEFAULTDELAY"); 69 | return; 70 | } 71 | 72 | if(!isNaN(argList[0])) { 73 | µ.setData('defaultdelay', argList[0]); 74 | µ.setData('nodelay', true); 75 | 76 | return ''; 77 | } else { 78 | µ.throwError("Invalid argument, DEFAULTDELAY only acceptes numbers"); 79 | return; 80 | } 81 | }, 82 | DEFAULT_DELAY: function() {return this.DEFAULTDELAY.apply(this, [].slice.call(arguments));}, 83 | 84 | REPEAT: function(argList, µ) { 85 | argList.shift(); 86 | 87 | if(argList.length < 1) { 88 | µ.throwError("No argument provided for REPLAY"); 89 | return; 90 | } 91 | 92 | var lastOutput = µ.trimLast(); 93 | if(lastOutput === '') { 94 | throwError("Nothing to REPLAY, this is the first line"); 95 | return; 96 | } 97 | 98 | lastOutput = ' ' + lastOutput.trim() + '\n'; 99 | lastOutput = lastOutput.replace(/^ /gm,' '); 100 | 101 | if(!isNaN(argList[0])) { 102 | µ.setData('nodelay', true); 103 | 104 | return ' for(int i = 0; i < ' + argList[0] + '; i++) {\n' + lastOutput + ' }\n\n'; 105 | } else { 106 | µ.throwError("Invalid argument, REPLAY only acceptes numbers"); 107 | return; 108 | } 109 | }, 110 | REPLAY: function() {return this.REPEAT.apply(this, [].slice.call(arguments));} 111 | }, 112 | 113 | commandMap: { /* Key that can be typed */ 114 | ESCAPE:'KEY_ESC', 115 | ESC:'KEY_ESC', 116 | GUI:'KEY_LEFT_GUI', 117 | WINDOWS:'KEY_LEFT_GUI', 118 | COMMAND:'KEY_LEFT_GUI', 119 | MENU:'229', 120 | APP:'229', 121 | END:'KEY_END', 122 | SPACE:'\' \'', 123 | TAB:'KEY_TAB', 124 | PRINTSCREEN:'206', 125 | ENTER:'KEY_RETURN', 126 | RETURN:'KEY_RETURN', 127 | UPARROW:'KEY_UP_ARROW', 128 | DOWNARROW:'KEY_DOWN_ARROW', 129 | LEFTARROW:'KEY_LEFT_ARROW', 130 | RIGHTARROW:'KEY_RIGHT_ARROW', 131 | UP:'KEY_UP_ARROW', 132 | DOWN:'KEY_DOWN_ARROW', 133 | LEFT:'KEY_LEFT_ARROW', 134 | RIGHT:'KEY_RIGHT_ARROW', 135 | CAPSLOCK:'KEY_CAPS_LOCK', 136 | DELETE:'KEY_DELETE', 137 | DEL:'KEY_DELETE', 138 | F1:'KEY_F1', 139 | F2:'KEY_F2', 140 | F3:'KEY_F3', 141 | F4:'KEY_F4', 142 | F5:'KEY_F5', 143 | F6:'KEY_F6', 144 | F7:'KEY_F7', 145 | F8:'KEY_F8', 146 | F9:'KEY_F9', 147 | F10:'KEY_F10', 148 | F11:'KEY_F11', 149 | F12:'KEY_F12', 150 | PAGEUP:'KEY_PAGE_UP', 151 | PAGEDOWN:'KEY_PAGE_DOWN' 152 | }, 153 | 154 | comboMap: { /* Key that can only be used in combos */ 155 | ALT:'KEY_LEFT_ALT', 156 | SHIFT:'KEY_LEFT_SHIFT', 157 | CTRL:'KEY_LEFT_CTRL', 158 | CONTROL:'KEY_LEFT_CTRL' 159 | }, 160 | 161 | keyMap: { /* Normal keys */ 162 | a:'\'a\'', 163 | b:'\'b\'', 164 | c:'\'c\'', 165 | d:'\'d\'', 166 | e:'\'e\'', 167 | f:'\'f\'', 168 | g:'\'g\'', 169 | h:'\'h\'', 170 | i:'\'i\'', 171 | j:'\'j\'', 172 | k:'\'k\'', 173 | l:'\'l\'', 174 | m:'\'m\'', 175 | n:'\'n\'', 176 | o:'\'o\'', 177 | p:'\'p\'', 178 | q:'\'q\'', 179 | r:'\'r\'', 180 | s:'\'s\'', 181 | t:'\'t\'', 182 | u:'\'u\'', 183 | v:'\'v\'', 184 | w:'\'w\'', 185 | x:'\'x\'', 186 | y:'\'y\'', 187 | z:'\'z\'' 188 | }, 189 | 190 | postLine: function(lineStr, µ) { 191 | var processedLine = lineStr; 192 | 193 | /* If the defaultdelay has been set, push delay to the line start */ 194 | if(µ.getData('defaultdelay') !== undefined && µ.getData('nodelay') == false) 195 | processedLine = ' wait(' + µ.getData('defaultdelay') + ');\n' + processedLine; 196 | 197 | /* Reset the nodelay statement */ 198 | µ.setData('nodelay', false); 199 | 200 | return processedLine; 201 | }, 202 | 203 | computeKeys: function(keyArray) { /* Function who returns the code for keys combos */ 204 | var toReturn = ''; 205 | if(keyArray.length == 1) { 206 | toReturn = ' typeKey(' + keyArray[0] + ');\n\n'; 207 | } else { 208 | for(var i = 0; i < keyArray.length; i++) { 209 | toReturn += ' Keyboard.press(' + keyArray[i] + ');\n'; 210 | } 211 | 212 | toReturn += ' Keyboard.releaseAll();\n\n'; 213 | } 214 | 215 | return toReturn; 216 | }, 217 | 218 | getFinalCode: function(compiledCode) { /* Function who returns the usable code */ 219 | return '/**\n' 220 | + ' * Made for Duckuino with MuKeyboard.\n' 221 | + ' * Check the Duckuino\'s license at \'https://github.com/Nurrl/Duckuino/blob/master/LICENSE\'\n' 222 | + ' * Check the MuKeyboard project at \'https://github.com/MrMoDDoM/MuKeyboard\'\n' 223 | + ' */\n\n' 224 | + '#include "MuKeyboard.h"\n\n' 225 | + 'void typeKey(uint8_t key)\n' 226 | + '{\n' 227 | + ' Keyboard.press(key);\n' 228 | + ' wait(50);\n' 229 | + ' Keyboard.release(key);\n' 230 | + '}\n\n' 231 | + '/* Init function */\n' 232 | + 'void setup()\n' 233 | + '{\n' 234 | + ' // Begining the Keyboard stream\n' 235 | + ' Keyboard.begin();\n\n' 236 | + ' // Wait 500ms\n' 237 | + ' wait(500);\n' 238 | + '\n' 239 | + compiledCode 240 | + ' // Ending stream\n' 241 | + ' Keyboard.end();\n' 242 | + '}\n\n' 243 | + '/* Unused endless loop */\n' 244 | + 'void loop() {}'; 245 | } 246 | }); 247 | -------------------------------------------------------------------------------- /Duckuino.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Duckuino, an open source project licenced under MIT License 3 | * GitHub repo can be found at the following link: 4 | * - https://github.com/Nurrl/Duckuino 5 | */ 6 | 7 | /* jshint esversion: 6 */ 8 | 9 | /* Function to request files */ 10 | function getFile(sUrl) { 11 | /* Init request */ 12 | let oReq = new XMLHttpRequest(); 13 | //console.log("@<- " + sUrl); 14 | 15 | /* Sending request */ 16 | oReq.open("get", sUrl, false); 17 | oReq.overrideMimeType("text/plain"); 18 | oReq.send(null); 19 | 20 | /* Getting response */ 21 | if (oReq.readyState == 4 && (oReq.status == 200 || oReq.status === 0)) { 22 | return oReq.responseText; 23 | } else { 24 | return undefined; 25 | } 26 | } 27 | 28 | class Modules { 29 | constructor() { 30 | /* Load modules *//* jshint evil:true */ 31 | let modules = JSON.parse(getFile("modules/modules.json")); 32 | for (let x in modules) { 33 | let m = modules[x]; 34 | m.meta = JSON.parse(getFile("modules/" + m.path + m.meta)); 35 | m.module = eval(getFile("modules/" + m.path + m.module)); 36 | if (Object.keys(m.meta.locales).length > 0) { 37 | let ls = m.meta.locales; 38 | for (let y in ls) { 39 | let l = ls[y]; 40 | if (y == "_meta") 41 | continue; 42 | l.data = getFile("modules/" + m.path + l.path); 43 | } 44 | ls._meta.header = getFile("modules/" + m.path + ls._meta.header); 45 | for (let y in ls._meta.parts) { 46 | let f = ls._meta.parts[y]; 47 | if (f == "_locale_") 48 | continue; 49 | ls._meta.parts[y] = getFile("modules/" + m.path + f); 50 | } 51 | } 52 | } 53 | this.list = modules; 54 | } 55 | } 56 | 57 | class Duckuino { 58 | constructor() {} 59 | 60 | compileCode(compileStr, withModule) { 61 | /* Init timer */ 62 | let timerStart = window.performance.now(); 63 | 64 | /* Check if module loaded */ 65 | if (withModule === undefined) { 66 | return { 67 | compiledCode: undefined, 68 | compileTime: -1, 69 | 70 | returnCode: 9, 71 | returnMessage: "Error: No module loaded !", 72 | errorList: this.errorList 73 | }; 74 | } 75 | 76 | /* Check if code is empty */ 77 | if (compileStr === undefined || compileStr === "") { 78 | return { 79 | compiledCode: undefined, 80 | compileTime: -1, 81 | 82 | returnCode: 9, 83 | returnMessage: "Error: No input was entered !", 84 | errorList: this.errorList 85 | }; 86 | } 87 | 88 | /* Trim whitespaces and tabs */ 89 | compileStr = compileStr.replace(/^ +| +$/gm, ''); 90 | compileStr = compileStr.replace(/\t/g, ''); 91 | 92 | /* Errors */ 93 | this.errorList = []; 94 | 95 | /* Preset all used vars */ 96 | this.dataStorage = new Object(); 97 | this.compiledCode = ''; 98 | 99 | let commandKnown; 100 | let lineStr; 101 | let lastLine = ''; let lastLineCount = 0; 102 | 103 | /* Cut the input in lines */ 104 | let lineArray = compileStr.split('\n'); 105 | 106 | /* Loop every line */ 107 | for (let i = 0; i < lineArray.length; i++) 108 | { 109 | /* Line empty, skip */ 110 | if (lineArray[i] === '' || lineArray[i] === '\n') 111 | continue; 112 | 113 | /* Reset lets */ 114 | commandKnown = false; 115 | lineStr = ''; 116 | 117 | /* Split lines in words */ 118 | let argList = lineArray[i].split(' '); 119 | let argOne = argList[0]; 120 | 121 | /* Parse commands */ 122 | if (withModule.functionMap[argOne] !== undefined) { 123 | let µ = new Object({ 124 | keyMap: withModule.keyMap, 125 | /** 126 | * Pushes the error to the global error list. 127 | */ 128 | throwError: function(thisPtr, currentLine) { 129 | return function(errorMessage) { 130 | thisPtr.errorList.push({ 131 | errorMessage: errorMessage, 132 | errorLine: currentLine 133 | }); 134 | }; 135 | }(this, (i + 1)), 136 | /** 137 | * This one is to get the lastLine, and in the same way trim 138 | * it from from the current compiledCode, this is a workaround for 139 | * the REPLAY command. 140 | */ 141 | trimLast: function(thisPtr, lastLine, lastLineCount) { 142 | return function() { 143 | let tmplet = thisPtr.compiledCode.split('\n'); 144 | 145 | tmplet.splice(-lastLineCount, lastLineCount - 1); 146 | thisPtr.compiledCode = tmplet.join('\n'); 147 | 148 | return lastLine; 149 | }; 150 | }(this, lastLine, lastLineCount), 151 | /** 152 | * Those two function are used to store persistent data, i.e: 153 | * Default Delay. 154 | */ 155 | setData: function(thisPtr) { 156 | return function(dataName, dataValue) { 157 | thisPtr.dataStorage[dataName] = dataValue; 158 | }; 159 | }(this), 160 | getData: function(thisPtr) { 161 | return function(dataName) { 162 | return thisPtr.dataStorage[dataName]; 163 | }; 164 | }(this), 165 | }); 166 | 167 | /* Execute the function and add the returned string to the current string */ 168 | lineStr += withModule.functionMap[argOne](argList, µ); 169 | 170 | /* Post process the line */ 171 | lineStr = withModule.postLine(lineStr, µ); 172 | } else { /* Parse keystokes */ 173 | let strokeArray = Array(); 174 | 175 | for(let y = 0; y < argList.length; y++) { 176 | 177 | if(withModule.commandMap[argList[y]] !== undefined) { 178 | /* Push key to Array */ 179 | strokeArray.push(withModule.commandMap[argList[y]]); 180 | } else if(withModule.comboMap[argList[y]] !== undefined) { 181 | /* Push key to Array */ 182 | strokeArray.push(withModule.comboMap[argList[y]]); 183 | } else if(withModule.keyMap[argList[y]] !== undefined && y != 0) { 184 | /* Push key to Array */ 185 | strokeArray.push(withModule.keyMap[argList[y]]); 186 | } else { 187 | /* If command unknown, throw error */ 188 | this.errorList.push({ 189 | errorMessage: "Unknown command or key: '" + argList[y] + "'", 190 | errorLine: (i + 1) 191 | }); 192 | } 193 | } 194 | 195 | /* Transform key array to string */ 196 | lineStr += withModule.computeKeys(strokeArray); 197 | } 198 | 199 | /* Calculate line count */ 200 | lastLineCount = lineStr.split('\n').length; 201 | 202 | /* Append this compiled line to global output */ 203 | lastLine = lineStr; 204 | this.compiledCode += lineStr; 205 | } 206 | 207 | /* Stop timer */ 208 | let timerEnd = window.performance.now(); 209 | let timeElapsed = (timerEnd - timerStart).toFixed(2); 210 | 211 | /* Return error if error and code if not */ 212 | if (this.errorList.length > 0) { 213 | /* Return error(s) */ 214 | return { 215 | compiledCode: undefined, 216 | compileTime: -1, 217 | 218 | returnCode: 1, 219 | returnMessage: function(errorList) { 220 | let errorString; 221 | 222 | if(errorList.length > 1) { 223 | errorString = "The compiler returned some errors:\n"; 224 | } else { 225 | errorString = "The compiler returned an error:\n"; 226 | } 227 | 228 | errorList.forEach(function(errorObj) { 229 | errorString += "Line " + errorObj.errorLine + " -> " + errorObj.errorMessage + "\n"; 230 | }); 231 | 232 | return errorString; 233 | }(this.errorList), 234 | errorList: this.errorList 235 | }; 236 | } else { 237 | /* Return the compiled code */ 238 | return { 239 | compiledCode: withModule.getFinalCode(this.compiledCode), 240 | compileTime: timeElapsed, 241 | 242 | returnCode: 0, 243 | returnMessage: "Info: Code successfully parsed in " + timeElapsed + "ms !" 244 | }; 245 | } 246 | } 247 | } 248 | -------------------------------------------------------------------------------- /modules/digispark/module.js: -------------------------------------------------------------------------------- 1 | /* jshint laxbreak: true */ 2 | 3 | new Object({ 4 | functionMap: { /* Functions */ 5 | REM: function(argList, µ) { 6 | argList.shift(); 7 | 8 | µ.setData('nodelay', true); 9 | return ' // ' + argList.join(' ') + '\n'; 10 | }, 11 | 12 | TYPE: function(argList, µ) { 13 | argList.shift(); 14 | 15 | if(argList.length < 1) { 16 | µ.throwError("No argument provided for TYPE"); 17 | return; 18 | } 19 | 20 | if(µ.keyMap[argList[0]] !== undefined) { 21 | return ' typeKey(\'' + µ.keyMap[argList[0]] + '\');\n\n'; 22 | } else { 23 | µ.throwError("Unknown command or key: '" + argList[0] + "'"); 24 | return; 25 | } 26 | }, 27 | 28 | STRING: function(argList, µ) { 29 | argList.shift(); 30 | 31 | if(argList.length < 1) { 32 | µ.throwError("No argument provided for STRING"); 33 | return; 34 | } 35 | 36 | var textString = argList.join(' '); 37 | 38 | // Replace all '"' by '\"' and all '\' by '\\' 39 | textString = textString.split('\\').join('\\\\').split('"').join('\\"'); 40 | 41 | if(textString !== '') { 42 | return ' printText(F("' + textString + '"));\n'; 43 | } 44 | }, 45 | 46 | DELAY: function(argList, µ) { 47 | argList.shift(); 48 | 49 | if(argList.length < 1) { 50 | µ.throwError("No argument provided for DELAY"); 51 | return; 52 | } 53 | 54 | if(!isNaN(argList[0])) { 55 | µ.setData('nodelay', true); 56 | 57 | return ' DigiKeyboard.delay(' + argList[0] + ');\n'; 58 | } else { 59 | µ.throwError("Invalid argument, DELAY only acceptes numbers"); 60 | return; 61 | } 62 | }, 63 | 64 | DEFAULTDELAY: function(argList, µ) { // Not working .-. 65 | argList.shift(); 66 | 67 | if(argList.length < 1) { 68 | µ.throwError("No argument provided for DEFAULTDELAY"); 69 | return; 70 | } 71 | 72 | if(!isNaN(argList[0])) { 73 | µ.setData('defaultdelay', argList[0]); 74 | µ.setData('nodelay', true); 75 | 76 | return ''; 77 | } else { 78 | µ.throwError("Invalid argument, DEFAULTDELAY only acceptes numbers"); 79 | return; 80 | } 81 | }, 82 | DEFAULT_DELAY: function() {return this.DEFAULTDELAY.apply(this, [].slice.call(arguments));}, 83 | 84 | REPEAT: function(argList, µ) { 85 | argList.shift(); 86 | 87 | if(argList.length < 1) { 88 | µ.throwError("No argument provided for REPLAY"); 89 | return; 90 | } 91 | 92 | var lastOutput = µ.trimLast(); 93 | if(lastOutput === '') { 94 | throwError("Nothing to REPLAY, this is the first line"); 95 | return; 96 | } 97 | 98 | lastOutput = ' ' + lastOutput.trim() + '\n'; 99 | lastOutput = lastOutput.replace(/^ /gm,' '); 100 | 101 | if(!isNaN(argList[0])) { 102 | µ.setData('nodelay', true); 103 | 104 | return ' for(int i = 0; i < ' + argList[0] + '; i++) {\n' + lastOutput + ' }\n\n'; 105 | } else { 106 | µ.throwError("Invalid argument, REPLAY only acceptes numbers"); 107 | return; 108 | } 109 | }, 110 | REPLAY: function() {return this.REPEAT.apply(this, [].slice.call(arguments));} 111 | }, 112 | 113 | commandMap: { /* Key that can be typed */ 114 | ESCAPE:'KEY_ESC', 115 | ESC:'KEY_ESC', 116 | GUI:'KEY_LEFT_GUI', 117 | WINDOWS:'KEY_LEFT_GUI', 118 | COMMAND:'KEY_LEFT_GUI', 119 | MENU:'229', 120 | APP:'229', 121 | END:'KEY_END', 122 | SPACE:'KEY_SPACE', 123 | TAB:'KEY_TAB', 124 | PRINTSCREEN:'206', 125 | ENTER:'KEY_ENTER', 126 | RETURN:'KEY_ENTER', 127 | UPARROW:'KEY_UP_ARROW', 128 | DOWNARROW:'KEY_DOWN_ARROW', 129 | LEFTARROW:'KEY_LEFT_ARROW', 130 | RIGHTARROW:'KEY_RIGHT_ARROW', 131 | UP:'KEY_UP_ARROW', 132 | DOWN:'KEY_DOWN_ARROW', 133 | LEFT:'KEY_LEFT_ARROW', 134 | RIGHT:'KEY_RIGHT_ARROW', 135 | CAPSLOCK:'KEY_CAPS_LOCK', 136 | DELETE:'KEY_DELETE', 137 | DEL:'KEY_DELETE', 138 | F1:'KEY_F1', 139 | F2:'KEY_F2', 140 | F3:'KEY_F3', 141 | F4:'KEY_F4', 142 | F5:'KEY_F5', 143 | F6:'KEY_F6', 144 | F7:'KEY_F7', 145 | F8:'KEY_F8', 146 | F9:'KEY_F9', 147 | F10:'KEY_F10', 148 | F11:'KEY_F11', 149 | F12:'KEY_F12', 150 | PAGEUP:'KEY_PAGE_UP', 151 | PAGEDOWN:'KEY_PAGE_DOWN', 152 | HOME: 'KEY_HOME', 153 | INSERT: 'KEY_INSERT', 154 | NUMLOCK: 'KEY_NUM_LOCK', 155 | SCROLLLOCK:'KEY_SCROLL_LOCK' 156 | }, 157 | 158 | comboMap: { /* Key that can only be used in combos */ 159 | ALT:'MOD_ALT_LEFT', 160 | SHIFT:'MOD_SHIFT_LEFT', 161 | CTRL:'MOD_CONTROL_LEFT', 162 | CONTROL:'MOD_CONTROL_LEFT', 163 | GUI:'MOD_GUI_LEFT', 164 | WINDOWS:'MOD_GUI_LEFT', 165 | }, 166 | 167 | keyMap: { /* Normal keys */ 168 | a:'KEY_A', 169 | b:'KEY_B', 170 | c:'KEY_C', 171 | d:'KEY_D', 172 | e:'KEY_E', 173 | f:'KEY_F', 174 | g:'KEY_G', 175 | h:'KEY_H', 176 | i:'KEY_I', 177 | j:'KEY_J', 178 | k:'KEY_K', 179 | l:'KEY_L', 180 | m:'KEY_M', 181 | n:'KEY_N', 182 | o:'KEY_O', 183 | p:'KEY_P', 184 | q:'KEY_Q', 185 | r:'KEY_R', 186 | s:'KEY_S', 187 | t:'KEY_T', 188 | u:'KEY_U', 189 | v:'KEY_V', 190 | w:'KEY_W', 191 | x:'KEY_X', 192 | y:'KEY_Y', 193 | z:'KEY_Z', 194 | 1:'KEY_1', 195 | 2:'KEY_2', 196 | 3:'KEY_3', 197 | 4:'KEY_4', 198 | 5:'KEY_5', 199 | 6:'KEY_6', 200 | 7:'KEY_7', 201 | 8:'KEY_8', 202 | 9:'KEY_9', 203 | 0:'KEY_0' 204 | }, 205 | 206 | postLine: function(lineStr, µ) { 207 | var processedLine = lineStr; 208 | 209 | /* If the defaultdelay has been set, push delay to the line start */ 210 | if(µ.getData('defaultdelay') !== undefined && µ.getData('nodelay') == false) 211 | processedLine = ' delay(' + µ.getData('defaultdelay') + ');\n' + processedLine; 212 | 213 | /* Reset the nodelay statement */ 214 | µ.setData('nodelay', false); 215 | 216 | return processedLine; 217 | }, 218 | 219 | computeKeys: function(keyArray) { /* Function who returns the code for keys combos */ 220 | 221 | var keys = []; 222 | var modifiers = []; 223 | var normalkeys = []; 224 | 225 | // Get rid of the double quotes that the main module adds for normal keys 226 | for (var i = 0; i < keyArray.length; i++) { 227 | keys.push(keyArray[i].replace(/"/g,'')); 228 | } 229 | 230 | for (var i = 0; i < keys.length; i++) { 231 | 232 | var combis = ['KEY_LEFT_GUI','MOD_ALT_LEFT','MOD_SHIFT_LEFT','MOD_CONTROL_LEFT']; 233 | 234 | if (keys.length > 1 && combis.indexOf(keys[i]) > -1) { 235 | if (keys[i] == 'KEY_LEFT_GUI') { 236 | modifiers.push('MOD_GUI_LEFT'); 237 | } else { 238 | modifiers.push(keys[i]); 239 | } 240 | } else { 241 | normalkeys.push(keys[i]); 242 | } 243 | } 244 | 245 | if (modifiers.length > 0 && normalkeys.length == 1) 246 | return ' DigiKeyboard.sendKeyStroke(' + normalkeys[0] + ', ' + modifiers.join('|') + ');\n'; 247 | 248 | if (keys.length == 1) 249 | return ' DigiKeyboard.sendKeyStroke(' + normalkeys[0] + ');\n'; 250 | 251 | return ' // Unexpected key combination: ' + keyArray.join(', ') + '\n'; 252 | }, 253 | 254 | getFinalCode: function(compiledCode) { /* Function who returns the usable code */ 255 | 256 | return '#include "DigiKeyboard.h"\n' 257 | + '#define KEY_UP_ARROW 0x52\n' 258 | + '#define KEY_DOWN_ARROW 0x51\n' 259 | + '#define KEY_LEFT_ARROW 0x50\n' 260 | + '#define KEY_RIGHT_ARROW 0x4F\n' 261 | + '#define KEY_LEFT_GUI 0xE3\n' 262 | + '#define KEY_ESC 0x29\n' 263 | + '#define KEY_HOME 0x4A\n' 264 | + '#define KEY_INSERT 0x49\n' 265 | + '#define KEY_NUM_LOCK 0x53\n' 266 | + '#define KEY_SCROLL_LOCK 0x47\n' 267 | + '#define KEY_CAPS_LOCK 0x39\n' 268 | + '#define KEY_TAB 0x2B\n\n' 269 | + 'void digiBegin() {\n' 270 | + ' DigiKeyboard.sendKeyStroke(0,0);\n' 271 | + ' DigiKeyboard.delay(50);\n' 272 | + '}\n\n' 273 | + 'void digiEnd() {\n' 274 | + ' const int led=1;\n' 275 | + ' pinMode(led, OUTPUT);\n' 276 | + ' while (1) {\n' 277 | + ' digitalWrite(led, !digitalRead(led));\n' 278 | + ' DigiKeyboard.delay(1000);\n' 279 | + ' }\n' 280 | + '}\n\n' 281 | + 'void printText(fstr_t *txt) {\n' 282 | + ' DigiKeyboard.print(txt);\n' 283 | + ' DigiKeyboard.update();\n' 284 | + '}\n\n' 285 | + 'void setup() {\n' 286 | + ' digiBegin();\n' 287 | + compiledCode 288 | + ' digiEnd();\n' 289 | + '}\n\n' 290 | + '/* Unused endless loop */\n' 291 | + 'void loop() {}'; 292 | } 293 | }); 294 | -------------------------------------------------------------------------------- /assets/js/lib/jquery-3.1.0.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v3.1.0 | (c) jQuery Foundation | jquery.org/license */ 2 | !function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?a<0?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0, 3 | r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;d0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K); 4 | if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("