├── README.md ├── public ├── WebEdit.swf ├── Preloader.swf ├── images │ └── favicon.ico ├── playerProductInstall.swf ├── crossdomain.xml ├── firmware │ ├── 0B254DDAF5F73894FB0CCD89CEF1E5B1.bin │ ├── 26CA02103A321B2EAF466BEE55AAB2F5.bin │ ├── 3C905AC6744CEF39F40460693C2D2B41.bin │ ├── 3FBAB957638B57B08DB6E985BCB4A659.bin │ ├── 4674639F055F43E594ACDE7063E5F0C2.bin │ ├── 6DF3C523AE9B4E604B8B44F05C60867F.bin │ ├── 74334E7D720C67C03A9E06A87C67A1B8.bin │ ├── 87F9BFB784BDD145A6BB8CC622367D0D.bin │ ├── D402EF6E5D86AAD4DCF0DF3777F58900.bin │ ├── DAEDF1034730C679E59641496DC79EBF.bin │ ├── DF9482E5F602508C283AEDA6058A64E1.bin │ ├── E77636A940AD0F15C9238849212ECDC5.bin │ └── FC88C6C26604001FC0056714582590FC.bin ├── stylesheets │ ├── style.css │ ├── history.css │ ├── sticky-footer.css │ └── blog.css ├── history │ ├── history.css │ ├── historyFrame.html │ └── history.js └── javascripts │ └── ie10-viewport-bug-workaround.js ├── views ├── error.ejs ├── index.ejs ├── keyboard.ejs ├── kb68.ejs ├── diyso72.ejs ├── index2.ejs └── epbt75.ejs ├── .gitignore ├── test ├── khash2.js ├── cls1.js ├── static.js ├── server_kc60.js ├── server_diyso60.js ├── server_epbt60.js ├── server_epbt60v2.js ├── initdb_diyso72.js ├── initdb_epbt68.js ├── epbt60 │ ├── keycodeToKey.json │ ├── fntype.json │ ├── create_keymap.js │ └── config.json ├── kc60 │ ├── keycodeToKey.json │ ├── fntype.json │ ├── create_keymap.js │ └── config.json ├── initdb_epbt75.js ├── epbt75.json ├── initdb.js └── initdb_kc60.js ├── package.json ├── routes └── index.js ├── app.js ├── bin └── www └── compiler ├── Makefile.kb68 ├── Makefile.kb72 ├── Makefile.kb84 ├── Makefile.kb60 └── Makefile.ble60 /README.md: -------------------------------------------------------------------------------- 1 | # online_compiler 2 | node js tmk compiler 3 | -------------------------------------------------------------------------------- /public/WebEdit.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/WebEdit.swf -------------------------------------------------------------------------------- /public/Preloader.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/Preloader.swf -------------------------------------------------------------------------------- /public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/images/favicon.ico -------------------------------------------------------------------------------- /views/error.ejs: -------------------------------------------------------------------------------- 1 |

<%= message %>

2 |

<%= error.status %>

3 |
<%= error.stack %>
4 | -------------------------------------------------------------------------------- /public/playerProductInstall.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/playerProductInstall.swf -------------------------------------------------------------------------------- /public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/firmware/0B254DDAF5F73894FB0CCD89CEF1E5B1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/0B254DDAF5F73894FB0CCD89CEF1E5B1.bin -------------------------------------------------------------------------------- /public/firmware/26CA02103A321B2EAF466BEE55AAB2F5.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/26CA02103A321B2EAF466BEE55AAB2F5.bin -------------------------------------------------------------------------------- /public/firmware/3C905AC6744CEF39F40460693C2D2B41.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/3C905AC6744CEF39F40460693C2D2B41.bin -------------------------------------------------------------------------------- /public/firmware/3FBAB957638B57B08DB6E985BCB4A659.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/3FBAB957638B57B08DB6E985BCB4A659.bin -------------------------------------------------------------------------------- /public/firmware/4674639F055F43E594ACDE7063E5F0C2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/4674639F055F43E594ACDE7063E5F0C2.bin -------------------------------------------------------------------------------- /public/firmware/6DF3C523AE9B4E604B8B44F05C60867F.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/6DF3C523AE9B4E604B8B44F05C60867F.bin -------------------------------------------------------------------------------- /public/firmware/74334E7D720C67C03A9E06A87C67A1B8.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/74334E7D720C67C03A9E06A87C67A1B8.bin -------------------------------------------------------------------------------- /public/firmware/87F9BFB784BDD145A6BB8CC622367D0D.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/87F9BFB784BDD145A6BB8CC622367D0D.bin -------------------------------------------------------------------------------- /public/firmware/D402EF6E5D86AAD4DCF0DF3777F58900.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/D402EF6E5D86AAD4DCF0DF3777F58900.bin -------------------------------------------------------------------------------- /public/firmware/DAEDF1034730C679E59641496DC79EBF.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/DAEDF1034730C679E59641496DC79EBF.bin -------------------------------------------------------------------------------- /public/firmware/DF9482E5F602508C283AEDA6058A64E1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/DF9482E5F602508C283AEDA6058A64E1.bin -------------------------------------------------------------------------------- /public/firmware/E77636A940AD0F15C9238849212ECDC5.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/E77636A940AD0F15C9238849212ECDC5.bin -------------------------------------------------------------------------------- /public/firmware/FC88C6C26604001FC0056714582590FC.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jichuntao/online_compiler/HEAD/public/firmware/FC88C6C26604001FC0056714582590FC.bin -------------------------------------------------------------------------------- /public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } 9 | -------------------------------------------------------------------------------- /views/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%= title %> 5 | 6 | 7 | 8 |

<%= title %>

9 |

Welcome to <%= title %>

