Skip to content

Instantly share code, notes, and snippets.

@kbrock
Last active May 3, 2020 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbrock/6b3884793e1376f11cab3e3dc42677d9 to your computer and use it in GitHub Desktop.
Save kbrock/6b3884793e1376f11cab3e3dc42677d9 to your computer and use it in GitHub Desktop.
keyboard info.json layout ideas for qmk

The original is modified in the following ways:

  • tweaked options to be {} not [] for json syntax reasons
  • added "R" for demonstrative purposes

Here are a few ideas. I tried to keep them as independent as possible:

  1. assume width, height, matrix, and display
  2. remove replaces 4. condense options want to keep nodes separate.
  3. assume, replaces, condense
{
"keyboard": "handwired/test",
"layouts": {
"LAYOUT_all": {"layout": [
{"x": 0, "y": 0, "w": 1, "label": "1", "matrix": [0, 0]},
{"x": 1, "y": 0, "w": 1, "label": "2", "matrix": [1, 0]},
{"x": 2, "y": 0, "w": 1, "label": "3", "matrix": [2, 0]},
{"x": 0, "y": 1, "w": 1, "label": "Q", "matrix": [0, 1]},
{"x": 1, "y": 1, "w": 1, "label": "W", "matrix": [1, 1]},
{"x": 2, "y": 1, "w": 1, "label": "E", "matrix": [2, 1]},
{"x": 3, "y": 1, "w": 1, "label": "R", "matrix": [3, 1]}
]}
},
"layout_options": {
"top_row": {
"display": "Top Row",
"options": {
"1key_top": {
"display": "2U key on top",
"replaces": ["1", "2", "3"],
"layout": [
{"x": 0.5, "y": 0, "w": 2, "label": "2", "matrix": [1, 0]}
]
},
"2key_top": {
"display": "1.5U keys on top",
"replaces": ["1", "2", "3"],
"layout": [
{"x": 0, "y": 0, "w": 1.5, "label": "2", "matrix": [0, 0]},
{"x": 1.5, "y": 1, "w": 1.5, "label": "2", "matrix": [2, 0]}
]
},
}
},
"bottom_row": {
"display": "Bottom Row",
"options": {
"1key_bottom": {
"display": "2U key on bottom",
"replaces": ["Q", "W", "E"],
"layout": [
{"x": 1, "y": 1, "w": 2, "label": "Q", "matrix": [1, 1]}
]
},
"2key_bottom": {
"display": "1.5U keys on bottom",
"replaces": ["Q", "W", "E"],
"layout": [
{"x": 0, "y": 1, "w": 1.5, "label": "Q", "matrix": [0, 1]},
{"x": 1.5, "y": 1, "w": 1.5, "label": "E", "matrix": [2, 1]}
]
},
}
}
}
}
{
"keyboard": "handwired/test",
"layouts": {
"LAYOUT_all": {"layout": [
{"x": 0, "y": 0, "label": "1"},
{"x": 1, "y": 0, "label": "2"},
{"x": 2, "y": 0, "label": "3"},
{"x": 0, "y": 1, "label": "Q"},
{"x": 1, "y": 1, "label": "W"},
{"x": 2, "y": 1, "label": "E"},
{"x": 3, "y": 1, "label": "R"}
]}
},
"layout_options": {
"top_row": {
"options": {
"1key_top": {
"display": "2U key on top",
"replaces": ["1", "2", "3"],
"layout": [
{"x": 0.5, "y": 0, "w": 2, "label": "2", "matrix": [1, 0]}
]
},
"2key_top": {
"display": "1.5U keys on top",
"replaces": ["1", "2", "3"],
"layout": [
{"x": 0, "y": 0, "w": 1.5, "label": "2"},
{"x": 1.5, "y": 1, "w": 1.5, "label": "2", "matrix": [2, 0]}
]
},
}
},
"bottom_row": {
"options": {
"1key_bottom": {
"display": "2U key on bottom",
"replaces": ["Q", "W", "E"],
"layout": [
{"x": 1, "y": 1, "w": 2, "label": "Q"}
]
},
"2key_bottom": {
"display": "1.5U keys on bottom",
"replaces": ["Q", "W", "E"],
"layout": [
{"x": 0, "y": 1, "w": 1.5, "label": "Q"},
{"x": 1.5, "y": 1, "w": 1.5, "label": "E", "matrix": [2, 1]}
]
},
}
}
}
}
{
"keyboard": "handwired/test",
"layouts": {
"LAYOUT_all": {
"layout": [
{"x": 3, "y": 1, "w": 1, "label": "R", "matrix": [3, 1]}
],
"options": {
"top_row": {
"display": "Top Row",
"options": {
"default": {
"layout": [
{"x": 0, "y": 0, "w": 1, "label": "1", "matrix": [0, 0]},
{"x": 1, "y": 0, "w": 1, "label": "2", "matrix": [1, 0]},
{"x": 2, "y": 0, "w": 1, "label": "3", "matrix": [2, 0]}
]
},
"1key_top": {
"display": "2U key on top",
"layout": [
{"x": 0.5, "y": 0, "w": 2, "label": "2", "matrix": [1, 0]}
]
},
"2key_top": {
"display": "1.5U keys on top",
"layout": [
{"x": 0, "y": 0, "w": 1.5, "label": "2", "matrix": [0, 0]},
{"x": 1.5, "y": 1, "w": 1.5, "label": "2", "matrix": [2, 0]}
]
},
}
},
"bottom_row": {
"display": "Bottom Row",
"options": {
"default": {
"layout": [
{"x": 0, "y": 1, "w": 1, "label": "Q", "matrix": [0, 1]},
{"x": 1, "y": 1, "w": 1, "label": "W", "matrix": [1, 1]},
{"x": 2, "y": 1, "w": 1, "label": "E", "matrix": [2, 1]},
]
},
"1key_bottom": {
"display": "2U key on bottom",
"layout": [
{"x": 1, "y": 1, "w": 2, "label": "Q", "matrix": [1, 1]}
]
},
"2key_bottom": {
"display": "1.5U keys on bottom",
"layout": [
{"x": 0, "y": 1, "w": 1.5, "label": "Q", "matrix": [0, 1]},
{"x": 1.5, "y": 1, "w": 1.5, "label": "E", "matrix": [2, 1]}
]
},
}
}
}
}
}
{
"keyboard": "handwired/test",
"layouts": {
"LAYOUT_all": {
"layout": [
{"x": 3, "y": 1, "label": "R"}
],
"options": {
"top_row": {
"display": "Top Row",
"options": {
"default": {
"layout": [
{"x": 0, "y": 0, "label": "1"},
{"x": 1, "y": 0, "label": "2"},
{"x": 2, "y": 0, "label": "3"}
]
},
"1key_top": {
"display": "2U key on top",
"layout": [
{"x": 0.5, "y": 0, "w": 2, "label": "2"}
]
},
"2key_top": {
"display": "1.5U keys on top",
"layout": [
{"x": 0, "y": 0.5, "label": "2"},
{"x": 1.5, "y": 1.5, "label": "2"}
]
},
}
},
"bottom_row": {
"display": "Bottom Row",
"options": {
"default": {
"layout": [
{"x": 0, "y": 1, "label": "Q"},
{"x": 1, "y": 1, "label": "W"},
{"x": 2, "y": 1, "label": "E"},
]
},
"1key_bottom": {
"display": "2U key on bottom",
"layout": [
{"x": 1, "y": 1, "w": 2, "label": "Q"}
]
},
"2key_bottom": {
"display": "1.5U keys on bottom",
"layout": [
{"x": 0, "y": 1.5, "label": "Q"},
{"x": 1.5, "y": 1.5, "label": "E"}
]
},
}
}
}
}
}
@kbrock
Copy link
Author

kbrock commented May 2, 2020

Now that I'm thinking about it, display should probably be a localized text in another file, not in here.
Though doing that in a decentralized manner is tricky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment