You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
4.0 KiB

  1. # `info.json`
  2. 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.
  3. 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%.
  4. ## `info.json` Format
  5. 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.
  6. * `keyboard_name`
  7. * A free-form text string describing the keyboard.
  8. * Example: `Clueboard 66%`
  9. * `url`
  10. * A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard.
  11. * `maintainer`
  12. * GitHub username of the maintainer, or `qmk` for community maintained boards
  13. * `width`
  14. * Width of the board in Key Units
  15. * `height`
  16. * Height of the board in Key Units
  17. * `layouts`
  18. * Physical Layout representations. See the next section for more detail.
  19. ### Layout Format
  20. 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.
  21. * `width`
  22. * Optional: The width of the layout in Key Units
  23. * `height`
  24. * Optional: The height of the layout in Key Units
  25. * `key_count`
  26. * **Required**: The number of keys in this layout
  27. * `layout`
  28. * A list of Key Dictionaries describing the physical layout. See the next section for more details.
  29. ### Key Dictionary Format
  30. 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.
  31. 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.
  32. * `x`
  33. * **Required**: The absolute position of the key in the horizontal axis, in Key Units.
  34. * `y`
  35. * **Required**: The absolute position of the key in the vertical axis, in Key Units.
  36. * `w`
  37. * The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
  38. * `h`
  39. * The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
  40. * `r`
  41. * How many degrees clockwise to rotate the key.
  42. * `rx`
  43. * The absolute position of the point to rotate the key around in the horizontal axis. Default: `x`
  44. * `ry`
  45. * The absolute position of the point to rotate the key around in the vertical axis. Default: `y`
  46. * `ks`
  47. * Key Shape: define a polygon by providing a list of points, in Key Units.
  48. * **Important**: These are relative to the top-left of the key, not absolute.
  49. * Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]`
  50. * `label`
  51. * What to name this position in the matrix.
  52. * This should usually be the same name as what is silkscreened on the PCB at this location.
  53. ## How is the Metadata Exposed?
  54. This metadata is primarily used in two ways:
  55. * To allow web-based configurators to dynamically generate UI
  56. * To support the new `make keyboard:keymap:qmk` target, which bundles this metadata up with the firmware to allow QMK Toolbox to be smarter.
  57. Configurator authors can see the [QMK Compiler](https://docs.api.qmk.fm/using-the-api) docs for more information on using the JSON API.