Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top Dual Legends #144

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion keys.scad
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ dcs_row(5) legend("⇪", size=9) key();
} */

// example layout
/* preonic_default("dcs"); */
// preonic_default("dcs") key();

// example dual top Legend row
// legend_test=[["{","["],["|","\\"],[":",";"],["?","/"],["_","-"]];
// for (x = [0:1:4]) {
// translate_u(0,-x) dsa_row() legend(legend_test[x], [0,0,6]) key();
// }

// example dual top layout
// full_size_dual_default("cherry") key();
9 changes: 8 additions & 1 deletion src/features/legends.scad
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ module keytext(text, position, font_size, depth) {
hoffset = (top_total_key_height()/3.5) * -position[1];
translate([woffset, hoffset, -depth]){
color($tertiary_color) linear_extrude(height=$dish_depth + depth){
text(text=text, font=$font, size=font_size, halign="center", valign="center");
// Allows for dual top keytext
if(is_list(text)&&len(text)==2){
translate([0, (top_total_key_height()/4.25), 0]) text(text=text[0], font=$font, size=font_size*.70, halign="center", valign="center");
translate([0, -(top_total_key_height()/4.25), 0]) text(text=text[1], font=$font, size=font_size*.70, halign="center", valign="center");
}
else {
text(text=text, font=$font, size=font_size, halign="center", valign="center");
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/key_layouts.scad
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ include <layouts/dactyl_manuform/4x6.scad>
include <layouts/dactyl_manuform/4x6_legends.scad>

include <layouts/plate.scad>

include <layouts/tkl/default.scad>
include <layouts/full_size/default.scad>
include <layouts/full_size_dual/default.scad>
61 changes: 61 additions & 0 deletions src/layouts/full_size/default.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
include <../layout.scad>

full_size_default_layout = [
[1,-1,1,1,1,1,-0.5,1,1,1,1,-0.5,1,1,1,1,-0.5,1,1,1],
[1,1,1,1,1,1,1,1,1,1,1,1,1,2,-0.5,1,1,1,-0.5,1,1,1,1],
[1.5,1,1,1,1,1,1,1,1,1,1,1,1,1.5,-0.5,1,1,1,-0.5,1,1,1,1],
[1.75,1,1,1,1,1,1,1,1,1,1,1,2.25,-4,1,1,1],
[2.25,1,1,1,1,1,1,1,1,1,1,2.75,-1.5,1,-1.5,1,1,1,1],
[1.25,1.25,1.25,6.25,1.25,1.25,1.25,1.25,-0.5,1,1,1,-0.5,2,1]
];

full_size_vertical_size = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
];

full_size_legend_size = [
[-2, 0, -2, -2, -2, -2, 0, -2, -2, -2, -2, 0, -2, -2, -2, -2, 0, -3, -3, -2],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -3, -3, 0, -2, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -3, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
];

full_size_legends = [
["esc", "", "f1", "f2", "f3", "f4", "", "f5", "f6", "f7", "f8", "", "f9", "f10", "f11", "f12", "", "ptsc", "sclk", "pse"],
["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "⌫", "", "ins", "home", "pgup", "", "num", "/", "*", "-"],
["tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\", "", "del", "end", "pgdn", "", "7", "8", "9", "+"],
["caps", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "enter", "", "4", "5", "6"],
["shift", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "shift", "", "up", "", "1", "2", "3", "ent"],
["ctl", "win", "alt", "", "mnu", "win", "alt", "ctl", "", "lt", "dn", "rt", "", "0", "."],
];


module full_size_default(profile="dcs") {
simple_layout(full_size_default_layout) {
fs_legend = full_size_legends[$row][$column];
legend_size = $font_size + full_size_legend_size[$row][$column];
vertical_size = full_size_vertical_size[$row][$column];

legend(fs_legend, size=legend_size) {
key_profile(profile, $row, $column) {
if(vertical_size > 1){
v_offset = -(vertical_size - 1) / 2;
translate_u(0, v_offset){
uh(vertical_size) {
stabilized(vertical=true) children();
}
}
} else {
key();
}
}
}
}
}
46 changes: 46 additions & 0 deletions src/layouts/full_size_dual/default.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
include <../layout.scad>

rt_arrow="\u2192";
lt_arrow="\u2190";
up_arrow="\u2191";
dn_arrow="\u2193";
menu="\u2261";
enter=lt_arrow; //"\u2386" with supported Unicode Font
backspace="BkSp"; //"\u232B" with supported Unicode Font

// Keys are defined independently: [legend, horizontalSize, verticalSize, fontChg]
full_size_dual = [[["Esc",1,1,-2], ["",-1,1,0], ["F1",1,1,-2], ["F2",1,1,-2], ["F3",1,1,-2], ["F4",1,1,-2], ["",-.5,1,0], ["F5",1,1,-2], ["F6",1,1,-2], ["F7",1,1,-2], ["F8",1,1,-2], ["",-.5,1,0], ["F9",1,1,-2], ["F10",1,1,-2], ["F11",1,1,-2], ["F12",1,1,-2], ["",-0.5,1,0], [["Print","Screen"],1,1,-3], [["Scroll", "Lock"],1,1,-3], [["Pause","Break"],1,1,-3]],
[[["~","`"],1,1,0], [["!","1"],1,1,0], [["@","2"],1,1,0], [["#","3"],1,1,0], [["$","4"],1,1,0], [["%","5"],1,1,0], [["^","6"],1,1,0], [["&","7"],1,1,0], [["*","8"],1,1,0], [["(","9"],1,1,0], [[")","0"],1,1,0], [["_","-"],1,1,0], [["+","="],1,1,0], [backspace,2,1,-2], ["",-0.5,1,0], ["Ins",1,1,-2], ["Home",1,1,-2], [["Pg","Up"],1,1,-1], ["",-0.5,1,0], [["Num","Lock"],1,1,-2], ["/",1,1,0], ["*",1,1,0], ["-",1,1,0]],
[["Tab",1.5,1,-2], ["Q",1,1,0], ["W",1,1,0], ["E",1,1,0], ["R",1,1,0], ["T",1,1,-2], ["Y",1,1,0], ["U",1,1,0], ["I",1,1,0], ["O",1,1,0], ["P",1,1,0], [["{","["],1,1,0], [["}","]"],1,1,0], [["|","\\"],1.5,1,0], ["",-0.5,1,0], ["Del",1,1,-2], ["End",1,1,-2], [["Pg","Dn"],1,1,-1], ["",-0.5,1,0], ["7",1,1,0], ["8",1,1,0], ["9",1,1,0], ["+",1,2,0]],
[["Caps",1.75,1,-2], ["A",1,1,0], ["S",1,1,0], ["D",1,1,0], ["F",1,1,-2], ["G",1,1,0], ["H",1,1,0], ["J",1,1,0], ["K",1,1,0], ["L",1,1,0], [[":",";"],1,1,0], [["\"","'"],1,1,0], ["Enter",2.25,1,-2], ["",-4,1,0], ["4",1,1,0], ["5",1,1,0], ["6",1,1,0]],
[["Shift",2.25,1,-2], ["Z",1,1,0], ["X",1,1,0], ["C",1,1,-2], ["V",1,1,0], ["B",1,1,0], ["N",1,1,0], ["M",1,1,0], [["<",","],1,1,0], [[">","."],1,1,0], [["?","/"],1,1,0], ["Shift",2.75,1,-2], ["",-1.5,1,0], [up_arrow,1,1,0], ["",-1.5,1,0], ["1",1,1,0], ["2",1,1,0], ["3",1,1,0], [enter,1,2,0]],
[["Ctrl",1.25,1,-2], ["Win",1.25,1,-2], ["Alt",1.25,1,-2], ["",6.25,1,0], ["Alt",1.25,1,-2], ["FN",1.25,1,-2], [menu,1.25,1,0], ["Ctrl",1.25,1,-2], ["",-0.5,1,0], [lt_arrow,1,1,0], [dn_arrow,1,1,0], [rt_arrow,1,1,0], ["",-0.5,1,0], ["0",2,1,0], [".",1,1,0]]];

// Derive/seperate out tables
full_size_dual_legends = [ for (row = full_size_dual) [ for (col = row) col[0]]];
full_size_dual_default_layout = [ for (row = full_size_dual) [ for (col = row) col[1]]];
full_size_dual_vertical_size = [ for (row = full_size_dual) [ for (col = row) col[2]]];
full_size_dual_legend_size = [ for (row = full_size_dual) [ for (col = row) col[3]]];

module full_size_dual_default(profile="dcs") {
simple_layout(full_size_dual_default_layout) {
dual_legend = full_size_dual_legends[$row][$column];
legend_size = $font_size+full_size_dual_legend_size[$row][$column];
vertical_size = full_size_dual_vertical_size[$row][$column];

legend(dual_legend, size=legend_size) {
key_profile(profile, $row, $column) {
if(vertical_size > 1){
v_offset = -(vertical_size - 1) / 2;
translate_u(0, v_offset){
uh(vertical_size) {
stabilized(vertical=true) children();
}
}
} else {
children();
}
}
}
}
}
38 changes: 38 additions & 0 deletions src/layouts/tkl/default.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
include <../layout.scad>

tkl_default_layout = [
[1,-1,1,1,1,1,-0.5,1,1,1,1,-0.5,1,1,1,1,-0.5,1,1,1],
[1,1,1,1,1,1,1,1,1,1,1,1,1,2,-0.5,1,1,1],
[1.5,1,1,1,1,1,1,1,1,1,1,1,1,1.5,-0.5,1,1,1],
[1.75,1,1,1,1,1,1,1,1,1,1,1,2.25],
[2.25,1,1,1,1,1,1,1,1,1,1,2.75,-1.5,1],
[1.25,1.25,1.25,6.25,1.25,1.25,1.25,1.25,-0.5,1,1,1]
];

tkl_legend_size = [
[-2, 0, -2, -2, -2, -2, 0, -2, -2, -2, -2, 0, -2, -2, -2, -2, 0, -3, -3, -2],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -3, -3],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -3],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];

tkl_legends = [
["esc", "", "f1", "f2", "f3", "f4", "", "f5", "f6", "f7", "f8", "", "f9", "f10", "f11", "f12", "", "ptsc", "sclk", "pse"],
["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "⌫", "", "ins", "home", "pgup"],
["tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\", "", "del", "end", "pgdn"],
["caps", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "enter"],
["shift", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "shift", "", "up"],
["ctl", "win", "alt", "", "mnu", "win", "alt", "ctl", "", "lt", "dn", "rt"],
];

module tkl_default(profile="dcs") {
simple_layout(tkl_default_layout) {
tkl_legend = tkl_legends[$row][$column];
legend_size = $font_size + tkl_legend_size[$row][$column];

legend(tkl_legend, size=legend_size) {
key_profile(profile, $row, $column) children();
}
}
}