10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | static_file/*.hex 4 | ./log 5 | compiler/tmk_keyboard 6 | .dep/ 7 | *.log 8 | *_temp/ 9 | keymap.db 10 | server.js 11 | *.db 12 | bootstrap-4.0.0-alpha 13 | *.zip 14 | controller 15 | bin/.dep/ 16 | bin/compiler 17 | bin/keymap 18 | bin/obj_*_temp 19 | .idea 20 | public/firmware 21 | keymap -------------------------------------------------------------------------------- /test/khash2.js: -------------------------------------------------------------------------------- 1 | var sqlite3 = require('sqlite3'); 2 | var db = new sqlite3.Database('keymap.db',function() { 3 | db.serialize(function() { 4 | db.all("select * from keymaps where key = 'default'",function(err,res){ 5 | if(!err) 6 | console.log(res[0].keymap); 7 | else 8 | console.log(err); 9 | }); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /test/cls1.js: -------------------------------------------------------------------------------- 1 | 2 | function class1() 3 | { 4 | this.fun1=function (){ 5 | console.log('class1 fun1'); 6 | fun4(); 7 | } 8 | this.fun2=function(){ 9 | console.log('class1 fun2'); 10 | } 11 | var fun3 =function(){ 12 | console.log('class1 fun3'); 13 | }; 14 | function fun4() 15 | { 16 | console.log('class1 fun4'); 17 | } 18 | } 19 | var ss = new class1(); 20 | ss.fun1(); -------------------------------------------------------------------------------- /public/history/history.css: -------------------------------------------------------------------------------- 1 | /* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */ 2 | 3 | #ie_historyFrame { width: 0px; height: 0px; display:none } 4 | #firefox_anchorDiv { width: 0px; height: 0px; display:none } 5 | #safari_formDiv { width: 0px; height: 0px; display:none } 6 | #safari_rememberDiv { width: 0px; height: 0px; display:none } 7 | -------------------------------------------------------------------------------- /public/stylesheets/history.css: -------------------------------------------------------------------------------- 1 | /* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */ 2 | 3 | #ie_historyFrame { width: 0px; height: 0px; display:none } 4 | #firefox_anchorDiv { width: 0px; height: 0px; display:none } 5 | #safari_formDiv { width: 0px; height: 0px; display:none } 6 | #safari_rememberDiv { width: 0px; height: 0px; display:none } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "online_compiler", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "body-parser": "~1.13.2", 10 | "cookie-parser": "~1.3.5", 11 | "debug": "~2.2.0", 12 | "ejs": "~2.3.3", 13 | "express": "~4.13.1", 14 | "morgan": "~1.6.1", 15 | "serve-favicon": "~2.3.0", 16 | "sqlite3" : "~3.1.1" 17 | } 18 | } -------------------------------------------------------------------------------- /public/javascripts/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /public/stylesheets/sticky-footer.css: -------------------------------------------------------------------------------- 1 | /* Sticky footer styles 2 | -------------------------------------------------- */ 3 | html { 4 | position: relative; 5 | min-height: 100%; 6 | } 7 | body { 8 | height: 100%; 9 | background-color: #eeeeee; 10 | overflow:auto; text-align:center; 11 | 12 | } 13 | .footer { 14 | position: absolute; 15 | bottom: 0; 16 | width: 100%; 17 | /* Set the fixed height of the footer here */ 18 | height: 60px; 19 | background-color: #f5f5f5; 20 | } 21 | 22 | 23 | /* Custom page CSS 24 | -------------------------------------------------- */ 25 | /* Not required for template or sticky footer method. */ 26 | 27 | .container { 28 | width: auto; 29 | max-width: 680px; 30 | padding: 0 15px; 31 | } 32 | .container .text-muted { 33 | margin: 20px 0; 34 | } 35 | -------------------------------------------------------------------------------- /public/history/historyFrame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 27 | Hidden frame for Browser History support. 28 | 29 | 30 | -------------------------------------------------------------------------------- /routes/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET home page. */ 5 | router.get('/', function(req, res, next) { 6 | res.render('index', { title: 'Express' }); 7 | }); 8 | 9 | /* ble60 */ 10 | router.get('/ble60', function(req, res, next) { 11 | res.render('keyboard', { kbtype: 'ble60' }); 12 | }); 13 | 14 | /* kc60 */ 15 | router.get('/kc60', function(req, res, next) { 16 | res.render('keyboard', { kbtype: 'kc60' }); 17 | }); 18 | 19 | /* epbt60 */ 20 | router.get('/epbt60', function(req, res, next) { 21 | res.render('keyboard', { kbtype: 'epbt60' }); 22 | }); 23 | 24 | /* epbt60v2 */ 25 | router.get('/epbt60v2', function(req, res, next) { 26 | res.render('keyboard', { kbtype: 'epbt60v2' }); 27 | }); 28 | 29 | /* diyso60 */ 30 | router.get('/diyso60', function(req, res, next) { 31 | res.render('keyboard', { kbtype: 'diyso60' }); 32 | }); 33 | 34 | /* epbt75 */ 35 | router.get('/epbt75', function(req, res, next) { 36 | res.render('keyboard', { kbtype: 'epbt75' }); 37 | }); 38 | 39 | /* test2 */ 40 | router.get('/index2', function(req, res, next) { 41 | res.render('epbt75', { kbtype: 'epbt75' }); 42 | }); 43 | 44 | /* diyer72 */ 45 | router.get('/diyer72', function(req, res, next) { 46 | res.render('diyso72', { kbtype: 'diyso72' }); 47 | }); 48 | 49 | /* kb68 */ 50 | router.get('/tada68', function(req, res, next) { 51 | res.render('kb68', { kbtype: 'kb68' }); 52 | }); 53 | module.exports = router; 54 | -------------------------------------------------------------------------------- /test/static.js: -------------------------------------------------------------------------------- 1 | 2 | var sys = require('sys'), 3 | http = require('http'), 4 | url = require('url'), 5 | path = require('path'), 6 | fs = require('fs'); 7 | 8 | function exe(req,res,rf,data) 9 | { 10 | var filename = rf.pathname; 11 | fs.exists(filename, function(exists) { 12 | if(!exists) { 13 | res.writeHead(404, { "Content-Type": "text/plain" }); 14 | res.write("404 Not Found\n"); 15 | res.end(); 16 | return; 17 | } 18 | fs.readFile(filename, "binary", function(err, file) { 19 | if(err) { 20 | res.writeHead(500, { "Content-Type": "text/plain" }); 21 | res.write(err + "\n"); 22 | res.end(); 23 | return; 24 | } 25 | var contentType='text/html'; 26 | if(Filetypes[rf.extname]){ 27 | contentType=Filetypes[rf.extname]; 28 | } 29 | res.writeHead(200, { 'Content-Type': contentType , 'Content-Length':file.length}); 30 | res.write(file, "binary"); 31 | res.end(); 32 | }); 33 | }); 34 | } 35 | var Filetypes = { 36 | ".css": "text/css", 37 | ".gif": "image/gif", 38 | ".html": "text/html", 39 | ".ico": "image/x-icon", 40 | ".jpeg": "image/jpeg", 41 | ".jpg": "image/jpeg", 42 | ".js": "text/javascript", 43 | ".json": "application/json", 44 | ".pdf": "application/pdf", 45 | ".png": "image/png", 46 | ".txt": "text/plain", 47 | ".xml": "text/xml", 48 | ".swf": "application/x-shockwave-flash", 49 | ".wav": "audio/x-wav", 50 | ".wma": "audio/x-ms-wma", 51 | ".wmv": "video/x-ms-wmv", 52 | ".svg": "image/svg+xml", 53 | ".hex": "application/octet-stream", 54 | ".bin": "application/octet-stream" 55 | }; 56 | exports.exe=exe; 57 | -------------------------------------------------------------------------------- /test/server_kc60.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var url = require('url'); 3 | var path = require('path'); 4 | var util = require('util'); 5 | 6 | var acc = 100; 7 | http.createServer(function (req, res) { 8 | acc++; 9 | if (req.method == 'POST') { 10 | var postData = ''; 11 | req.setEncoding('utf8'); 12 | req.on('data', function (postDataChunk) { 13 | postData += postDataChunk; 14 | }); 15 | req.on('end', function () { 16 | req.removeAllListeners(); 17 | handler(req, res, postData); 18 | postData = ''; 19 | }); 20 | } 21 | else if (req.method == 'GET') { 22 | handler(req, res, ''); 23 | } 24 | }).listen(9128); 25 | 26 | 27 | function handler(req, res, data) { 28 | var rf = restful(req.url); 29 | try { 30 | require('./' + rf.command).exe(req, res, rf, data); 31 | 32 | } catch (err) { 33 | console.log(err); 34 | res.writeHead(404); 35 | res.end(); 36 | } 37 | 38 | return 0; 39 | } 40 | function restful(urlstr) { 41 | 42 | var ret = {}; 43 | var urlObj = url.parse(urlstr, true); 44 | ret.pathname = urlObj.pathname; 45 | ret.query = urlObj.query; 46 | ret.pathname = path.normalize(ret.pathname); 47 | ret.pathname = (ret.pathname == '/') ? ret.pathname = '/index_kc60.html' : ret.pathname; 48 | if (path.extname(ret.pathname) == '') { 49 | ret.command = path.basename(ret.pathname); 50 | } else { 51 | ret.command = 'static'; 52 | ret.pathname = path.join('./static_file/', ret.pathname); 53 | ret.extname = path.extname(ret.pathname); 54 | } 55 | //console.log(ret); 56 | return ret; 57 | } 58 | console.log('Server running'); -------------------------------------------------------------------------------- /test/server_diyso60.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var url = require('url'); 3 | var path = require('path'); 4 | var util = require('util'); 5 | 6 | var acc = 100; 7 | http.createServer(function (req, res) { 8 | acc++; 9 | if (req.method == 'POST') { 10 | var postData = ''; 11 | req.setEncoding('utf8'); 12 | req.on('data', function (postDataChunk) { 13 | postData += postDataChunk; 14 | }); 15 | req.on('end', function () { 16 | req.removeAllListeners(); 17 | handler(req, res, postData); 18 | postData = ''; 19 | }); 20 | } 21 | else if (req.method == 'GET') { 22 | handler(req, res, ''); 23 | } 24 | }).listen(9188); 25 | 26 | 27 | function handler(req, res, data) { 28 | var rf = restful(req.url); 29 | try { 30 | require('./' + rf.command).exe(req, res, rf, data); 31 | 32 | } catch (err) { 33 | console.log(err); 34 | res.writeHead(404); 35 | res.end(); 36 | } 37 | 38 | return 0; 39 | } 40 | function restful(urlstr) { 41 | 42 | var ret = {}; 43 | var urlObj = url.parse(urlstr, true); 44 | ret.pathname = urlObj.pathname; 45 | ret.query = urlObj.query; 46 | ret.pathname = path.normalize(ret.pathname); 47 | ret.pathname = (ret.pathname == '/') ? ret.pathname = '/index_diyso60.html' : ret.pathname; 48 | if (path.extname(ret.pathname) == '') { 49 | ret.command = path.basename(ret.pathname); 50 | } else { 51 | ret.command = 'static'; 52 | ret.pathname = path.join('./static_file/', ret.pathname); 53 | ret.extname = path.extname(ret.pathname); 54 | } 55 | //console.log(ret); 56 | return ret; 57 | } 58 | console.log('Server running'); -------------------------------------------------------------------------------- /test/server_epbt60.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var url = require('url'); 3 | var path = require('path'); 4 | var util = require('util'); 5 | 6 | var acc = 100; 7 | http.createServer(function (req, res) { 8 | acc++; 9 | if (req.method == 'POST') { 10 | var postData = ''; 11 | req.setEncoding('utf8'); 12 | req.on('data', function (postDataChunk) { 13 | postData += postDataChunk; 14 | }); 15 | req.on('end', function () { 16 | req.removeAllListeners(); 17 | handler(req, res, postData); 18 | postData = ''; 19 | }); 20 | } 21 | else if (req.method == 'GET') { 22 | handler(req, res, ''); 23 | } 24 | }).listen(9127); 25 | 26 | 27 | function handler(req, res, data) { 28 | var rf = restful(req.url); 29 | try { 30 | require('./' + rf.command).exe(req, res, rf, data); 31 | 32 | } catch (err) { 33 | console.log(err); 34 | res.writeHead(404); 35 | res.end(); 36 | } 37 | 38 | return 0; 39 | } 40 | function restful(urlstr) { 41 | 42 | var ret = {}; 43 | var urlObj = url.parse(urlstr, true); 44 | ret.pathname = urlObj.pathname; 45 | ret.query = urlObj.query; 46 | ret.pathname = path.normalize(ret.pathname); 47 | ret.pathname = (ret.pathname == '/') ? ret.pathname = '/index_epbt.html' : ret.pathname; 48 | if (path.extname(ret.pathname) == '') { 49 | ret.command = path.basename(ret.pathname); 50 | } else { 51 | ret.command = 'static'; 52 | ret.pathname = path.join('./static_file/', ret.pathname); 53 | ret.extname = path.extname(ret.pathname); 54 | } 55 | //console.log(ret); 56 | return ret; 57 | } 58 | console.log('Server running'); -------------------------------------------------------------------------------- /test/server_epbt60v2.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var url = require('url'); 3 | var path = require('path'); 4 | var util = require('util'); 5 | 6 | var acc = 100; 7 | http.createServer(function (req, res) { 8 | acc++; 9 | if (req.method == 'POST') { 10 | var postData = ''; 11 | req.setEncoding('utf8'); 12 | req.on('data', function (postDataChunk) { 13 | postData += postDataChunk; 14 | }); 15 | req.on('end', function () { 16 | req.removeAllListeners(); 17 | handler(req, res, postData); 18 | postData = ''; 19 | }); 20 | } 21 | else if (req.method == 'GET') { 22 | handler(req, res, ''); 23 | } 24 | }).listen(9129); 25 | 26 | 27 | function handler(req, res, data) { 28 | var rf = restful(req.url); 29 | try { 30 | require('./' + rf.command).exe(req, res, rf, data); 31 | 32 | } catch (err) { 33 | console.log(err); 34 | res.writeHead(404); 35 | res.end(); 36 | } 37 | 38 | return 0; 39 | } 40 | function restful(urlstr) { 41 | 42 | var ret = {}; 43 | var urlObj = url.parse(urlstr, true); 44 | ret.pathname = urlObj.pathname; 45 | ret.query = urlObj.query; 46 | ret.pathname = path.normalize(ret.pathname); 47 | ret.pathname = (ret.pathname == '/') ? ret.pathname = '/index_epbt60v2.html' : ret.pathname; 48 | if (path.extname(ret.pathname) == '') { 49 | ret.command = path.basename(ret.pathname); 50 | } else { 51 | ret.command = 'static'; 52 | ret.pathname = path.join('./static_file/', ret.pathname); 53 | ret.extname = path.extname(ret.pathname); 54 | } 55 | //console.log(ret); 56 | return ret; 57 | } 58 | console.log('Server running'); -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var path = require('path'); 3 | var favicon = require('serve-favicon'); 4 | var logger = require('morgan'); 5 | var cookieParser = require('cookie-parser'); 6 | var bodyParser = require('body-parser'); 7 | 8 | var routes = require('./routes/index'); 9 | var layout = require('./controller/layout'); 10 | var compile = require('./controller/compile'); 11 | 12 | var app = express(); 13 | 14 | // view engine setup 15 | app.set('views', path.join(__dirname, 'views')); 16 | app.set('view engine', 'ejs'); 17 | 18 | // uncomment after placing your favicon in /public 19 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); 20 | app.use(logger('dev')); 21 | app.use(bodyParser.json()); 22 | app.use(bodyParser.urlencoded({ extended: false })); 23 | app.use(cookieParser()); 24 | app.use(express.static(path.join(__dirname, 'public'))); 25 | 26 | app.use('/', routes); 27 | app.use('/layout', layout); 28 | app.use('/compile', compile); 29 | 30 | // catch 404 and forward to error handler 31 | app.use(function(req, res, next) { 32 | var err = new Error('Not Found'); 33 | err.status = 404; 34 | next(err); 35 | }); 36 | 37 | // error handlers 38 | 39 | // development error handler 40 | // will print stacktrace 41 | if (app.get('env') === 'development') { 42 | app.use(function(err, req, res, next) { 43 | res.status(err.status || 500); 44 | res.render('error', { 45 | message: err.message, 46 | error: err 47 | }); 48 | }); 49 | } 50 | 51 | // production error handler 52 | // no stacktraces leaked to user 53 | app.use(function(err, req, res, next) { 54 | res.status(err.status || 500); 55 | res.render('error', { 56 | message: err.message, 57 | error: {} 58 | }); 59 | }); 60 | 61 | 62 | module.exports = app; 63 | -------------------------------------------------------------------------------- /bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('online_compiler:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '3000'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /test/initdb_diyso72.js: -------------------------------------------------------------------------------- 1 | var sqlite3 = require('sqlite3').verbose(); 2 | var databaseFile='../keymap.db'; 3 | var db = new sqlite3.Database(databaseFile); 4 | var defaultKeymap=[[],[[[["KC_ESC"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"]],[["KC_GRV"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"],["KC_INS"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"],["KC_DEL"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"],["KC_UP"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_FN",[1,[1]]],["KC_RCTRL"],["KC_DOWN"],["KC_RGHT"],["KC_RGHT"]]],[[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]]]],"diyso72","1.2","bin"]; 5 | //console.log(JSON.stringify(defaultKeymap)); 6 | db.serialize(function() { 7 | db.run("delete from keymaps where key='diyso72'"); 8 | db.run("insert into keymaps values('diyso72','diyso72','"+JSON.stringify(defaultKeymap)+"')"); 9 | 10 | }); 11 | 12 | db.close(); -------------------------------------------------------------------------------- /test/initdb_epbt68.js: -------------------------------------------------------------------------------- 1 | var sqlite3 = require('sqlite3').verbose(); 2 | var databaseFile='../keymap.db'; 3 | var db = new sqlite3.Database(databaseFile); 4 | var defaultKeymap=[[0,0,0],[[[["KC_GRV"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"],["KC_DEL"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"],["KC_PGUP"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"],["KC_PGDN"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"],["KC_UP"],["KC_FN",[1,[1]]]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RCTRL"],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"]]],[[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]]]],"kb68","1.2","bin"]; 5 | db.serialize(function() { 6 | db.run("delete from keymaps where key='kb68'"); 7 | db.run("insert into keymaps values('kb68','kb68','"+JSON.stringify(defaultKeymap)+"')"); 8 | }); 9 | 10 | db.close(); -------------------------------------------------------------------------------- /test/epbt60/keycodeToKey.json: -------------------------------------------------------------------------------- 1 | { 2 | "8": "BSPC", 3 | "9": "TAB", 4 | "12": "CLEAR", 5 | "13": "ENT", 6 | "16": "LSFT", 7 | "17": "LCTRL", 8 | "18": "LALT", 9 | "20": "CAPS", 10 | "27": "ESC", 11 | "32": "SPC", 12 | "33": "PGUP", 13 | "34": "PGDN", 14 | "35": "END", 15 | "36": "HOME", 16 | "37": "LEFT", 17 | "38": "UP", 18 | "39": "RGHT", 19 | "40": "DOWN", 20 | "45": "INS", 21 | "46": "DEL", 22 | "47": "HELP", 23 | "48": "0", 24 | "49": "1", 25 | "50": "2", 26 | "51": "3", 27 | "52": "4", 28 | "53": "5", 29 | "54": "6", 30 | "55": "7", 31 | "56": "8", 32 | "57": "9", 33 | "65": "A", 34 | "66": "B", 35 | "67": "C", 36 | "68": "D", 37 | "69": "E", 38 | "70": "F", 39 | "71": "G", 40 | "72": "H", 41 | "73": "I", 42 | "74": "J", 43 | "75": "K", 44 | "76": "L", 45 | "77": "M", 46 | "78": "N", 47 | "79": "O", 48 | "80": "P", 49 | "81": "Q", 50 | "82": "R", 51 | "83": "S", 52 | "84": "T", 53 | "85": "U", 54 | "86": "V", 55 | "87": "W", 56 | "88": "X", 57 | "89": "Y", 58 | "90": "Z", 59 | "96": "P0", 60 | "97": "P1", 61 | "98": "P2", 62 | "99": "P3", 63 | "100": "P4", 64 | "101": "P5", 65 | "102": "P6", 66 | "103": "P7", 67 | "104": "P8", 68 | "105": "P9", 69 | "106": "PAST", 70 | "107": "PPLS", 71 | "108": "PENT", 72 | "109": "PMNS", 73 | "110": "PDOT", 74 | "111": "PSLS", 75 | "112": "F1", 76 | "113": "F2", 77 | "114": "F3", 78 | "115": "F4", 79 | "116": "F5", 80 | "117": "F6", 81 | "118": "F7", 82 | "119": "F8", 83 | "120": "F9", 84 | "121": "F10", 85 | "122": "F11", 86 | "123": "F12", 87 | "124": "PSCR", 88 | "125": "F14", 89 | "126": "F15", 90 | "144": "NLCK", 91 | "186": "QUOT", 92 | "187": "EQL", 93 | "188": "COMM", 94 | "189": "MINS", 95 | "190": "DOT", 96 | "191": "SLSH", 97 | "219": "LBRC", 98 | "220": "BSLS", 99 | "221": "RBRC", 100 | "222": "SCLN" 101 | } -------------------------------------------------------------------------------- /test/kc60/keycodeToKey.json: -------------------------------------------------------------------------------- 1 | { 2 | "8": "BSPC", 3 | "9": "TAB", 4 | "12": "CLEAR", 5 | "13": "ENT", 6 | "16": "LSFT", 7 | "17": "LCTRL", 8 | "18": "LALT", 9 | "20": "CAPS", 10 | "27": "ESC", 11 | "32": "SPC", 12 | "33": "PGUP", 13 | "34": "PGDN", 14 | "35": "END", 15 | "36": "HOME", 16 | "37": "LEFT", 17 | "38": "UP", 18 | "39": "RGHT", 19 | "40": "DOWN", 20 | "45": "INS", 21 | "46": "DEL", 22 | "47": "HELP", 23 | "48": "0", 24 | "49": "1", 25 | "50": "2", 26 | "51": "3", 27 | "52": "4", 28 | "53": "5", 29 | "54": "6", 30 | "55": "7", 31 | "56": "8", 32 | "57": "9", 33 | "65": "A", 34 | "66": "B", 35 | "67": "C", 36 | "68": "D", 37 | "69": "E", 38 | "70": "F", 39 | "71": "G", 40 | "72": "H", 41 | "73": "I", 42 | "74": "J", 43 | "75": "K", 44 | "76": "L", 45 | "77": "M", 46 | "78": "N", 47 | "79": "O", 48 | "80": "P", 49 | "81": "Q", 50 | "82": "R", 51 | "83": "S", 52 | "84": "T", 53 | "85": "U", 54 | "86": "V", 55 | "87": "W", 56 | "88": "X", 57 | "89": "Y", 58 | "90": "Z", 59 | "96": "P0", 60 | "97": "P1", 61 | "98": "P2", 62 | "99": "P3", 63 | "100": "P4", 64 | "101": "P5", 65 | "102": "P6", 66 | "103": "P7", 67 | "104": "P8", 68 | "105": "P9", 69 | "106": "PAST", 70 | "107": "PPLS", 71 | "108": "PENT", 72 | "109": "PMNS", 73 | "110": "PDOT", 74 | "111": "PSLS", 75 | "112": "F1", 76 | "113": "F2", 77 | "114": "F3", 78 | "115": "F4", 79 | "116": "F5", 80 | "117": "F6", 81 | "118": "F7", 82 | "119": "F8", 83 | "120": "F9", 84 | "121": "F10", 85 | "122": "F11", 86 | "123": "F12", 87 | "124": "PSCR", 88 | "125": "F14", 89 | "126": "F15", 90 | "144": "NLCK", 91 | "186": "QUOT", 92 | "187": "EQL", 93 | "188": "COMM", 94 | "189": "MINS", 95 | "190": "DOT", 96 | "191": "SLSH", 97 | "219": "LBRC", 98 | "220": "BSLS", 99 | "221": "RBRC", 100 | "222": "SCLN" 101 | } -------------------------------------------------------------------------------- /test/epbt60/fntype.json: -------------------------------------------------------------------------------- 1 | { 2 | "fntype": [ 3 | { 4 | "args": [], 5 | "action": "ACTION_KEY", 6 | "type": 0 7 | }, 8 | { 9 | "args": [ 10 | 1 11 | ], 12 | "action": "ACTION_LAYER_MOMENTARY", 13 | "type": 1 14 | }, 15 | { 16 | "args": [ 17 | 1 18 | ], 19 | "action": "ACTION_LAYER_ON", 20 | "type": 2 21 | }, 22 | { 23 | "args": [ 24 | 1 25 | ], 26 | "action": "ACTION_LAYER_OFF", 27 | "type": 2 28 | }, 29 | { 30 | "args": [ 31 | 1 32 | ], 33 | "action": "ACTION_LAYER_TOGGLE", 34 | "type": 1 35 | }, 36 | { 37 | "args": [ 38 | 1, 39 | "KC_NO" 40 | ], 41 | "action": "ACTION_LAYER_TAP_KEY", 42 | "type": 3 43 | }, 44 | { 45 | "args": [ 46 | 0, 47 | 0, 48 | 0, 49 | 0 50 | ], 51 | "action": "ACTION_MODS", 52 | "type": 4 53 | }, 54 | { 55 | "args": [ 56 | 0, 57 | 0, 58 | 0, 59 | 0, 60 | "KC_NO" 61 | ], 62 | "action": "ACTION_MODS_KEY", 63 | "type": 5 64 | }, 65 | { 66 | "args": [ 67 | 0, 68 | 0, 69 | 0, 70 | 0 71 | ], 72 | "action": "ACTION_MODS_ONESHOT", 73 | "type": 4 74 | }, 75 | { 76 | "args": [ 77 | 0, 78 | 0, 79 | 0, 80 | 0 81 | ], 82 | "action": "ACTION_MODS_TAP_TOGGLE", 83 | "type": 4 84 | }, 85 | { 86 | "args": [ 87 | 1 88 | ], 89 | "action": "ACTION_LAYER_CLEAR", 90 | "type": 6 91 | }, 92 | { 93 | "args": [], 94 | "action": "ACTION_MACRO", 95 | "type": 7 96 | } 97 | ], 98 | "fntype_sp": { 99 | "KC_LED_IN": { 100 | "action": "ACTION_BACKLIGHT_INCREASE", 101 | "args": [] 102 | }, 103 | "KC_LED_DE": { 104 | "action": "ACTION_BACKLIGHT_DECREASE", 105 | "args": [] 106 | }, 107 | "KC_LED_TOGGLE": { 108 | "action": "ACTION_BACKLIGHT_TOGGLE", 109 | "args": [] 110 | }, 111 | "KC_SFT_ESC": { 112 | "action": "ACTION_FUNCTION", 113 | "args": [ 114 | "SHIFT_ESC" 115 | ] 116 | }, 117 | "KC_LOCK_WIN": { 118 | "action": "ACTION_NOGUI_TOGGLE", 119 | "args": [] 120 | } 121 | } 122 | } -------------------------------------------------------------------------------- /test/kc60/fntype.json: -------------------------------------------------------------------------------- 1 | { 2 | "fntype": [ 3 | { 4 | "args": [], 5 | "action": "ACTION_KEY", 6 | "type": 0 7 | }, 8 | { 9 | "args": [ 10 | 1 11 | ], 12 | "action": "ACTION_LAYER_MOMENTARY", 13 | "type": 1 14 | }, 15 | { 16 | "args": [ 17 | 1 18 | ], 19 | "action": "ACTION_LAYER_ON", 20 | "type": 2 21 | }, 22 | { 23 | "args": [ 24 | 1 25 | ], 26 | "action": "ACTION_LAYER_OFF", 27 | "type": 2 28 | }, 29 | { 30 | "args": [ 31 | 1 32 | ], 33 | "action": "ACTION_LAYER_TOGGLE", 34 | "type": 1 35 | }, 36 | { 37 | "args": [ 38 | 1, 39 | "KC_NO" 40 | ], 41 | "action": "ACTION_LAYER_TAP_KEY", 42 | "type": 3 43 | }, 44 | { 45 | "args": [ 46 | 0, 47 | 0, 48 | 0, 49 | 0 50 | ], 51 | "action": "ACTION_MODS", 52 | "type": 4 53 | }, 54 | { 55 | "args": [ 56 | 0, 57 | 0, 58 | 0, 59 | 0, 60 | "KC_NO" 61 | ], 62 | "action": "ACTION_MODS_KEY", 63 | "type": 5 64 | }, 65 | { 66 | "args": [ 67 | 0, 68 | 0, 69 | 0, 70 | 0 71 | ], 72 | "action": "ACTION_MODS_ONESHOT", 73 | "type": 4 74 | }, 75 | { 76 | "args": [ 77 | 0, 78 | 0, 79 | 0, 80 | 0 81 | ], 82 | "action": "ACTION_MODS_TAP_TOGGLE", 83 | "type": 4 84 | }, 85 | { 86 | "args": [ 87 | 1 88 | ], 89 | "action": "ACTION_LAYER_CLEAR", 90 | "type": 6 91 | }, 92 | { 93 | "args": [], 94 | "action": "ACTION_MACRO", 95 | "type": 7 96 | } 97 | ], 98 | "fntype_sp": { 99 | "KC_LED_IN": { 100 | "action": "ACTION_BACKLIGHT_INCREASE", 101 | "args": [] 102 | }, 103 | "KC_LED_DE": { 104 | "action": "ACTION_BACKLIGHT_DECREASE", 105 | "args": [] 106 | }, 107 | "KC_LED_TOGGLE": { 108 | "action": "ACTION_BACKLIGHT_TOGGLE", 109 | "args": [] 110 | }, 111 | "KC_SFT_ESC": { 112 | "action": "ACTION_FUNCTION", 113 | "args": [ 114 | "SHIFT_ESC" 115 | ] 116 | }, 117 | "KC_LOCK_WIN": { 118 | "action": "ACTION_NOGUI_TOGGLE", 119 | "args": [] 120 | } 121 | } 122 | } -------------------------------------------------------------------------------- /public/stylesheets/blog.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Globals 3 | */ 4 | 5 | @media (min-width: 48em) { 6 | html { 7 | font-size: 18px; 8 | } 9 | } 10 | 11 | body { 12 | color: #555; 13 | } 14 | 15 | h1, .h1, 16 | h2, .h2, 17 | h3, .h3, 18 | h4, .h4, 19 | h5, .h5, 20 | h6, .h6 { 21 | font-weight: normal; 22 | color: #333; 23 | } 24 | 25 | 26 | /* 27 | * Override Bootstrap's default container. 28 | */ 29 | 30 | .container { 31 | max-width: 60rem; 32 | } 33 | 34 | 35 | /* 36 | * Masthead for nav 37 | */ 38 | 39 | .blog-masthead { 40 | margin-bottom: 0rem; 41 | background-color: #428bca; 42 | -webkit-box-shadow: inset 0 -.1rem .25rem rgba(0,0,0,.1); 43 | box-shadow: inset 0 -.1rem .25rem rgba(0,0,0,.1); 44 | } 45 | 46 | /* Nav links */ 47 | .nav-link { 48 | position: relative; 49 | padding: 1rem; 50 | font-weight: 500; 51 | color: #cdddeb; 52 | } 53 | .nav-link:hover, 54 | .nav-link:focus { 55 | color: #fff; 56 | background-color: transparent; 57 | } 58 | 59 | /* Active state gets a caret at the bottom */ 60 | .nav-link.active { 61 | color: #fff; 62 | } 63 | .nav-link.active:after { 64 | position: absolute; 65 | bottom: 0; 66 | left: 50%; 67 | width: 0; 68 | height: 0; 69 | margin-left: -.3rem; 70 | vertical-align: middle; 71 | content: ""; 72 | border-right: .3rem solid transparent; 73 | border-bottom: .3rem solid; 74 | border-left: .3rem solid transparent; 75 | } 76 | 77 | 78 | /* 79 | * Blog name and description 80 | */ 81 | 82 | .blog-header { 83 | padding-bottom: 1.25rem; 84 | margin-bottom: 2rem; 85 | border-bottom: .05rem solid #eee; 86 | } 87 | .blog-title { 88 | margin-bottom: 0; 89 | font-size: 2rem; 90 | font-weight: normal; 91 | } 92 | .blog-description { 93 | font-size: 1.1rem; 94 | color: #999; 95 | } 96 | 97 | @media (min-width: 40em) { 98 | .blog-title { 99 | font-size: 3.5rem; 100 | } 101 | } 102 | 103 | 104 | /* 105 | * Main column and sidebar layout 106 | */ 107 | 108 | /* Sidebar modules for boxing content */ 109 | .sidebar-module { 110 | padding: 1rem; 111 | /*margin: 0 -1rem 1rem;*/ 112 | } 113 | .sidebar-module-inset { 114 | padding: 1rem; 115 | background-color: #f5f5f5; 116 | border-radius: .25rem; 117 | } 118 | .sidebar-module-inset p:last-child, 119 | .sidebar-module-inset ul:last-child, 120 | .sidebar-module-inset ol:last-child { 121 | margin-bottom: 0; 122 | } 123 | 124 | 125 | /* Pagination */ 126 | .pager { 127 | margin-bottom: 4rem; 128 | text-align: left; 129 | } 130 | .pager > li > a { 131 | width: 8rem; 132 | padding: .75rem 1.25rem; 133 | text-align: center; 134 | border-radius: 2rem; 135 | } 136 | 137 | 138 | /* 139 | * Blog posts 140 | */ 141 | 142 | .blog-post { 143 | margin-bottom: 4rem; 144 | } 145 | .blog-post-title { 146 | margin-bottom: .25rem; 147 | font-size: 2.5rem; 148 | } 149 | .blog-post-meta { 150 | margin-bottom: 1.25rem; 151 | color: #999; 152 | } 153 | 154 | 155 | /* 156 | * Footer 157 | */ 158 | 159 | .blog-footer { 160 | padding: 2.5rem 0; 161 | color: #999; 162 | text-align: center; 163 | background-color: #f9f9f9; 164 | border-top: .05rem solid #e5e5e5; 165 | } 166 | .blog-footer p:last-child { 167 | margin-bottom: 0; 168 | } 169 | -------------------------------------------------------------------------------- /views/keyboard.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | Keyboard Web 15 | 16 | 17 | 23 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 51 | 74 | 75 | 76 |
77 |

