replace jd40 and planck classes with json

This commit is contained in:
Teatov 2025-08-01 00:47:51 +10:00
parent fc5fcd4299
commit ae15500f76
8 changed files with 155 additions and 95 deletions

View File

@ -17,18 +17,18 @@ var layouts: Dictionary[String, AbstractLayout] = {
# LayoutISO.name_static(): LayoutISO.new(),
# LayoutABNT.name_static(): LayoutABNT.new(),
# LayoutJIS.name_static(): LayoutJIS.new(),
# LayoutJD40.name_static(): LayoutJD40.new(),
# LayoutPlanck.name_static(): LayoutPlanck.new(),
# "ansi-104.json": LayoutKLE.new("res://scripts/layouts/kle/ansi-104.json"),
# "ansi-104-big-enter.json":
# LayoutKLE.new("res://scripts/layouts/kle/ansi-104-big-enter.json"),
# "iso-105.json": LayoutKLE.new("res://scripts/layouts/kle/iso-105.json"),
# "keycool-84.json": LayoutKLE.new("res://scripts/layouts/kle/keycool-84.json"),
"jd40.json": LayoutKLE.new("res://scripts/layouts/kle/jd40.json"),
"planck.json": LayoutKLE.new("res://scripts/layouts/kle/planck.json"),
# "kinesis-advantage.json":
# LayoutKLE.new("res://scripts/layouts/kle/kinesis-advantage.json"),
# "atreus.json": LayoutKLE.new("res://scripts/layouts/kle/atreus.json"),
"apple-wireless-keyboard.json":
LayoutKLE.new("res://scripts/layouts/kle/apple-wireless-keyboard.json"),
# "apple-wireless-keyboard.json":
# LayoutKLE.new("res://scripts/layouts/kle/apple-wireless-keyboard.json"),
# LayoutTest.name_static(): LayoutTest.new(),
}

View File

@ -0,0 +1,79 @@
[
{
"name": "JD40"
},
[
"Esc",
"Q",
"W",
"E",
"R",
"T",
"Y",
"U",
"I",
"O",
"P",
"Back<br>Space"
],
[
{
"w": 1.25
},
"Tab",
"A",
"S",
"D",
"F",
"G",
"H",
"J",
"K",
"L",
{
"w": 1.75
},
"Enter"
],
[
{
"w": 1.75
},
"Shift",
"Z",
"X",
"C",
"V",
"B",
"N",
"M",
"<\n.",
{
"w": 1.25
},
"Shift",
"Fn"
],
[
{
"w": 1.25
},
"Hyper",
"Super",
"Meta",
{
"a": 7,
"w": 6.25
},
"",
{
"a": 4,
"w": 1.25
},
"Meta",
{
"w": 1.25
},
"Super"
]
]

View File

@ -0,0 +1,66 @@
[
{
"name": "Planck"
},
[
{
"a": 7
},
"Tab",
"Q",
"W",
"E",
"R",
"T",
"Y",
"U",
"I",
"O",
"P",
"Back Space"
],
[
"Esc",
"A",
"S",
"D",
"F",
"G",
"H",
"J",
"K",
"L",
";",
"'"
],
[
"Shift",
"Z",
"X",
"C",
"V",
"B",
"N",
"M",
",",
".",
"/",
"Return"
],
[
"",
"Ctrl",
"Alt",
"Super",
"&dArr;",
{
"w": 2
},
"",
"&uArr;",
"&larr;",
"&darr;",
"&uarr;",
"&rarr;"
]
]

View File

