From f7041b6bf0b1878c06df7f4165c415937b2cd35c Mon Sep 17 00:00:00 2001 From: Oliver Gaskell Date: Thu, 25 Mar 2021 15:16:48 +0000 Subject: [PATCH 1/6] Add basic version of TKL Layout. Legends still need tweaking as they overrun a lot of keys, and the profile is completely wrong as it seems to be doing 1-2-3-4-4-5 instead of 1-1-2-3-4-4. --- src/key_layouts.scad | 2 ++ src/layouts/tkl/default.scad | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/layouts/tkl/default.scad diff --git a/src/key_layouts.scad b/src/key_layouts.scad index 10b5630..ea2d3ac 100644 --- a/src/key_layouts.scad +++ b/src/key_layouts.scad @@ -18,3 +18,5 @@ include include include + +include \ No newline at end of file diff --git a/src/layouts/tkl/default.scad b/src/layouts/tkl/default.scad new file mode 100644 index 0000000..8ab7875 --- /dev/null +++ b/src/layouts/tkl/default.scad @@ -0,0 +1,23 @@ +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_legends = [ + ["Esc", "", "F1", "F2", "F3", "F4", "", "F5", "F6", "F7", "F8", "", "F9", "F10", "F11", "F12", "", "Scn", "Scr", "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) children(); +} From d69e9e5df960b8fda3850e4eac0025212e971630 Mon Sep 17 00:00:00 2001 From: Oliver Gaskell Date: Thu, 25 Mar 2021 16:42:52 +0000 Subject: [PATCH 2/6] Add legend_sizes argument to layout(). This allows the size of legends to be modified. For example, on the TKL layout, many of the nav key's legends are too long to fit on a 1u key with the standard 6 font size, so the legend_sizes allows a change of this. The array specifies differences from the default, so that if the default is adjusted the changed font sizes will be too. For example, +2 means a 2 unit larger legend, 0 means default and -1 means 1 unit smaller. --- src/layouts/layout.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layouts/layout.scad b/src/layouts/layout.scad index cd3c9c2..c4d153a 100644 --- a/src/layouts/layout.scad +++ b/src/layouts/layout.scad @@ -20,7 +20,7 @@ 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) { for (row = [0:len(list)-1]){ /* echo("**ROW**:", row); */ row_length = len(list[row]); @@ -37,7 +37,7 @@ module layout(list, profile="dcs", legends=undef, front_legends=undef, row_sculp if (key_length >= 1) { translate_u(column_distance - (key_length/2), -row) { - 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) 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; From fd15f5125aebf794bd423f25e06cd51cc0ed518b Mon Sep 17 00:00:00 2001 From: Oliver Gaskell Date: Thu, 25 Mar 2021 16:46:12 +0000 Subject: [PATCH 3/6] Add legend_sizes to tkl, to fix keys where legend overruns keys. --- src/layouts/tkl/default.scad | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/layouts/tkl/default.scad b/src/layouts/tkl/default.scad index 8ab7875..7ab82a5 100644 --- a/src/layouts/tkl/default.scad +++ b/src/layouts/tkl/default.scad @@ -9,6 +9,14 @@ tkl_default_layout = [ [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, -2, -2, -2], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2], + [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", "", "Scn", "Scr", "Pse"], ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "⌫", "", "ins", "home", "pgup"], @@ -19,5 +27,5 @@ tkl_legends = [ ]; module tkl_default(profile) { - layout(tkl_default_layout, profile, tkl_legends) children(); + layout(tkl_default_layout, profile, tkl_legends, row_sculpting_offset=-1, legend_sizes=tkl_legend_size) children(); } From 277a017440e9bb8b3ddd413acc6cc0db09322581 Mon Sep 17 00:00:00 2001 From: Oliver Gaskell Date: Thu, 25 Mar 2021 17:28:08 +0000 Subject: [PATCH 4/6] Change some legends and sizing to better fit the existing legends (taken from the default 60%) --- src/layouts/tkl/default.scad | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/layouts/tkl/default.scad b/src/layouts/tkl/default.scad index 7ab82a5..36aa8e1 100644 --- a/src/layouts/tkl/default.scad +++ b/src/layouts/tkl/default.scad @@ -10,15 +10,15 @@ tkl_default_layout = [ ]; tkl_legend_size = [ - [-2, 0, -2, -2, -2, -2, 0, -2, -2, -2, -2, 0, -2, -2, -2, -2, 0, -2, -2, -2], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2], + [-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", "", "Scn", "Scr", "Pse"], + ["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"], From 44340a4743b8c9ed10b155f07137419560ab8e86 Mon Sep 17 00:00:00 2001 From: Oliver Gaskell Date: Thu, 25 Mar 2021 17:43:23 +0000 Subject: [PATCH 5/6] Add basic full_size layout. Not sure how to do vertical keys using layout(), so they've been replaced by 2 keys with the same legend. --- src/key_layouts.scad | 3 ++- src/layouts/full_size/default.scad | 32 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/layouts/full_size/default.scad diff --git a/src/key_layouts.scad b/src/key_layouts.scad index ea2d3ac..db14054 100644 --- a/src/key_layouts.scad +++ b/src/key_layouts.scad @@ -19,4 +19,5 @@ include include -include \ No newline at end of file +include +include \ No newline at end of file diff --git a/src/layouts/full_size/default.scad b/src/layouts/full_size/default.scad new file mode 100644 index 0000000..8eeb1d5 --- /dev/null +++ b/src/layouts/full_size/default.scad @@ -0,0 +1,32 @@ +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,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,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, -2] +]; + +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", ".", "ent"], +]; + +module full_size_default(profile) { + layout(full_size_default_layout, profile, full_size_legends, row_sculpting_offset=-1, legend_sizes=full_size_legend_size) children(); +} From 7f326f30e9f6b1e850ef54a21456650005df0fb8 Mon Sep 17 00:00:00 2001 From: Oliver Gaskell Date: Thu, 25 Mar 2021 19:37:51 +0000 Subject: [PATCH 6/6] Add Vertical Keys to layout() --- src/layouts/full_size/default.scad | 23 ++++++++++++++++------- src/layouts/layout.scad | 8 +++++--- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/layouts/full_size/default.scad b/src/layouts/full_size/default.scad index 8eeb1d5..2a30bf2 100644 --- a/src/layouts/full_size/default.scad +++ b/src/layouts/full_size/default.scad @@ -4,29 +4,38 @@ 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,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,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, -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, -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", "+"], + ["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", ".", "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) children(); + 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(); } diff --git a/src/layouts/layout.scad b/src/layouts/layout.scad index c4d153a..08d6d98 100644 --- a/src/layouts/layout.scad +++ b/src/layouts/layout.scad @@ -20,7 +20,7 @@ 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, legend_sizes=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]); @@ -28,6 +28,8 @@ module layout(list, profile="dcs", legends=undef, front_legends=undef, row_sculp 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]]); @@ -35,9 +37,9 @@ module layout(list, profile="dcs", legends=undef, front_legends=undef, row_sculp // 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] : "", size=legend_sizes ? $font_size+legend_sizes[row][column] : $font_size) 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;