Skip to content
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
3 changes: 3 additions & 0 deletions src/key_layouts.scad
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ 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>
41 changes: 41 additions & 0 deletions src/layouts/full_size/default.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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, -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) {
layout(full_size_default_layout, profile, full_size_legends, row_sculpting_offset=-1, legend_sizes=full_size_legend_size, vertical_sizes=full_size_vertical_size) children();
}
8 changes: 5 additions & 3 deletions src/layouts/layout.scad
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,26 @@ function double_sculpted_column(column, row_length, column_sculpt_profile) =
1hand(column, row_length) : (column_sculpt_profile == "cresting_wave") ?
cresting_wave(column, row_length) : 0;

module layout(list, profile="dcs", legends=undef, front_legends=undef, row_sculpting_offset=0, row_override=undef, column_sculpt_profile="2hands", column_override=undef) {
module layout(list, profile="dcs", legends=undef, front_legends=undef, row_sculpting_offset=0, row_override=undef, column_sculpt_profile="2hands", column_override=undef, legend_sizes=undef, vertical_sizes=undef) {
for (row = [0:len(list)-1]){
/* echo("**ROW**:", row); */
row_length = len(list[row]);

for(column = column_override ? column_override : [0:len(list[row])-1]) {
row_sculpting = (row_override != undef ? row_override : row) + row_sculpting_offset;
key_length = list[row][column];
key_height = vertical_sizes ? vertical_sizes[row][column] : 1;
v_offset = (key_height - 1) / 2;
column_value = double_sculpted_column(column, row_length, column_sculpt_profile);
column_distance = abs_sum([for (x = [0 : column]) list[row][x]]);

/* echo("\t**COLUMN**", "column_value", column_value, "column_distance", column_distance); */

// supports negative values for nonexistent keys
if (key_length >= 1) {
translate_u(column_distance - (key_length/2), -row) {
translate_u(column_distance - (key_length/2), -row-v_offset) {

key_profile(profile, row_sculpting, column_value) u(key_length) legend(legends ? legends[row][column] : "") front_legend(front_legends ? front_legends[row][column] : "") cherry() { // (row+4) % 5 + 1
key_profile(profile, row_sculpting, column_value) u(key_length) uh(key_height) legend(legends ? legends[row][column] : "", size=legend_sizes ? $font_size+legend_sizes[row][column] : $font_size) front_legend(front_legends ? front_legends[row][column] : "") cherry() { // (row+4) % 5 + 1
$row = row;
$column = column;

Expand Down
31 changes: 31 additions & 0 deletions src/layouts/tkl/default.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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) {
layout(tkl_default_layout, profile, tkl_legends, row_sculpting_offset=-1, legend_sizes=tkl_legend_size) children();
}