diff options
author | skullY <skullydazed@gmail.com> | 2019-01-14 10:38:22 -0800 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-02-08 15:13:20 -0800 |
commit | 330e2e6af532bc1531be78f3aedd3479b0573421 (patch) | |
tree | d2e58490c29516b933b1786db8514889fca1013c /docs/reference_info_json.md | |
parent | 24b7d058e2e456dc4ec9cd1e640374b033b57223 (diff) | |
download | qmk_firmware-330e2e6af532bc1531be78f3aedd3479b0573421.tar.gz qmk_firmware-330e2e6af532bc1531be78f3aedd3479b0573421.zip |
Address comments in #4832. Move info.json reference to its own file.
Diffstat (limited to 'docs/reference_info_json.md')
-rw-r--r-- | docs/reference_info_json.md | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md new file mode 100644 index 000000000..8f903a2e0 --- /dev/null +++ b/docs/reference_info_json.md | |||
@@ -0,0 +1,70 @@ | |||
1 | # `info.json` | ||
2 | |||
3 | This file is used by the [QMK API](https://github.com/qmk/qmk_api). It contains the information [QMK Configurator](https://config.qmk.fm/) needs to display a representation of your keyboard. You can also set metadata here. | ||
4 | |||
5 | You can create `info.json` files at every level under `qmk_firmware/keyboards/<name>` to specify this metadata. These files are combined, with more specific files overriding keys in less specific files. This means you do not need to duplicate your metadata information. For example, `qmk_firmware/keyboards/clueboard/info.json` specifies `manufacturer` and `maintainer`, while `qmk_firmware/keyboards/clueboard/66/info.json` specifies more specific information about Clueboard 66%. | ||
6 | |||
7 | ## `info.json` Format | ||
8 | |||
9 | The `info.json` file is a JSON formatted dictionary with the following keys available to be set. You do not have to set all of them, merely the keys that apply to your keyboard. | ||
10 | |||
11 | * `keyboard_name` | ||
12 | * A free-form text string describing the keyboard. | ||
13 | * Example: `Clueboard 66%` | ||
14 | * `url` | ||
15 | * A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard. | ||
16 | * `maintainer` | ||
17 | * GitHub username of the maintainer, or `qmk` for community maintained boards | ||
18 | * `width` | ||
19 | * Width of the board in Key Units | ||
20 | * `height` | ||
21 | * Height of the board in Key Units | ||
22 | * `layouts` | ||
23 | * Physical Layout representations. See the next section for more detail. | ||
24 | |||
25 | ### Layout Format | ||
26 | |||
27 | Within our `info.json` file the `layouts` portion of the dictionary contains several nested dictionaries. The outer layer consists of QMK layout macros, for example `LAYOUT_ansi` or `LAYOUT_iso`. Within each layout macro are keys for `width`, `height`, and `key_count`, each of which should be self-explanatory. | ||
28 | |||
29 | * `width` | ||
30 | * Optional: The width of the layout in Key Units | ||
31 | * `height` | ||
32 | * Optional: The height of the layout in Key Units | ||
33 | * `key_count` | ||
34 | * **Required**: The number of keys in this layout | ||
35 | * `layout` | ||
36 | * A list of Key Dictionaries describing the physical layout. See the next section for more details. | ||
37 | |||
38 | ### Key Dictionary Format | ||
39 | |||
40 | Each Key Dictionary in a layout describes the physical properties of a key. If you are familiar with the Raw Code for <http://keyboard-layout-editor.com> you will find many of the concepts the same. We re-use the same key names and layout choices wherever possible, but unlike keyboard-layout-editor each key is stateless, inheriting no properties from the keys that came before it. | ||
41 | |||
42 | All key positions and rotations are specified in relation to the top-left corner of the keyboard, and the top-left corner of each key. | ||
43 | |||
44 | * `X` | ||
45 | * **Required**: The absolute position of the key in the horizontal axis, in Key Units. | ||
46 | * `Y` | ||
47 | * **Required**: The absolute position of the key in the vertical axis, in Key Units. | ||
48 | * `W` | ||
49 | * The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1` | ||
50 | * `H` | ||
51 | * The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1` | ||
52 | * `R` | ||
53 | * How many degrees clockwise to rotate the key. | ||
54 | * `RX` | ||
55 | * The absolute position of the point to rotate the key around in the horizontal axis. Default: `x` | ||
56 | * `RY` | ||
57 | * The absolute position of the point to rotate the key around in the vertical axis. Default: `y` | ||
58 | * `KS` | ||
59 | * Key Shape: define a polygon by providing a list of points, in Key Units. | ||
60 | * **Important**: These are relative to the top-left of the key, not absolute. | ||
61 | * Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]` | ||
62 | |||
63 | ## How is the Metadata Exposed? | ||
64 | |||
65 | This metadata is primarily used in two ways: | ||
66 | |||
67 | * To allow web-based configurators to dynamically generate UI | ||
68 | * To support the new `make keyboard:keymap:qmk` target, which bundles this metadata up with the firmware to allow QMK Toolbox to be smarter. | ||
69 | |||
70 | Configurator authors can see the [QMK Compiler](https://docs.compile.qmk.fm/api_docs.html) docs for more information on using the JSON API. | ||