From e0c80fc420af5a98f5596ce35a4afe02e7c0e7d9 Mon Sep 17 00:00:00 2001 From: teatov Date: Sat, 2 Aug 2025 00:19:47 +1000 Subject: [PATCH] externalize big ass enter shapes --- scripts/layouts/common_rows.gd | 22 ++++++++++++++++++++++ scripts/layouts/layout_abnt.gd | 11 +---------- scripts/layouts/layout_ansi_variant.gd | 11 +---------- scripts/layouts/layout_iso.gd | 11 +---------- scripts/layouts/layout_jis.gd | 11 +---------- 5 files changed, 26 insertions(+), 40 deletions(-) diff --git a/scripts/layouts/common_rows.gd b/scripts/layouts/common_rows.gd index b73a785..662f086 100644 --- a/scripts/layouts/common_rows.gd +++ b/scripts/layouts/common_rows.gd @@ -1,6 +1,28 @@ class_name CommonRows +static func big_enter_iso() -> Dictionary: + return { + KeyProps.KEY: KEY_ENTER, + KeyProps.W: 1.25, + KeyProps.H: 2, + KeyProps.X: 0.25, + KeyProps.W2: 1.5, + KeyProps.X2: -0.25, + } + + +static func big_enter_ansi() -> Dictionary: + return { + KeyProps.KEY: KEY_ENTER, + KeyProps.W: 1.5, + KeyProps.H: 2, + KeyProps.W2: 2.25, + KeyProps.Y2: 1, + KeyProps.X2: -0.75, + } + + static func numbers() -> Array: return [ {KeyProps.KEY: KEY_1}, diff --git a/scripts/layouts/layout_abnt.gd b/scripts/layouts/layout_abnt.gd index 9a2885f..e4ded29 100644 --- a/scripts/layouts/layout_abnt.gd +++ b/scripts/layouts/layout_abnt.gd @@ -13,16 +13,7 @@ func get_rows() -> Array[Array]: ( [{KeyProps.KEY: KEY_TAB, KeyProps.W: 1.5}] + CommonRows.letters_row_1() - + [ - { - KeyProps.KEY: KEY_ENTER, - KeyProps.W: 1.25, - KeyProps.H: 2, - KeyProps.X: 0.25, - KeyProps.W2: 1.5, - KeyProps.X2: -0.25, - } - ] + + [CommonRows.big_enter_iso()] ), ( [{KeyProps.KEY: KEY_CAPSLOCK, KeyProps.W: 1.75}] diff --git a/scripts/layouts/layout_ansi_variant.gd b/scripts/layouts/layout_ansi_variant.gd index 80462c1..0f6abe1 100644 --- a/scripts/layouts/layout_ansi_variant.gd +++ b/scripts/layouts/layout_ansi_variant.gd @@ -16,16 +16,7 @@ func get_rows() -> Array[Array]: ( [{KeyProps.KEY: KEY_TAB, KeyProps.W: 1.5}] + CommonRows.letters_row_1() - + [ - { - KeyProps.KEY: KEY_ENTER, - KeyProps.W: 1.5, - KeyProps.H: 2, - KeyProps.W2: 2.25, - KeyProps.Y2: 1, - KeyProps.X2: -0.75, - } - ] + + [CommonRows.big_enter_ansi()] ), [{KeyProps.KEY: KEY_CAPSLOCK, KeyProps.W: 1.75}] + CommonRows.letters_row_2(), ( diff --git a/scripts/layouts/layout_iso.gd b/scripts/layouts/layout_iso.gd index 58c5244..c1c8df3 100644 --- a/scripts/layouts/layout_iso.gd +++ b/scripts/layouts/layout_iso.gd @@ -13,16 +13,7 @@ func get_rows() -> Array[Array]: ( [{KeyProps.KEY: KEY_TAB, KeyProps.W: 1.5}] + CommonRows.letters_row_1() - + [ - { - KeyProps.KEY: KEY_ENTER, - KeyProps.W: 1.25, - KeyProps.H: 2, - KeyProps.X: 0.25, - KeyProps.W2: 1.5, - KeyProps.X2: -0.25, - } - ] + + [CommonRows.big_enter_iso()] ), ( [{KeyProps.KEY: KEY_CAPSLOCK, KeyProps.W: 1.75}] diff --git a/scripts/layouts/layout_jis.gd b/scripts/layouts/layout_jis.gd index 7fc0c49..96d71af 100644 --- a/scripts/layouts/layout_jis.gd +++ b/scripts/layouts/layout_jis.gd @@ -16,16 +16,7 @@ func get_rows() -> Array[Array]: ( [{KeyProps.KEY: KEY_TAB, KeyProps.W: 1.5}] + CommonRows.letters_row_1() - + [ - { - KeyProps.KEY: KEY_ENTER, - KeyProps.W: 1.25, - KeyProps.H: 2, - KeyProps.X: 0.25, - KeyProps.W2: 1.5, - KeyProps.X2: -0.25, - } - ] + + [CommonRows.big_enter_iso()] ), ( [{KeyProps.KEY: KEY_CAPSLOCK, KeyProps.W: 1.75}]