From ad24eadc876131161ba1e2a9dd9b250f4146b576 Mon Sep 17 00:00:00 2001 From: Ian Prest Date: Mon, 3 Aug 2015 23:40:42 -0400 Subject: [PATCH] Implemented keyboard 'decals' -- Intended to put decorative labels (logos, etc.) on keyboard layouts. -- They're basically just invisible keycaps; this works pretty well, since there are already so many formatting options for text on keycaps, and it saves us from having to manage a completely separate type of thing. -- Props to iandoug for the idea! Also: -- Disable x2,y2,width2,height2 on decals -- Increase max keycap size to 18x18 (allows for really large decals) --- kb.css | 7 +++++-- kb.html | 37 ++++++++++++++++++++----------------- kb.js | 11 ++++++----- samples/pkb.json | 20 ++++++++++++++++++-- serial.js | 7 +++++-- 5 files changed, 54 insertions(+), 28 deletions(-) diff --git a/kb.css b/kb.css index 71417de..10590e9 100644 --- a/kb.css +++ b/kb.css @@ -67,9 +67,12 @@ html, body { box-sizing: border-box; background-clip: padding-box; } -#keyboard .hover .keyborder { border-color: green !important; border-style: solid; } -#keyboard .selected .keyborder { border-color: red !important; border-style: solid; } +#keyboard .hover .keyborder, #keyboard .hover .decal .keyborder { border-color: green !important; border-style: solid; } +#keyboard .selected .keyborder, #keyboard .selected .decal .keyborder { border-color: red !important; border-style: solid; } #keyboard .ghosted { opacity: 0.5; } +#keyboard .decal .keyborder { border-style: none !important; background: transparent !important; } +#keyboard .hover .decal .keyborder, +#keyboard .selected .decal .keyborder { border-style: dashed !important; border-width: 1px; } /* Key labels */ .keylabel>div { display: table-cell; position: static !important; } diff --git a/kb.html b/kb.html index fa6d34f..08128d4 100644 --- a/kb.html +++ b/kb.html @@ -371,9 +371,9 @@ Nav Bar / Header
- +
/
- +
@@ -397,9 +397,9 @@ Nav Bar / Header
- +
/
- +
@@ -412,7 +412,7 @@ Nav Bar / Header data-hint="Specify the X position of the keycap. An X-offset can also be specified to indicate how non-rectangular keys should be displayed.">
+
- + @@ -425,7 +425,7 @@ Nav Bar / Header data-hint="Specify the Y position of the keycap. A Y-offset can also be specified to indicate how non-rectangular keys should be displayed.">
+
- + @@ -470,6 +470,7 @@ Nav Bar / Header Ghosted Stepped Homing + Decal @@ -918,7 +919,7 @@ Angular Templates ng-model="$parent.multi[field]" ng-change="$parent.updateMulti(field)" ng-blur="$parent.validateMulti(field)" - ng-disabled="$parent.selectedKeys.length<1" + ng-disabled="$parent.selectedKeys.length<1 || kbdDisable" style="max-width:80px"> @@ -962,20 +963,20 @@ DOT.js Templates