78 | To view this page ensure that Adobe Flash Player version 79 | 11.1.0 or greater is installed. 80 |

81 |
82 | 83 | 84 | -------------------------------------------------------------------------------- /test/initdb_epbt75.js: -------------------------------------------------------------------------------- 1 | var sqlite3 = require('sqlite3').verbose(); 2 | var databaseFile='../keymap.db'; 3 | var db = new sqlite3.Database(databaseFile); 4 | var defaultKeymap=[[0,0],[[[["KC_ESC"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_PSCR"],["KC_SLCK"],["KC_INS"]],[["KC_GRV"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"],["KC_DEL"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"],["KC_PGUP"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"],["KC_PGDN"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"],["KC_UP"],["KC_FN",[1,[1]]]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RCTRL"],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"]]],[[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]]]],"epbt75","1.2","hex"]; 5 | var wkl=[[0,0],[[[["KC_ESC"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_PSCR"],["KC_SLCK"],["KC_INS"]],[["KC_GRV"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"],["KC_DEL"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"],["KC_PGUP"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"],["KC_PGDN"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"],["KC_UP"],["KC_FN",[1,[1]]]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RCTRL"],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"]]],[[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_PAUS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_HOME"],["KC_END"],["KC_TRNS"],["KC_TRNS"]],[["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_VOLU"],["KC_VOLD"],["KC_MUTE"],["KC_TRNS"],["KC_LED_DE"],["KC_TRNS"]],[["KC_TRNS"],["KC_LOCK_WIN"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_TRNS"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_LED_TOGGLE"]]]],"epbt75","1.2","bin"]; 6 | db.serialize(function() { 7 | db.run("delete from keymaps where key='epbt75'"); 8 | db.run("delete from keymaps where key='epbt75_wkl'"); 9 | db.run("delete from keymaps where key='epbt75_wk'"); 10 | db.run("insert into keymaps values('epbt75','epbt75','"+JSON.stringify(wkl)+"')"); 11 | db.run("insert into keymaps values('epbt75_wkl','epbt75_wkl','"+JSON.stringify(wkl)+"')"); 12 | db.run("insert into keymaps values('epbt75_wk','epbt75_wk','"+JSON.stringify(wkl)+"')"); 13 | }); 14 | 15 | db.close(); -------------------------------------------------------------------------------- /views/kb68.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Keyboard Editor 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 44 | 67 | 68 | 69 | 70 |
71 |
72 | 75 |
76 |
77 | 78 | 79 |
80 |

81 | To view this page ensure that Adobe Flash Player version 82 | 11.1.0 or greater is installed. 83 |

84 |
85 | 86 | 87 |
88 |

刷机方式:按下键盘PCB背部的刷机按钮,此时键盘会识别为U盘,点击编译固件后,将bin覆盖U盘中的固件然后按Esc键重启键盘即可。

89 |

90 |
91 |
92 |
93 |
94 | 99 | 100 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /views/diyso72.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Keyboard Editor 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 44 | 67 | 68 | 69 | 70 |
71 |
72 | 75 |
76 |
77 | 78 | 79 |
80 |

81 | To view this page ensure that Adobe Flash Player version 82 | 11.1.0 or greater is installed. 83 |

84 |
85 | 86 | 87 |
88 |

刷机方式:按下键盘PCB背部的刷机按钮,此时键盘会识别为U盘,点击编译固件后,将bin覆盖U盘中的固件然后按Esc键重启键盘即可。

89 |

90 |

查看72套件

91 |
92 |
93 |
94 |
95 | 100 | 101 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /views/index2.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Keyboard Editor 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 44 | 67 | 68 | 69 | 70 |
71 |
72 | 75 |
76 |
77 | 78 | 79 |
80 |

81 | To view this page ensure that Adobe Flash Player version 82 | 11.1.0 or greater is installed. 83 |

84 |
85 | 86 | 87 |
88 | 91 |

Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.

92 |

Use the sticky footer with a fixed navbar if need be, too.

93 |
94 | 95 | 100 | 101 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /views/epbt75.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Keyboard Editor 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 44 | 67 | 68 | 69 | 70 |
71 |
72 | 75 |
76 |
77 | 78 | 79 |
80 |

81 | To view this page ensure that Adobe Flash Player version 82 | 11.1.0 or greater is installed. 83 |

84 |
85 | 86 | 87 |
88 |

配列1: WKL(Winkeyless) , 配列2: WK(Winkey)

89 |

刷机方式:按下键盘PCB背部的刷机按钮,此时键盘会识别为U盘,点击编译固件后,将bin覆盖U盘中的固件然后按Esc键重启键盘即可。

90 |

91 |

购买75套件

92 |
93 |
94 |
95 |
96 | 101 | 102 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /compiler/Makefile.kb68: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------------------- 2 | # On command line: 3 | # 4 | # make all = Make software. 5 | # 6 | # make clean = Clean out built project files. 7 | # 8 | # make coff = Convert ELF to AVR COFF. 9 | # 10 | # make extcoff = Convert ELF to AVR Extended COFF. 11 | # 12 | # make program = Download the hex file to the device. 13 | # Please customize your programmer settings(PROGRAM_CMD) 14 | # 15 | # make teensy = Download the hex file to the device, using teensy_loader_cli. 16 | # (must have teensy_loader_cli installed). 17 | # 18 | # make dfu = Download the hex file to the device, using dfu-programmer (must 19 | # have dfu-programmer installed). 20 | # 21 | # make flip = Download the hex file to the device, using Atmel FLIP (must 22 | # have Atmel FLIP installed). 23 | # 24 | # make dfu-ee = Download the eeprom file to the device, using dfu-programmer 25 | # (must have dfu-programmer installed). 26 | # 27 | # make flip-ee = Download the eeprom file to the device, using Atmel FLIP 28 | # (must have Atmel FLIP installed). 29 | # 30 | # make debug = Start either simulavr or avarice as specified for debugging, 31 | # with avr-gdb or avr-insight as the front end for debugging. 32 | # 33 | # make filename.s = Just compile filename.c into the assembler code only. 34 | # 35 | # make filename.i = Create a preprocessed source file for use in submitting 36 | # bug reports to the GCC project. 37 | # 38 | # To rebuild project do "make clean" then "make all". 39 | #---------------------------------------------------------------------------- 40 | # Target file name (without extension). 41 | TARGET = kb68_temp 42 | 43 | # Directory common source filess exist 44 | TMK_DIR = ../compiler/tmk_keyboard/tmk_core 45 | 46 | # Directory keyboard dependent files exist 47 | TARGET_DIR = ../compiler/tmk_keyboard 48 | 49 | # project specific files 50 | SRC = $(TARGET_DIR)/keyboard/kb68/keymap_common.c \ 51 | $(TARGET_DIR)/keyboard/kb68/matrix.c \ 52 | $(TARGET_DIR)/keyboard/kb68/led.c \ 53 | $(TARGET_DIR)/keyboard/kb68/backlight.c 54 | 55 | ifdef KEYMAP 56 | SRC := $(KEYMAP) $(SRC) 57 | else 58 | SRC := $(TARGET_DIR)/keyboard/kb68/keymap_default.c $(SRC) 59 | endif 60 | 61 | ifdef CONF 62 | CONFIG_H = $(CONF) 63 | else 64 | CONFIG_H = $(TARGET_DIR)/keyboard/kb68/config.h 65 | endif 66 | 67 | ifdef HEXFILE 68 | HEXFILE = $(HEXFILE) 69 | else 70 | HEXFILE = ./kb68_lufa.hex 71 | endif 72 | 73 | ifdef BINFILE 74 | BINFILE = $(BINFILE) 75 | else 76 | BINFILE = ./kb68_lufa.bin 77 | endif 78 | 79 | # MCU name 80 | #MCU = at90usb1287 81 | MCU = atmega32u4 82 | 83 | # Processor frequency. 84 | # This will define a symbol, F_CPU, in all source code files equal to the 85 | # processor frequency in Hz. You can then use this symbol in your source code to 86 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done 87 | # automatically to create a 32-bit value in your source code. 88 | # 89 | # This will be an integer division of F_USB below, as it is sourced by 90 | # F_USB after it has run through any CPU prescalers. Note that this value 91 | # does not *change* the processor frequency - it should merely be updated to 92 | # reflect the processor speed set externally so that the code can use accurate 93 | # software delays. 94 | F_CPU = 16000000 95 | 96 | 97 | # 98 | # LUFA specific 99 | # 100 | # Target architecture (see library "Board Types" documentation). 101 | ARCH = AVR8 102 | 103 | # Input clock frequency. 104 | # This will define a symbol, F_USB, in all source code files equal to the 105 | # input clock frequency (before any prescaling is performed) in Hz. This value may 106 | # differ from F_CPU if prescaling is used on the latter, and is required as the 107 | # raw input clock is fed directly to the PLL sections of the AVR for high speed 108 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' 109 | # at the end, this will be done automatically to create a 32-bit value in your 110 | # source code. 111 | # 112 | # If no clock division is performed on the input clock inside the AVR (via the 113 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. 114 | F_USB = $(F_CPU) 115 | 116 | # Interrupt driven control endpoint task(+60) 117 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT 118 | 119 | 120 | # Boot Section Size in *bytes* 121 | # Teensy halfKay 512 122 | # Teensy++ halfKay 1024 123 | # Atmel DFU loader 4096 124 | # LUFA bootloader 4096 125 | # USBaspLoader 2048 126 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 127 | 128 | 129 | # Build Options 130 | # comment out to disable the options. 131 | # 132 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) 133 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 134 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 135 | #CONSOLE_ENABLE = yes # Console for debug(+400) 136 | COMMAND_ENABLE = yes # Commands for debug and configuration 137 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 138 | NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA 139 | BACKLIGHT_ENABLE = yes 140 | 141 | # Optimize size but this may cause error "relocation truncated to fit" 142 | #EXTRALDFLAGS = -Wl,--relax 143 | 144 | # Search Path 145 | VPATH += $(TARGET_DIR) 146 | VPATH += $(TMK_DIR) 147 | 148 | include $(TMK_DIR)/protocol/lufa.mk 149 | include $(TMK_DIR)/common.mk 150 | include $(TMK_DIR)/rules_online.mk 151 | -------------------------------------------------------------------------------- /compiler/Makefile.kb72: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------------------- 2 | # On command line: 3 | # 4 | # make all = Make software. 5 | # 6 | # make clean = Clean out built project files. 7 | # 8 | # make coff = Convert ELF to AVR COFF. 9 | # 10 | # make extcoff = Convert ELF to AVR Extended COFF. 11 | # 12 | # make program = Download the hex file to the device. 13 | # Please customize your programmer settings(PROGRAM_CMD) 14 | # 15 | # make teensy = Download the hex file to the device, using teensy_loader_cli. 16 | # (must have teensy_loader_cli installed). 17 | # 18 | # make dfu = Download the hex file to the device, using dfu-programmer (must 19 | # have dfu-programmer installed). 20 | # 21 | # make flip = Download the hex file to the device, using Atmel FLIP (must 22 | # have Atmel FLIP installed). 23 | # 24 | # make dfu-ee = Download the eeprom file to the device, using dfu-programmer 25 | # (must have dfu-programmer installed). 26 | # 27 | # make flip-ee = Download the eeprom file to the device, using Atmel FLIP 28 | # (must have Atmel FLIP installed). 29 | # 30 | # make debug = Start either simulavr or avarice as specified for debugging, 31 | # with avr-gdb or avr-insight as the front end for debugging. 32 | # 33 | # make filename.s = Just compile filename.c into the assembler code only. 34 | # 35 | # make filename.i = Create a preprocessed source file for use in submitting 36 | # bug reports to the GCC project. 37 | # 38 | # To rebuild project do "make clean" then "make all". 39 | #---------------------------------------------------------------------------- 40 | # Target file name (without extension). 41 | TARGET = kb72_temp 42 | 43 | # Directory common source filess exist 44 | TMK_DIR = ../compiler/tmk_keyboard/tmk_core 45 | 46 | # Directory keyboard dependent files exist 47 | TARGET_DIR = ../compiler/tmk_keyboard 48 | 49 | # project specific files 50 | SRC = $(TARGET_DIR)/keyboard/kb84/keymap_common.c \ 51 | $(TARGET_DIR)/keyboard/kb84/matrix.c \ 52 | $(TARGET_DIR)/keyboard/kb84/led.c \ 53 | $(TARGET_DIR)/keyboard/kb84/backlight.c 54 | 55 | ifdef KEYMAP 56 | SRC := $(KEYMAP) $(SRC) 57 | else 58 | SRC := $(TARGET_DIR)/keyboard/kb84/keymap_default.c $(SRC) 59 | endif 60 | 61 | ifdef CONF 62 | CONFIG_H = $(CONF) 63 | else 64 | CONFIG_H = $(TARGET_DIR)/keyboard/kb72/config.h 65 | endif 66 | 67 | ifdef HEXFILE 68 | HEXFILE = $(HEXFILE) 69 | else 70 | HEXFILE = ./kb72_lufa.hex 71 | endif 72 | 73 | ifdef BINFILE 74 | BINFILE = $(BINFILE) 75 | else 76 | BINFILE = ./kb72_lufa.bin 77 | endif 78 | 79 | # MCU name 80 | #MCU = at90usb1287 81 | MCU = atmega32u4 82 | 83 | # Processor frequency. 84 | # This will define a symbol, F_CPU, in all source code files equal to the 85 | # processor frequency in Hz. You can then use this symbol in your source code to 86 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done 87 | # automatically to create a 32-bit value in your source code. 88 | # 89 | # This will be an integer division of F_USB below, as it is sourced by 90 | # F_USB after it has run through any CPU prescalers. Note that this value 91 | # does not *change* the processor frequency - it should merely be updated to 92 | # reflect the processor speed set externally so that the code can use accurate 93 | # software delays. 94 | F_CPU = 16000000 95 | 96 | 97 | # 98 | # LUFA specific 99 | # 100 | # Target architecture (see library "Board Types" documentation). 101 | ARCH = AVR8 102 | 103 | # Input clock frequency. 104 | # This will define a symbol, F_USB, in all source code files equal to the 105 | # input clock frequency (before any prescaling is performed) in Hz. This value may 106 | # differ from F_CPU if prescaling is used on the latter, and is required as the 107 | # raw input clock is fed directly to the PLL sections of the AVR for high speed 108 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' 109 | # at the end, this will be done automatically to create a 32-bit value in your 110 | # source code. 111 | # 112 | # If no clock division is performed on the input clock inside the AVR (via the 113 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. 114 | F_USB = $(F_CPU) 115 | 116 | # Interrupt driven control endpoint task(+60) 117 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT 118 | 119 | 120 | # Boot Section Size in *bytes* 121 | # Teensy halfKay 512 122 | # Teensy++ halfKay 1024 123 | # Atmel DFU loader 4096 124 | # LUFA bootloader 4096 125 | # USBaspLoader 2048 126 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 127 | 128 | 129 | # Build Options 130 | # comment out to disable the options. 131 | # 132 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) 133 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 134 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 135 | #CONSOLE_ENABLE = yes # Console for debug(+400) 136 | COMMAND_ENABLE = yes # Commands for debug and configuration 137 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 138 | NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA 139 | BACKLIGHT_ENABLE = yes 140 | 141 | # Optimize size but this may cause error "relocation truncated to fit" 142 | #EXTRALDFLAGS = -Wl,--relax 143 | 144 | # Search Path 145 | VPATH += $(TARGET_DIR) 146 | VPATH += $(TMK_DIR) 147 | 148 | include $(TMK_DIR)/protocol/lufa.mk 149 | include $(TMK_DIR)/common.mk 150 | include $(TMK_DIR)/rules_online.mk 151 | -------------------------------------------------------------------------------- /compiler/Makefile.kb84: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------------------- 2 | # On command line: 3 | # 4 | # make all = Make software. 5 | # 6 | # make clean = Clean out built project files. 7 | # 8 | # make coff = Convert ELF to AVR COFF. 9 | # 10 | # make extcoff = Convert ELF to AVR Extended COFF. 11 | # 12 | # make program = Download the hex file to the device. 13 | # Please customize your programmer settings(PROGRAM_CMD) 14 | # 15 | # make teensy = Download the hex file to the device, using teensy_loader_cli. 16 | # (must have teensy_loader_cli installed). 17 | # 18 | # make dfu = Download the hex file to the device, using dfu-programmer (must 19 | # have dfu-programmer installed). 20 | # 21 | # make flip = Download the hex file to the device, using Atmel FLIP (must 22 | # have Atmel FLIP installed). 23 | # 24 | # make dfu-ee = Download the eeprom file to the device, using dfu-programmer 25 | # (must have dfu-programmer installed). 26 | # 27 | # make flip-ee = Download the eeprom file to the device, using Atmel FLIP 28 | # (must have Atmel FLIP installed). 29 | # 30 | # make debug = Start either simulavr or avarice as specified for debugging, 31 | # with avr-gdb or avr-insight as the front end for debugging. 32 | # 33 | # make filename.s = Just compile filename.c into the assembler code only. 34 | # 35 | # make filename.i = Create a preprocessed source file for use in submitting 36 | # bug reports to the GCC project. 37 | # 38 | # To rebuild project do "make clean" then "make all". 39 | #---------------------------------------------------------------------------- 40 | # Target file name (without extension). 41 | TARGET = kb84_temp 42 | 43 | # Directory common source filess exist 44 | TMK_DIR = ../compiler/tmk_keyboard/tmk_core 45 | 46 | # Directory keyboard dependent files exist 47 | TARGET_DIR = ../compiler/tmk_keyboard 48 | 49 | # project specific files 50 | SRC = $(TARGET_DIR)/keyboard/kb84/keymap_common.c \ 51 | $(TARGET_DIR)/keyboard/kb84/matrix.c \ 52 | $(TARGET_DIR)/keyboard/kb84/led.c \ 53 | $(TARGET_DIR)/keyboard/kb84/backlight.c 54 | 55 | ifdef KEYMAP 56 | SRC := $(KEYMAP) $(SRC) 57 | else 58 | SRC := $(TARGET_DIR)/keyboard/kb84/keymap_default.c $(SRC) 59 | endif 60 | 61 | ifdef CONF 62 | CONFIG_H = $(CONF) 63 | else 64 | CONFIG_H = $(TARGET_DIR)/keyboard/kb84/config.h 65 | endif 66 | 67 | ifdef HEXFILE 68 | HEXFILE = $(HEXFILE) 69 | else 70 | HEXFILE = ./kb84_lufa.hex 71 | endif 72 | 73 | ifdef BINFILE 74 | BINFILE = $(BINFILE) 75 | else 76 | BINFILE = ./kb84_lufa.bin 77 | endif 78 | 79 | # MCU name 80 | #MCU = at90usb1287 81 | MCU = atmega32u4 82 | 83 | # Processor frequency. 84 | # This will define a symbol, F_CPU, in all source code files equal to the 85 | # processor frequency in Hz. You can then use this symbol in your source code to 86 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done 87 | # automatically to create a 32-bit value in your source code. 88 | # 89 | # This will be an integer division of F_USB below, as it is sourced by 90 | # F_USB after it has run through any CPU prescalers. Note that this value 91 | # does not *change* the processor frequency - it should merely be updated to 92 | # reflect the processor speed set externally so that the code can use accurate 93 | # software delays. 94 | F_CPU = 16000000 95 | 96 | 97 | # 98 | # LUFA specific 99 | # 100 | # Target architecture (see library "Board Types" documentation). 101 | ARCH = AVR8 102 | 103 | # Input clock frequency. 104 | # This will define a symbol, F_USB, in all source code files equal to the 105 | # input clock frequency (before any prescaling is performed) in Hz. This value may 106 | # differ from F_CPU if prescaling is used on the latter, and is required as the 107 | # raw input clock is fed directly to the PLL sections of the AVR for high speed 108 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' 109 | # at the end, this will be done automatically to create a 32-bit value in your 110 | # source code. 111 | # 112 | # If no clock division is performed on the input clock inside the AVR (via the 113 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. 114 | F_USB = $(F_CPU) 115 | 116 | # Interrupt driven control endpoint task(+60) 117 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT 118 | 119 | 120 | # Boot Section Size in *bytes* 121 | # Teensy halfKay 512 122 | # Teensy++ halfKay 1024 123 | # Atmel DFU loader 4096 124 | # LUFA bootloader 4096 125 | # USBaspLoader 2048 126 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 127 | 128 | 129 | # Build Options 130 | # comment out to disable the options. 131 | # 132 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) 133 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 134 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 135 | #CONSOLE_ENABLE = yes # Console for debug(+400) 136 | COMMAND_ENABLE = yes # Commands for debug and configuration 137 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 138 | NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA 139 | BACKLIGHT_ENABLE = yes 140 | 141 | # Optimize size but this may cause error "relocation truncated to fit" 142 | #EXTRALDFLAGS = -Wl,--relax 143 | 144 | # Search Path 145 | VPATH += $(TARGET_DIR) 146 | VPATH += $(TMK_DIR) 147 | 148 | include $(TMK_DIR)/protocol/lufa.mk 149 | include $(TMK_DIR)/common.mk 150 | include $(TMK_DIR)/rules_online.mk 151 | -------------------------------------------------------------------------------- /compiler/Makefile.kb60: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------------------- 2 | # On command line: 3 | # 4 | # make all = Make software. 5 | # 6 | # make clean = Clean out built project files. 7 | # 8 | # make coff = Convert ELF to AVR COFF. 9 | # 10 | # make extcoff = Convert ELF to AVR Extended COFF. 11 | # 12 | # make program = Download the hex file to the device. 13 | # Please customize your programmer settings(PROGRAM_CMD) 14 | # 15 | # make teensy = Download the hex file to the device, using teensy_loader_cli. 16 | # (must have teensy_loader_cli installed). 17 | # 18 | # make dfu = Download the hex file to the device, using dfu-programmer (must 19 | # have dfu-programmer installed). 20 | # 21 | # make flip = Download the hex file to the device, using Atmel FLIP (must 22 | # have Atmel FLIP installed). 23 | # 24 | # make dfu-ee = Download the eeprom file to the device, using dfu-programmer 25 | # (must have dfu-programmer installed). 26 | # 27 | # make flip-ee = Download the eeprom file to the device, using Atmel FLIP 28 | # (must have Atmel FLIP installed). 29 | # 30 | # make debug = Start either simulavr or avarice as specified for debugging, 31 | # with avr-gdb or avr-insight as the front end for debugging. 32 | # 33 | # make filename.s = Just compile filename.c into the assembler code only. 34 | # 35 | # make filename.i = Create a preprocessed source file for use in submitting 36 | # bug reports to the GCC project. 37 | # 38 | # To rebuild project do "make clean" then "make all". 39 | #---------------------------------------------------------------------------- 40 | 41 | # Target file name (without extension). 42 | TARGET = kb60_temp 43 | 44 | # Directory common source filess exist 45 | TMK_DIR = ../compiler/tmk_keyboard/tmk_core 46 | 47 | # Directory keyboard dependent files exist 48 | TARGET_DIR = ../compiler/tmk_keyboard 49 | 50 | # project specific files 51 | SRC = $(TARGET_DIR)/keyboard/kb60/keymap_common.c \ 52 | $(TARGET_DIR)/keyboard/kb60/matrix.c \ 53 | $(TARGET_DIR)/keyboard/kb60/led.c \ 54 | $(TARGET_DIR)/keyboard/kb60/backlight.c 55 | 56 | ifdef KEYMAP 57 | SRC := $(KEYMAP) $(SRC) 58 | else 59 | SRC := $(TARGET_DIR)/keyboard/kb60/keymap_poker2.c $(SRC) 60 | endif 61 | 62 | ifdef CONF 63 | CONFIG_H = $(CONF) 64 | else 65 | CONFIG_H = $(TARGET_DIR)/keyboard/kb60/config.h 66 | endif 67 | 68 | ifdef HEXFILE 69 | HEXFILE = $(HEXFILE) 70 | else 71 | HEXFILE = ./gh60_lufa.hex 72 | endif 73 | 74 | ifdef BINFILE 75 | BINFILE = $(BINFILE) 76 | else 77 | BINFILE = ./gh60_lufa.bin 78 | endif 79 | 80 | # MCU name 81 | #MCU = at90usb1287 82 | MCU = atmega32u4 83 | 84 | # Processor frequency. 85 | # This will define a symbol, F_CPU, in all source code files equal to the 86 | # processor frequency in Hz. You can then use this symbol in your source code to 87 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done 88 | # automatically to create a 32-bit value in your source code. 89 | # 90 | # This will be an integer division of F_USB below, as it is sourced by 91 | # F_USB after it has run through any CPU prescalers. Note that this value 92 | # does not *change* the processor frequency - it should merely be updated to 93 | # reflect the processor speed set externally so that the code can use accurate 94 | # software delays. 95 | F_CPU = 16000000 96 | 97 | 98 | # 99 | # LUFA specific 100 | # 101 | # Target architecture (see library "Board Types" documentation). 102 | ARCH = AVR8 103 | 104 | # Input clock frequency. 105 | # This will define a symbol, F_USB, in all source code files equal to the 106 | # input clock frequency (before any prescaling is performed) in Hz. This value may 107 | # differ from F_CPU if prescaling is used on the latter, and is required as the 108 | # raw input clock is fed directly to the PLL sections of the AVR for high speed 109 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' 110 | # at the end, this will be done automatically to create a 32-bit value in your 111 | # source code. 112 | # 113 | # If no clock division is performed on the input clock inside the AVR (via the 114 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. 115 | F_USB = $(F_CPU) 116 | 117 | # Interrupt driven control endpoint task(+60) 118 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT 119 | 120 | 121 | # Boot Section Size in *bytes* 122 | # Teensy halfKay 512 123 | # Teensy++ halfKay 1024 124 | # Atmel DFU loader 4096 125 | # LUFA bootloader 4096 126 | # USBaspLoader 2048 127 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 128 | 129 | 130 | # Build Options 131 | # comment out to disable the options. 132 | # 133 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) 134 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 135 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 136 | #CONSOLE_ENABLE = yes # Console for debug(+400) 137 | COMMAND_ENABLE = yes # Commands for debug and configuration 138 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 139 | NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA 140 | BACKLIGHT_ENABLE = yes 141 | 142 | # Optimize size but this may cause error "relocation truncated to fit" 143 | #EXTRALDFLAGS = -Wl,--relax 144 | 145 | # Search Path 146 | VPATH += $(TARGET_DIR) 147 | VPATH += $(TMK_DIR) 148 | 149 | include $(TMK_DIR)/protocol/lufa.mk 150 | include $(TMK_DIR)/common.mk 151 | include $(TMK_DIR)/rules_online.mk 152 | -------------------------------------------------------------------------------- /compiler/Makefile.ble60: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------------------- 2 | # On command line: 3 | # 4 | # make all = Make software. 5 | # 6 | # make clean = Clean out built project files. 7 | # 8 | # make coff = Convert ELF to AVR COFF. 9 | # 10 | # make extcoff = Convert ELF to AVR Extended COFF. 11 | # 12 | # make program = Download the hex file to the device. 13 | # Please customize your programmer settings(PROGRAM_CMD) 14 | # 15 | # make teensy = Download the hex file to the device, using teensy_loader_cli. 16 | # (must have teensy_loader_cli installed). 17 | # 18 | # make dfu = Download the hex file to the device, using dfu-programmer (must 19 | # have dfu-programmer installed). 20 | # 21 | # make flip = Download the hex file to the device, using Atmel FLIP (must 22 | # have Atmel FLIP installed). 23 | # 24 | # make dfu-ee = Download the eeprom file to the device, using dfu-programmer 25 | # (must have dfu-programmer installed). 26 | # 27 | # make flip-ee = Download the eeprom file to the device, using Atmel FLIP 28 | # (must have Atmel FLIP installed). 29 | # 30 | # make debug = Start either simulavr or avarice as specified for debugging, 31 | # with avr-gdb or avr-insight as the front end for debugging. 32 | # 33 | # make filename.s = Just compile filename.c into the assembler code only. 34 | # 35 | # make filename.i = Create a preprocessed source file for use in submitting 36 | # bug reports to the GCC project. 37 | # 38 | # To rebuild project do "make clean" then "make all". 39 | #---------------------------------------------------------------------------- 40 | 41 | # Target file name (without extension). 42 | TARGET = ble60_temp 43 | 44 | # Directory common source filess exist 45 | TMK_DIR = ../compiler/tmk_keyboard/tmk_core 46 | 47 | # Directory keyboard dependent files exist 48 | TARGET_DIR = ../compiler/tmk_keyboard 49 | 50 | # project specific files 51 | SRC = $(TARGET_DIR)/keyboard/ble60/keymap_common.c \ 52 | $(TARGET_DIR)/keyboard/ble60/matrix.c \ 53 | $(TARGET_DIR)/keyboard/ble60/led.c \ 54 | $(TARGET_DIR)/keyboard/ble60/backlight.c \ 55 | $(TARGET_DIR)/keyboard/ble60/lufa_ble.c 56 | 57 | ifdef KEYMAP 58 | SRC := $(KEYMAP) $(SRC) 59 | else 60 | SRC := $(TARGET_DIR)/keyboard/ble60/keymap_poker2.c $(SRC) 61 | endif 62 | 63 | ifdef CONF 64 | CONFIG_H = $(CONF) 65 | else 66 | CONFIG_H = $(TARGET_DIR)/keyboard/ble60/config.h 67 | endif 68 | 69 | ifdef HEXFILE 70 | HEXFILE = $(HEXFILE) 71 | else 72 | HEXFILE = ./gh60_lufa.hex 73 | endif 74 | 75 | ifdef BINFILE 76 | BINFILE = $(BINFILE) 77 | else 78 | BINFILE = ./gh60_lufa.bin 79 | endif 80 | 81 | # MCU name 82 | #MCU = at90usb1287 83 | MCU = atmega32u4 84 | 85 | # Processor frequency. 86 | # This will define a symbol, F_CPU, in all source code files equal to the 87 | # processor frequency in Hz. You can then use this symbol in your source code to 88 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done 89 | # automatically to create a 32-bit value in your source code. 90 | # 91 | # This will be an integer division of F_USB below, as it is sourced by 92 | # F_USB after it has run through any CPU prescalers. Note that this value 93 | # does not *change* the processor frequency - it should merely be updated to 94 | # reflect the processor speed set externally so that the code can use accurate 95 | # software delays. 96 | F_CPU = 16000000 97 | 98 | 99 | # 100 | # LUFA specific 101 | # 102 | # Target architecture (see library "Board Types" documentation). 103 | ARCH = AVR8 104 | 105 | # Input clock frequency. 106 | # This will define a symbol, F_USB, in all source code files equal to the 107 | # input clock frequency (before any prescaling is performed) in Hz. This value may 108 | # differ from F_CPU if prescaling is used on the latter, and is required as the 109 | # raw input clock is fed directly to the PLL sections of the AVR for high speed 110 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' 111 | # at the end, this will be done automatically to create a 32-bit value in your 112 | # source code. 113 | # 114 | # If no clock division is performed on the input clock inside the AVR (via the 115 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. 116 | F_USB = $(F_CPU) 117 | 118 | # Interrupt driven control endpoint task(+60) 119 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT 120 | 121 | 122 | # Boot Section Size in *bytes* 123 | # Teensy halfKay 512 124 | # Teensy++ halfKay 1024 125 | # Atmel DFU loader 4096 126 | # LUFA bootloader 4096 127 | # USBaspLoader 2048 128 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 129 | 130 | 131 | # Build Options 132 | # comment out to disable the options. 133 | # 134 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) 135 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 136 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 137 | #CONSOLE_ENABLE = yes # Console for debug(+400) 138 | COMMAND_ENABLE = yes # Commands for debug and configuration 139 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 140 | #NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA 141 | BACKLIGHT_ENABLE = yes 142 | 143 | # Optimize size but this may cause error "relocation truncated to fit" 144 | #EXTRALDFLAGS = -Wl,--relax 145 | 146 | # Search Path 147 | VPATH += $(TARGET_DIR) 148 | VPATH += $(TMK_DIR) 149 | 150 | include $(TMK_DIR)/protocol/lufa_ble.mk 151 | include $(TMK_DIR)/common.mk 152 | include $(TMK_DIR)/rules_online.mk 153 | -------------------------------------------------------------------------------- /test/epbt75.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | 0, 4 | 0 5 | ], 6 | [ 7 | [ 8 | [ 9 | [ 10 | "KC_ESC" 11 | ], 12 | [ 13 | "KC_F1" 14 | ], 15 | [ 16 | "KC_F2" 17 | ], 18 | [ 19 | "KC_F3" 20 | ], 21 | [ 22 | "KC_F4" 23 | ], 24 | [ 25 | "KC_F5" 26 | ], 27 | [ 28 | "KC_F6" 29 | ], 30 | [ 31 | "KC_F7" 32 | ], 33 | [ 34 | "KC_F8" 35 | ], 36 | [ 37 | "KC_F9" 38 | ], 39 | [ 40 | "KC_F10" 41 | ], 42 | [ 43 | "KC_F11" 44 | ], 45 | [ 46 | "KC_F12" 47 | ], 48 | [ 49 | "KC_A" 50 | ], 51 | [ 52 | "KC_B" 53 | ], 54 | [ 55 | "KC_C" 56 | ] 57 | ], 58 | [ 59 | [ 60 | "KC_1" 61 | ], 62 | [ 63 | "KC_1" 64 | ], 65 | [ 66 | "KC_2" 67 | ], 68 | [ 69 | "KC_3" 70 | ], 71 | [ 72 | "KC_4" 73 | ], 74 | [ 75 | "KC_5" 76 | ], 77 | [ 78 | "KC_6" 79 | ], 80 | [ 81 | "KC_7" 82 | ], 83 | [ 84 | "KC_8" 85 | ], 86 | [ 87 | "KC_9" 88 | ], 89 | [ 90 | "KC_0" 91 | ], 92 | [ 93 | "KC_MINS" 94 | ], 95 | [ 96 | "KC_EQL" 97 | ], 98 | [ 99 | "KC_BSPC" 100 | ], 101 | [ 102 | "KC_0" 103 | ] 104 | ], 105 | [ 106 | [ 107 | "KC_TAB" 108 | ], 109 | [ 110 | "KC_Q" 111 | ], 112 | [ 113 | "KC_W" 114 | ], 115 | [ 116 | "KC_E" 117 | ], 118 | [ 119 | "KC_R" 120 | ], 121 | [ 122 | "KC_T" 123 | ], 124 | [ 125 | "KC_Y" 126 | ], 127 | [ 128 | "KC_U" 129 | ], 130 | [ 131 | "KC_I" 132 | ], 133 | [ 134 | "KC_O" 135 | ], 136 | [ 137 | "KC_P" 138 | ], 139 | [ 140 | "KC_LBRC" 141 | ], 142 | [ 143 | "KC_RBRC" 144 | ], 145 | [ 146 | "KC_BSLS" 147 | ], 148 | [ 149 | "KC_BSLS" 150 | ] 151 | ], 152 | [ 153 | [ 154 | "KC_CAPS" 155 | ], 156 | [ 157 | "KC_A" 158 | ], 159 | [ 160 | "KC_S" 161 | ], 162 | [ 163 | "KC_D" 164 | ], 165 | [ 166 | "KC_F" 167 | ], 168 | [ 169 | "KC_G" 170 | ], 171 | [ 172 | "KC_H" 173 | ], 174 | [ 175 | "KC_J" 176 | ], 177 | [ 178 | "KC_K" 179 | ], 180 | [ 181 | "KC_L" 182 | ], 183 | [ 184 | "KC_SCLN" 185 | ], 186 | [ 187 | "KC_QUOT" 188 | ], 189 | [ 190 | "KC_ENT" 191 | ], 192 | [ 193 | "KC_ENT" 194 | ] 195 | ], 196 | [ 197 | [ 198 | "KC_LSFT" 199 | ], 200 | [ 201 | "KC_Z" 202 | ], 203 | [ 204 | "KC_X" 205 | ], 206 | [ 207 | "KC_C" 208 | ], 209 | [ 210 | "KC_V" 211 | ], 212 | [ 213 | "KC_B" 214 | ], 215 | [ 216 | "KC_N" 217 | ], 218 | [ 219 | "KC_M" 220 | ], 221 | [ 222 | "KC_COMM" 223 | ], 224 | [ 225 | "KC_DOT" 226 | ], 227 | [ 228 | "KC_SLSH" 229 | ], 230 | [ 231 | "KC_RSFT" 232 | ], 233 | [ 234 | "KC_RSFT" 235 | ], 236 | [ 237 | "KC_RSFT" 238 | ] 239 | ], 240 | [ 241 | [ 242 | "KC_LCTRL" 243 | ], 244 | [ 245 | "KC_LGUI" 246 | ], 247 | [ 248 | "KC_LALT" 249 | ], 250 | [ 251 | "KC_SPC" 252 | ], 253 | [ 254 | "KC_RALT" 255 | ], 256 | [ 257 | "KC_RGUI" 258 | ], 259 | [ 260 | "" 261 | ], 262 | [ 263 | "KC_RCTRL" 264 | ], 265 | [ 266 | "KC_RCTRL" 267 | ], 268 | [ 269 | "KC_RCTRL" 270 | ] 271 | ] 272 | ] 273 | ], 274 | "epbt75", 275 | "1.2", 276 | "hex" 277 | ] -------------------------------------------------------------------------------- /test/initdb.js: -------------------------------------------------------------------------------- 1 | var sqlite3 = require('sqlite3').verbose(); 2 | var databaseFile='keymap.db'; 3 | var db = new sqlite3.Database(databaseFile); 4 | var fs = require('fs'); 5 | var defaultKeymap_epbt60='[[0,0,0,0,0],[[[["KC_SFT_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[[""],[""],["KC_UP"],[""],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],[""]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"epbt60","1.2"]'; 6 | var defaultKeymap_ble60='[[0,0,0,0,0],[[[["KC_SFT_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[["KC_TRNS"],["KC_BT_MODE"],["KC_UP"],["KC_BT_PAIR"],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],["KC_BT_NAME"]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"ble60","1.2"]'; 7 | var defaultKeymap_kc60='[[0,0,0,0,0],[[[["KC_SFT_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[[""],[""],["KC_UP"],[""],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],[""]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"kc60","1.2"]'; 8 | var defaultKeymap_diyso60='[[0,0,0,0,0],[[[["KC_SFT_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[[""],[""],["KC_UP"],[""],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],[""]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"diyso60","1.2"]'; 9 | 10 | if(fs.existsSync(databaseFile)){ 11 | console.log('please delete db'); 12 | return; 13 | } 14 | 15 | db.serialize(function() { 16 | db.run("CREATE TABLE keymaps(key VARCHAR(32) primary key,kbtype VARCHAR(32), keymap text)"); 17 | 18 | 19 | db.run("insert into keymaps values('diyso60','diyso60','"+defaultKeymap_diyso60+"')"); 20 | db.run("insert into keymaps values('kc60','kc60','"+defaultKeymap_kc60+"')"); 21 | db.run("insert into keymaps values('epbt60','epbt60','"+defaultKeymap_epbt60+"')"); 22 | db.run("insert into keymaps values('ble60','ble60','"+defaultKeymap_ble60+"')"); 23 | db.run("insert into keymaps values('default','ble60','"+defaultKeymap_ble60+"')"); 24 | }); 25 | 26 | db.close(); 27 | 28 | //insert into keymaps values('default','epbt60', '[[0,0,0,0,0],[[[["KC_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[[""],[""],["KC_UP"],[""],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],[""]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"epbt60","1.2"]'); -------------------------------------------------------------------------------- /test/initdb_kc60.js: -------------------------------------------------------------------------------- 1 | var sqlite3 = require('sqlite3').verbose(); 2 | var databaseFile='keymap.db'; 3 | var db = new sqlite3.Database(databaseFile); 4 | var fs = require('fs'); 5 | var defaultKeymap_epbt60='[[0,0,0,0,0],[[[["KC_SFT_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[[""],[""],["KC_UP"],[""],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],[""]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"epbt60","1.2"]'; 6 | var defaultKeymap_ble60='[[0,0,0,0,0],[[[["KC_SFT_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[["KC_TRNS"],["KC_BT_MODE"],["KC_UP"],["KC_BT_PAIR"],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],["KC_BT_NAME"]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"ble60","1.2"]'; 7 | var defaultKeymap_kc60='[[0,0,0,0,0],[[[["KC_SFT_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[[""],[""],["KC_UP"],[""],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],[""]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"kc60","1.2"]'; 8 | //var defaultKeymap_diyso60='[[0,0,0,0,0],[[[["KC_SFT_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[[""],[""],["KC_UP"],[""],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],[""]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"diyso60","1.2"]'; 9 | var defaultKeymap_epbt60v2='[[0,0,0,0,0],[[[["KC_SFT_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[[""],[""],["KC_UP"],[""],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],[""]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"epbt60v2","1.2"]'; 10 | 11 | 12 | 13 | db.serialize(function() { 14 | //db.run("CREATE TABLE keymaps(key VARCHAR(32) primary key,kbtype VARCHAR(32), keymap text)"); 15 | //db.run("delete from keymaps where key='diyso60'"); 16 | db.run("insert into keymaps values('diyso60','diyso60','"+defaultKeymap_diyso60+"')"); 17 | db.run("insert into keymaps values('epbt60v2','epbt60v2','"+defaultKeymap_epbt60v2+"')"); 18 | //db.run("insert into keymaps values('ble60','ble60','"+defaultKeymap_ble60+"')"); 19 | //db.run("insert into keymaps values('default','ble60','"+defaultKeymap_ble60+"')"); 20 | }); 21 | 22 | db.close(); 23 | 24 | //insert into keymaps values('default','epbt60', '[[0,0,0,0,0],[[[["KC_ESC"],["KC_1"],["KC_2"],["KC_3"],["KC_4"],["KC_5"],["KC_6"],["KC_7"],["KC_8"],["KC_9"],["KC_0"],["KC_MINS"],["KC_EQL"],["KC_BSPC"]],[["KC_TAB"],["KC_Q"],["KC_W"],["KC_E"],["KC_R"],["KC_T"],["KC_Y"],["KC_U"],["KC_I"],["KC_O"],["KC_P"],["KC_LBRC"],["KC_RBRC"],["KC_BSLS"]],[["KC_CAPS"],["KC_A"],["KC_S"],["KC_D"],["KC_F"],["KC_G"],["KC_H"],["KC_J"],["KC_K"],["KC_L"],["KC_SCLN"],["KC_QUOT"],["KC_ENT"]],[["KC_LSFT"],["KC_Z"],["KC_X"],["KC_C"],["KC_V"],["KC_B"],["KC_N"],["KC_M"],["KC_COMM"],["KC_DOT"],["KC_SLSH"],["KC_RSFT"]],[["KC_LCTRL"],["KC_LGUI"],["KC_LALT"],["KC_SPC"],["KC_RALT"],["KC_RGUI"],["KC_FN",[1,[1]]],["KC_RCTRL"]]],[[["KC_GRV"],["KC_F1"],["KC_F2"],["KC_F3"],["KC_F4"],["KC_F5"],["KC_F6"],["KC_F7"],["KC_F8"],["KC_F9"],["KC_F10"],["KC_F11"],["KC_F12"],["KC_DEL"]],[[""],[""],["KC_UP"],[""],[""],[""],["KC_CALC"],[""],["KC_INS"],[""],["KC_PSCR"],["KC_SLCK"],["KC_PAUS"],[""]],[[""],["KC_LEFT"],["KC_DOWN"],["KC_RGHT"],[""],[""],[""],[""],[""],[""],["KC_HOME"],["KC_PGUP"],[""]],[[""],[""],["KC_APP"],["KC_LED_DE"],["KC_LED_TOGGLE"],["KC_LED_IN"],["KC_VOLD"],["KC_VOLU"],["KC_MUTE"],["KC_END"],["KC_PGDN"],[""]],[[""],[""],[""],["KC_FN",[2,[2,1]]],[""],[""],[""],[""]]],[[[""],[""],[""],[""],[""],[""],[""],["KC_P7"],["KC_P8"],["KC_P9"],[""],["KC_PMNS"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P4"],["KC_P5"],["KC_P6"],[""],["KC_PENT"],[""],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P1"],["KC_P2"],["KC_P3"],["KC_PPLS"],["KC_PAST"],[""]],[[""],[""],[""],[""],[""],[""],[""],["KC_P0"],["KC_PCMM"],["KC_PDOT"],["KC_PSLS"],[""]],[[""],[""],[""],["KC_FN",[3,[2,1]]],[""],[""],[""],[""]]]],"epbt60","1.2"]'); -------------------------------------------------------------------------------- /test/kc60/create_keymap.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var Config = require('./config.json'); 3 | var FnType = require('./fntype.json'); 4 | var KeycodeToKey = require('./keycodeToKey.json'); 5 | var numToStr=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G']; 6 | var row=Config.row; 7 | var col=Config.col; 8 | var kbType='KC60'; 9 | var corePath='kc60'; 10 | 11 | function create_keymap_file(data) 12 | { 13 | var ret={}; 14 | var keymap_Data=''; 15 | var i,j,k; 16 | var layout=data[0]; 17 | var layers=data[1]; 18 | var fnArr=[]; 19 | var macroArr=[]; 20 | var matrix=handle_matrix(layout); 21 | if(checkError(matrix,layers)){ 22 | ret.status='error'; 23 | ret.msg='checkerror'; 24 | return ret; 25 | } 26 | try 27 | { 28 | keymap_Data += '// Generated by Online_Complier\n'; 29 | keymap_Data += '#include "../tmk_keyboard/keyboard/'+corePath+'/keymap_common.h"\n\n'; 30 | keymap_Data += keymap_common(matrix); 31 | keymap_Data += keymap_layer(matrix,layers,fnArr,macroArr); 32 | keymap_Data += keymap_speicalKey(); 33 | var fnStr = handleFunction(fnArr,macroArr); 34 | var macroStr = handleMacro(macroArr); 35 | keymap_Data += macroStr; 36 | keymap_Data += fnStr; 37 | } 38 | catch(e){ 39 | ret.status='error'; 40 | ret.msg='checkerror2'; 41 | return ret; 42 | } 43 | 44 | ret.keymap_Data=keymap_Data; 45 | return ret; 46 | } 47 | 48 | function handleMacro(macroArr) 49 | { 50 | if(macroArr.length<=0){ 51 | return ''; 52 | } 53 | var ret = 'enum macro_id {\n'; 54 | var i=0; 55 | ret+=tableStr(4); 56 | for(i=0;ievent.pressed ? MACRO('; 65 | if(!macroArr[i].length){ 66 | continue; 67 | } 68 | for(var j=0;j0){ 136 | fnOutArr[i].args[0]=modArr.join(' | '); 137 | }else{ 138 | fnOutArr[i].action=FnType.fntype[0].action; 139 | fnOutArr[i].args=['KC_NO']; 140 | } 141 | } 142 | else if(fncfg.type==5){ 143 | modArr=mod(fndata[0],fndata[1],fndata[2],fndata[3]); 144 | if(modArr.length>0){ 145 | fnOutArr[i].args[0]=modArr.join(' | '); 146 | fnOutArr[i].args[1]=fndata[4]?fndata[4]:'KC_NO'; 147 | }else{ 148 | fnOutArr[i].action=FnType.fntype[0].action; 149 | fnOutArr[i].args[0]=fndata[4]?fndata[4]:'KC_NO'; 150 | } 151 | } 152 | else if(fncfg.type==6){ 153 | fnOutArr[i].args[0]=on[fndata[0]]; 154 | } 155 | else if(fncfg.type==7){ 156 | fnOutArr[i].args[0]='macro_'+pushMacroData(fndata,macroArr); 157 | } 158 | } 159 | else{ 160 | fnOutArr[i].action='ACTION_NO'; 161 | fnOutArr[i].args=[]; 162 | } 163 | } 164 | for(i=0;ievent.pressed) {\n'; 183 | ret+=tableStr(16)+'if (shift_esc_shift_mask) {\n'; 184 | ret+=tableStr(20)+'add_key(KC_GRV);\n'; 185 | ret+=tableStr(16)+'} else {\n'; 186 | ret+=tableStr(20)+'add_key(KC_ESC);\n'; 187 | ret+=tableStr(16)+'}\n'; 188 | ret+=tableStr(12)+'} else {\n'; 189 | ret+=tableStr(14)+'if (shift_esc_shift_mask) {\n'; 190 | ret+=tableStr(20)+'del_key(KC_GRV);\n'; 191 | ret+=tableStr(16)+'} else {\n'; 192 | ret+=tableStr(20)+'del_key(KC_ESC);\n'; 193 | ret+=tableStr(16)+'}\n'; 194 | ret+=tableStr(12)+'}\n'; 195 | ret+=tableStr(12)+'send_keyboard_report();\n'; 196 | ret+=tableStr(12)+'break;\n'; 197 | ret+=tableStr(4)+'}\n'; 198 | ret+='}\n\n'; 199 | return ret; 200 | } 201 | 202 | function handleKey(key,fnArr,macroArr) 203 | { 204 | 205 | var pkey; 206 | if(key[0]==''){ 207 | pkey='TRNS'; 208 | } 209 | else if(key[0]=='KC_FN'){ 210 | pkey='FN'+pushFnData(key[1],fnArr,macroArr); 211 | } 212 | else if(FnType.fntype_sp[key[0]]){ 213 | pkey='FN'+pushFnData(key[0],fnArr,macroArr); 214 | } 215 | else{ 216 | pkey=getkey(key[0]); 217 | } 218 | return pkey; 219 | } 220 | 221 | function pushFnData(fnData,fnArr) 222 | { 223 | var ret=-1; 224 | for(var i=0;i=32){ 236 | ret = 0; 237 | } 238 | return ret; 239 | } 240 | function pushMacroData(macroData,macroArr) 241 | { 242 | var ret=-1; 243 | for(var i=0;i=32){ 255 | ret = 0; 256 | } 257 | return ret; 258 | } 259 | function keymap_layer(matrix,layers,fnArr,macroArr) 260 | { 261 | var ret='const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n\n'; 262 | var rows; 263 | var mlayers=[]; 264 | var layer; 265 | var i,j,k; 266 | var keymapCommonArr=[]; 267 | var rows; 268 | for(i=0;ievent.pressed ? MACRO('; 65 | if(!macroArr[i].length){ 66 | continue; 67 | } 68 | for(var j=0;j0){ 136 | fnOutArr[i].args[0]=modArr.join(' | '); 137 | }else{ 138 | fnOutArr[i].action=FnType.fntype[0].action; 139 | fnOutArr[i].args=['KC_NO']; 140 | } 141 | } 142 | else if(fncfg.type==5){ 143 | modArr=mod(fndata[0],fndata[1],fndata[2],fndata[3]); 144 | if(modArr.length>0){ 145 | fnOutArr[i].args[0]=modArr.join(' | '); 146 | fnOutArr[i].args[1]=fndata[4]?fndata[4]:'KC_NO'; 147 | }else{ 148 | fnOutArr[i].action=FnType.fntype[0].action; 149 | fnOutArr[i].args[0]=fndata[4]?fndata[4]:'KC_NO'; 150 | } 151 | } 152 | else if(fncfg.type==6){ 153 | fnOutArr[i].args[0]=on[fndata[0]]; 154 | } 155 | else if(fncfg.type==7){ 156 | fnOutArr[i].args[0]='macro_'+pushMacroData(fndata,macroArr); 157 | } 158 | } 159 | else{ 160 | fnOutArr[i].action='ACTION_NO'; 161 | fnOutArr[i].args=[]; 162 | } 163 | } 164 | for(i=0;ievent.pressed) {\n'; 183 | ret+=tableStr(16)+'if (shift_esc_shift_mask) {\n'; 184 | ret+=tableStr(20)+'add_key(KC_GRV);\n'; 185 | ret+=tableStr(16)+'} else {\n'; 186 | ret+=tableStr(20)+'add_key(KC_ESC);\n'; 187 | ret+=tableStr(16)+'}\n'; 188 | ret+=tableStr(12)+'} else {\n'; 189 | ret+=tableStr(14)+'if (shift_esc_shift_mask) {\n'; 190 | ret+=tableStr(20)+'del_key(KC_GRV);\n'; 191 | ret+=tableStr(16)+'} else {\n'; 192 | ret+=tableStr(20)+'del_key(KC_ESC);\n'; 193 | ret+=tableStr(16)+'}\n'; 194 | ret+=tableStr(12)+'}\n'; 195 | ret+=tableStr(12)+'send_keyboard_report();\n'; 196 | ret+=tableStr(12)+'break;\n'; 197 | ret+=tableStr(4)+'}\n'; 198 | ret+='}\n\n'; 199 | return ret; 200 | } 201 | 202 | function handleKey(key,fnArr,macroArr) 203 | { 204 | 205 | var pkey; 206 | if(key[0]==''){ 207 | pkey='TRNS'; 208 | } 209 | else if(key[0]=='KC_FN'){ 210 | pkey='FN'+pushFnData(key[1],fnArr,macroArr); 211 | } 212 | else if(FnType.fntype_sp[key[0]]){ 213 | pkey='FN'+pushFnData(key[0],fnArr,macroArr); 214 | } 215 | else{ 216 | pkey=getkey(key[0]); 217 | } 218 | return pkey; 219 | } 220 | 221 | function pushFnData(fnData,fnArr) 222 | { 223 | var ret=-1; 224 | for(var i=0;i=32){ 236 | ret = 0; 237 | } 238 | return ret; 239 | } 240 | function pushMacroData(macroData,macroArr) 241 | { 242 | var ret=-1; 243 | for(var i=0;i=32){ 255 | ret = 0; 256 | } 257 | return ret; 258 | } 259 | function keymap_layer(matrix,layers,fnArr,macroArr) 260 | { 261 | var ret='const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n\n'; 262 | var rows; 263 | var mlayers=[]; 264 | var layer; 265 | var i,j,k; 266 | var keymapCommonArr=[]; 267 | var rows; 268 | for(i=0;i= 2 && hash.charAt(0) == "?") { 185 | hash = hash.substring(1); 186 | } 187 | return hash; 188 | } 189 | 190 | /* Get the current location hash excluding the '#' symbol. */ 191 | function getHash() { 192 | // It would be nice if we could use document.location.hash here, 193 | // but it's faulty sometimes. 194 | var idx = document.location.href.indexOf('#'); 195 | return (idx >= 0) ? document.location.href.substr(idx+1) : ''; 196 | } 197 | 198 | /* Get the current location hash excluding the '#' symbol. */ 199 | function setHash(hash) { 200 | // It would be nice if we could use document.location.hash here, 201 | // but it's faulty sometimes. 202 | if (hash == '') hash = '#' 203 | document.location.hash = hash; 204 | } 205 | 206 | function createState(baseUrl, newUrl, flexAppUrl) { 207 | return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null }; 208 | } 209 | 210 | /* Add a history entry to the browser. 211 | * baseUrl: the portion of the location prior to the '#' 212 | * newUrl: the entire new URL, including '#' and following fragment 213 | * flexAppUrl: the portion of the location following the '#' only 214 | */ 215 | function addHistoryEntry(baseUrl, newUrl, flexAppUrl) { 216 | 217 | //delete all the history entries 218 | forwardStack = []; 219 | 220 | if (browser.ie) { 221 | //Check to see if we are being asked to do a navigate for the first 222 | //history entry, and if so ignore, because it's coming from the creation 223 | //of the history iframe 224 | if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) { 225 | currentHref = initialHref; 226 | return; 227 | } 228 | if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) { 229 | newUrl = baseUrl + '#' + defaultHash; 230 | flexAppUrl = defaultHash; 231 | } else { 232 | // for IE, tell the history frame to go somewhere without a '#' 233 | // in order to get this entry into the browser history. 234 | getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl; 235 | } 236 | setHash(flexAppUrl); 237 | } else { 238 | 239 | //ADR 240 | if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) { 241 | initialState = createState(baseUrl, newUrl, flexAppUrl); 242 | } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) { 243 | backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl); 244 | } 245 | 246 | if (browser.safari && !browserHasHashChange) { 247 | // for Safari, submit a form whose action points to the desired URL 248 | if (browser.version <= 419.3) { 249 | var file = window.location.pathname.toString(); 250 | file = file.substring(file.lastIndexOf("/")+1); 251 | getFormElement().innerHTML = '
'; 252 | //get the current elements and add them to the form 253 | var qs = window.location.search.substring(1); 254 | var qs_arr = qs.split("&"); 255 | for (var i = 0; i < qs_arr.length; i++) { 256 | var tmp = qs_arr[i].split("="); 257 | var elem = document.createElement("input"); 258 | elem.type = "hidden"; 259 | elem.name = tmp[0]; 260 | elem.value = tmp[1]; 261 | document.forms.historyForm.appendChild(elem); 262 | } 263 | document.forms.historyForm.submit(); 264 | } else { 265 | top.location.hash = flexAppUrl; 266 | } 267 | // We also have to maintain the history by hand for Safari 268 | historyHash[history.length] = flexAppUrl; 269 | _storeStates(); 270 | } else { 271 | // Otherwise, just tell the browser to go there 272 | setHash(flexAppUrl); 273 | } 274 | } 275 | backStack.push(createState(baseUrl, newUrl, flexAppUrl)); 276 | } 277 | 278 | function _storeStates() { 279 | if (browser.safari) { 280 | getRememberElement().value = historyHash.join(","); 281 | } 282 | } 283 | 284 | function handleBackButton() { 285 | //The "current" page is always at the top of the history stack. 286 | var current = backStack.pop(); 287 | if (!current) { return; } 288 | var last = backStack[backStack.length - 1]; 289 | if (!last && backStack.length == 0){ 290 | last = initialState; 291 | } 292 | forwardStack.push(current); 293 | } 294 | 295 | function handleForwardButton() { 296 | //summary: private method. Do not call this directly. 297 | 298 | var last = forwardStack.pop(); 299 | if (!last) { return; } 300 | backStack.push(last); 301 | } 302 | 303 | function handleArbitraryUrl() { 304 | //delete all the history entries 305 | forwardStack = []; 306 | } 307 | 308 | /* Called periodically to poll to see if we need to detect navigation that has occurred */ 309 | function checkForUrlChange() { 310 | 311 | if (browser.ie) { 312 | if (currentHref != document.location.href && currentHref + '#' != document.location.href) { 313 | //This occurs when the user has navigated to a specific URL 314 | //within the app, and didn't use browser back/forward 315 | //IE seems to have a bug where it stops updating the URL it 316 | //shows the end-user at this point, but programatically it 317 | //appears to be correct. Do a full app reload to get around 318 | //this issue. 319 | if (browser.version < 7) { 320 | currentHref = document.location.href; 321 | document.location.reload(); 322 | } else { 323 | if (getHash() != getIframeHash()) { 324 | // this.iframe.src = this.blankURL + hash; 325 | var sourceToSet = historyFrameSourcePrefix + getHash(); 326 | getHistoryFrame().src = sourceToSet; 327 | currentHref = document.location.href; 328 | } 329 | } 330 | } 331 | } 332 | 333 | if (browser.safari && !browserHasHashChange) { 334 | // For Safari, we have to check to see if history.length changed. 335 | if (currentHistoryLength >= 0 && history.length != currentHistoryLength) { 336 | //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|")); 337 | var flexAppUrl = getHash(); 338 | if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */) 339 | { 340 | // If it did change and we're running Safari 3.x or earlier, 341 | // then we have to look the old state up in our hand-maintained 342 | // array since document.location.hash won't have changed, 343 | // then call back into BrowserManager. 344 | currentHistoryLength = history.length; 345 | flexAppUrl = historyHash[currentHistoryLength]; 346 | } 347 | 348 | //ADR: to fix multiple 349 | if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { 350 | var pl = getPlayers(); 351 | for (var i = 0; i < pl.length; i++) { 352 | pl[i].browserURLChange(flexAppUrl); 353 | } 354 | } else { 355 | getPlayer().browserURLChange(flexAppUrl); 356 | } 357 | _storeStates(); 358 | } 359 | } 360 | if (browser.firefox && !browserHasHashChange) { 361 | if (currentHref != document.location.href) { 362 | var bsl = backStack.length; 363 | 364 | var urlActions = { 365 | back: false, 366 | forward: false, 367 | set: false 368 | } 369 | 370 | if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) { 371 | urlActions.back = true; 372 | // FIXME: could this ever be a forward button? 373 | // we can't clear it because we still need to check for forwards. Ugg. 374 | // clearInterval(this.locationTimer); 375 | handleBackButton(); 376 | } 377 | 378 | // first check to see if we could have gone forward. We always halt on 379 | // a no-hash item. 380 | if (forwardStack.length > 0) { 381 | if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) { 382 | urlActions.forward = true; 383 | handleForwardButton(); 384 | } 385 | } 386 | 387 | // ok, that didn't work, try someplace back in the history stack 388 | if ((bsl >= 2) && (backStack[bsl - 2])) { 389 | if (backStack[bsl - 2].flexAppUrl == getHash()) { 390 | urlActions.back = true; 391 | handleBackButton(); 392 | } 393 | } 394 | 395 | if (!urlActions.back && !urlActions.forward) { 396 | var foundInStacks = { 397 | back: -1, 398 | forward: -1 399 | } 400 | 401 | for (var i = 0; i < backStack.length; i++) { 402 | if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { 403 | arbitraryUrl = true; 404 | foundInStacks.back = i; 405 | } 406 | } 407 | for (var i = 0; i < forwardStack.length; i++) { 408 | if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { 409 | arbitraryUrl = true; 410 | foundInStacks.forward = i; 411 | } 412 | } 413 | handleArbitraryUrl(); 414 | } 415 | 416 | // Firefox changed; do a callback into BrowserManager to tell it. 417 | currentHref = document.location.href; 418 | var flexAppUrl = getHash(); 419 | //ADR: to fix multiple 420 | if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { 421 | var pl = getPlayers(); 422 | for (var i = 0; i < pl.length; i++) { 423 | pl[i].browserURLChange(flexAppUrl); 424 | } 425 | } else { 426 | getPlayer().browserURLChange(flexAppUrl); 427 | } 428 | } 429 | } 430 | } 431 | 432 | var _initialize = function () { 433 | 434 | browserHasHashChange = ("onhashchange" in document.body); 435 | 436 | if (browser.ie) 437 | { 438 | var scripts = document.getElementsByTagName('script'); 439 | for (var i = 0, s; s = scripts[i]; i++) { 440 | if (s.src.indexOf("history.js") > -1) { 441 | var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html"); 442 | } 443 | } 444 | historyFrameSourcePrefix = iframe_location + "?"; 445 | var src = historyFrameSourcePrefix; 446 | 447 | var iframe = document.createElement("iframe"); 448 | iframe.id = 'ie_historyFrame'; 449 | iframe.name = 'ie_historyFrame'; 450 | iframe.src = 'javascript:false;'; 451 | 452 | try { 453 | document.body.appendChild(iframe); 454 | } catch(e) { 455 | setTimeout(function() { 456 | document.body.appendChild(iframe); 457 | }, 0); 458 | } 459 | } 460 | 461 | if (browser.safari && !browserHasHashChange) 462 | { 463 | var rememberDiv = document.createElement("div"); 464 | rememberDiv.id = 'safari_rememberDiv'; 465 | document.body.appendChild(rememberDiv); 466 | rememberDiv.innerHTML = ''; 467 | 468 | var formDiv = document.createElement("div"); 469 | formDiv.id = 'safari_formDiv'; 470 | document.body.appendChild(formDiv); 471 | 472 | var reloader_content = document.createElement('div'); 473 | reloader_content.id = 'safarireloader'; 474 | var scripts = document.getElementsByTagName('script'); 475 | for (var i = 0, s; s = scripts[i]; i++) { 476 | if (s.src.indexOf("history.js") > -1) { 477 | html = (new String(s.src)).replace(".js", ".html"); 478 | } 479 | } 480 | reloader_content.innerHTML = ''; 481 | document.body.appendChild(reloader_content); 482 | reloader_content.style.position = 'absolute'; 483 | reloader_content.style.left = reloader_content.style.top = '-9999px'; 484 | iframe = reloader_content.getElementsByTagName('iframe')[0]; 485 | 486 | if (document.getElementById("safari_remember_field").value != "" ) { 487 | historyHash = document.getElementById("safari_remember_field").value.split(","); 488 | } 489 | } 490 | 491 | if (browserHasHashChange) 492 | document.body.onhashchange = hashChangeHandler; 493 | } 494 | 495 | return { 496 | historyHash: historyHash, 497 | backStack: function() { return backStack; }, 498 | forwardStack: function() { return forwardStack }, 499 | getPlayer: getPlayer, 500 | initialize: function(src) { 501 | _initialize(src); 502 | }, 503 | setURL: function(url) { 504 | document.location.href = url; 505 | }, 506 | getURL: function() { 507 | return document.location.href; 508 | }, 509 | getTitle: function() { 510 | return document.title; 511 | }, 512 | setTitle: function(title) { 513 | try { 514 | backStack[backStack.length - 1].title = title; 515 | } catch(e) { } 516 | //if on safari, set the title to be the empty string. 517 | if (browser.safari) { 518 | if (title == "") { 519 | try { 520 | var tmp = window.location.href.toString(); 521 | title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#")); 522 | } catch(e) { 523 | title = ""; 524 | } 525 | } 526 | } 527 | document.title = title; 528 | }, 529 | setDefaultURL: function(def) 530 | { 531 | defaultHash = def; 532 | def = getHash(); 533 | //trailing ? is important else an extra frame gets added to the history 534 | //when navigating back to the first page. Alternatively could check 535 | //in history frame navigation to compare # and ?. 536 | if (browser.ie) 537 | { 538 | window['_ie_firstload'] = true; 539 | var sourceToSet = historyFrameSourcePrefix + def; 540 | var func = function() { 541 | getHistoryFrame().src = sourceToSet; 542 | window.location.replace("#" + def); 543 | setInterval(checkForUrlChange, 50); 544 | } 545 | try { 546 | func(); 547 | } catch(e) { 548 | window.setTimeout(function() { func(); }, 0); 549 | } 550 | } 551 | 552 | if (browser.safari) 553 | { 554 | currentHistoryLength = history.length; 555 | if (historyHash.length == 0) { 556 | historyHash[currentHistoryLength] = def; 557 | var newloc = "#" + def; 558 | window.location.replace(newloc); 559 | } else { 560 | //alert(historyHash[historyHash.length-1]); 561 | } 562 | setInterval(checkForUrlChange, 50); 563 | } 564 | 565 | 566 | if (browser.firefox || browser.opera) 567 | { 568 | var reg = new RegExp("#" + def + "$"); 569 | if (window.location.toString().match(reg)) { 570 | } else { 571 | var newloc ="#" + def; 572 | window.location.replace(newloc); 573 | } 574 | setInterval(checkForUrlChange, 50); 575 | } 576 | 577 | }, 578 | 579 | /* Set the current browser URL; called from inside BrowserManager to propagate 580 | * the application state out to the container. 581 | */ 582 | setBrowserURL: function(flexAppUrl, objectId) { 583 | if (browser.ie && typeof objectId != "undefined") { 584 | currentObjectId = objectId; 585 | } 586 | //fromIframe = fromIframe || false; 587 | //fromFlex = fromFlex || false; 588 | //alert("setBrowserURL: " + flexAppUrl); 589 | //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ; 590 | 591 | var pos = document.location.href.indexOf('#'); 592 | var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href; 593 | var newUrl = baseUrl + '#' + flexAppUrl; 594 | 595 | if (document.location.href != newUrl && document.location.href + '#' != newUrl) { 596 | currentHref = newUrl; 597 | addHistoryEntry(baseUrl, newUrl, flexAppUrl); 598 | currentHistoryLength = history.length; 599 | } 600 | }, 601 | 602 | browserURLChange: function(flexAppUrl) { 603 | var objectId = null; 604 | if (browser.ie && currentObjectId != null) { 605 | objectId = currentObjectId; 606 | } 607 | 608 | if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { 609 | var pl = getPlayers(); 610 | for (var i = 0; i < pl.length; i++) { 611 | try { 612 | pl[i].browserURLChange(flexAppUrl); 613 | } catch(e) { } 614 | } 615 | } else { 616 | try { 617 | getPlayer(objectId).browserURLChange(flexAppUrl); 618 | } catch(e) { } 619 | } 620 | 621 | currentObjectId = null; 622 | }, 623 | getUserAgent: function() { 624 | return navigator.userAgent; 625 | }, 626 | getPlatform: function() { 627 | return navigator.platform; 628 | } 629 | 630 | } 631 | 632 | })(); 633 | 634 | // Initialization 635 | 636 | // Automated unit testing and other diagnostics 637 | 638 | function setURL(url) 639 | { 640 | document.location.href = url; 641 | } 642 | 643 | function backButton() 644 | { 645 | history.back(); 646 | } 647 | 648 | function forwardButton() 649 | { 650 | history.forward(); 651 | } 652 | 653 | function goForwardOrBackInHistory(step) 654 | { 655 | history.go(step); 656 | } 657 | 658 | //BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); }); 659 | (function(i) { 660 | var u =navigator.userAgent;var e=/*@cc_on!@*/false; 661 | var st = setTimeout; 662 | if(/webkit/i.test(u)){ 663 | st(function(){ 664 | var dr=document.readyState; 665 | if(dr=="loaded"||dr=="complete"){i()} 666 | else{st(arguments.callee,10);}},10); 667 | } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){ 668 | document.addEventListener("DOMContentLoaded",i,false); 669 | } else if(e){ 670 | (function(){ 671 | var t=document.createElement('doc:rdy'); 672 | try{t.doScroll('left'); 673 | i();t=null; 674 | }catch(e){st(arguments.callee,0);}})(); 675 | } else{ 676 | window.onload=i; 677 | } 678 | })( function() {BrowserHistory.initialize();} ); 679 | --------------------------------------------------------------------------------