@ -1,55 +0,0 @@
class_name LayoutJD40 extends AbstractLayout
static func name_static() -> String:
return "JD40"
func rows() -> Array[Array]:
return [
(
[{KeyProps.KEY: KEY_ESCAPE}]
+ CommonLayout.letters_1()
+ [{KeyProps.KEY: KEY_BACKSPACE}]
),
(
[{KeyProps.KEY: KEY_TAB, KeyProps.W: 1.5}]
+ CommonLayout.letters_2()
+ [{KeyProps.KEY: KEY_ENTER, KeyProps.W: 1.5}]
),
(
[
{
KeyProps.KEY: KEY_SHIFT,
KeyProps.W: 1.75,
KeyProps.LOC: KEY_LOCATION_LEFT
}
]
+ CommonLayout.letters_3()
+ [
{KeyProps.KEY: KEY_COMMA},
{
KeyProps.KEY: KEY_SHIFT,
KeyProps.W: 1.25,
KeyProps.LOC: KEY_LOCATION_RIGHT
},
{KeyProps.KEY: KEY_PERIOD},
]
),
[
{KeyProps.KEY: KEY_CTRL, KeyProps.W: 1.5, KeyProps.LOC: KEY_LOCATION_LEFT},
{KeyProps.KEY: KEY_SPECIAL, KeyProps.LOC: KEY_LOCATION_LEFT},
{KeyProps.KEY: KEY_ALT, KeyProps.LOC: KEY_LOCATION_LEFT},
{KeyProps.KEY: KEY_SPACE, KeyProps.W: 6},
{
KeyProps.KEY: KEY_SPECIAL,
KeyProps.W: 1.25,
KeyProps.LOC: KEY_LOCATION_RIGHT
},
{
KeyProps.KEY: KEY_CTRL,
KeyProps.W: 1.25,
KeyProps.LOC: KEY_LOCATION_RIGHT
},
]
]

View File

@ -1 +0,0 @@
uid://i3bve82hdaop

View File

@ -13,6 +13,7 @@ const LABEL_TO_KEYCODE_MAP: Dictionary[String, Key] = {
".": KEY_PERIOD,
"/": KEY_SLASH,
"#": KEY_NUMBERSIGN,
"Return": KEY_ENTER,
"Esc": KEY_ESCAPE,
"esc": KEY_ESCAPE,
"Bksp": KEY_BACKSPACE,
@ -27,6 +28,7 @@ const LABEL_TO_KEYCODE_MAP: Dictionary[String, Key] = {
"super": KEY_META,
"": KEY_META,
"command": KEY_META,
"Meta": KEY_META,
"AltGr": KEY_ALT,
"PrtSc": KEY_PRINT,
"PrintScr SysReq": KEY_PRINT,
@ -43,12 +45,16 @@ const LABEL_TO_KEYCODE_MAP: Dictionary[String, Key] = {
"Fn": KEY_SPECIAL,
"": KEY_UP,
"": KEY_UP,
"&uarr;": KEY_UP,
"": KEY_LEFT,
"": KEY_LEFT,
"&larr;": KEY_LEFT,
"": KEY_DOWN,
"": KEY_DOWN,
"&darr;": KEY_DOWN,
"": KEY_RIGHT,
"": KEY_RIGHT,
"&rarr;": KEY_RIGHT,
}
const LABEL_TO_NUMPAD_KEYCODE_MAP: Dictionary[String, Key] = {

View File

@ -1,34 +0,0 @@
class_name LayoutPlanck extends AbstractLayout
static func name_static() -> String:
return "Planck"
func rows() -> Array[Array]:
return [
(
[{KeyProps.KEY: KEY_TAB}]
+ CommonLayout.letters_1()
+ [{KeyProps.KEY: KEY_BACKSPACE}]
),
[{KeyProps.KEY: KEY_ESCAPE}] + CommonLayout.letters_row_2(),
(
[{KeyProps.KEY: KEY_SHIFT, KeyProps.LOC: KEY_LOCATION_LEFT}]
+ CommonLayout.letters_row_3()
+ [{KeyProps.KEY: KEY_ENTER}]
),
[
{KeyProps.KEY: KEY_SPECIAL},
{KeyProps.KEY: KEY_CTRL, KeyProps.LOC: KEY_LOCATION_LEFT},
{KeyProps.KEY: KEY_ALT, KeyProps.LOC: KEY_LOCATION_LEFT},
{KeyProps.KEY: KEY_META, KeyProps.LOC: KEY_LOCATION_LEFT},
{KeyProps.KEY: KEY_SPECIAL, KeyProps.LOC: KEY_LOCATION_LEFT},
{KeyProps.KEY: KEY_SPACE, KeyProps.W: 2},
{KeyProps.KEY: KEY_SPECIAL, KeyProps.LOC: KEY_LOCATION_RIGHT},
{KeyProps.KEY: KEY_LEFT},
{KeyProps.KEY: KEY_DOWN},
{KeyProps.KEY: KEY_UP},
{KeyProps.KEY: KEY_RIGHT},
]
]

View File

@ -1 +0,0 @@
uid://dqjuvbt87uah0