]> git.donarmstrong.com Git - qmk_firmware.git/blob - docs/getting_started_instroduction.md
adds info.json files to planck
[qmk_firmware.git] / docs / getting_started_instroduction.md
1 # Introduction
2
3 This page attempts to explain the basic information you need to know to work with the QMK project. It assumes that you are familiar with navigating a UNIX shell, but does not assume you are familiar with C or with compiling using make.
4
5 ## Basic QMK structure
6
7 QMK is a fork of @tmk's [tmk_keyboard](https://github.com/tmk/tmk_keyboard) project. The original TMK code, with modifications, can be found in the `tmk` folder. The QMK additions to the project may be found in the `quantum` folder. Keyboard projects may be found in the `handwired` and `keyboard` folders.
8
9 ### Keyboard project structure
10
11 Within the `handwired` and `keyboard` folders is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within you'll find the following structure:
12
13 * `keymaps/`: Different keymaps that can be built
14 * `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `Makefile`.
15 * `config.h`: The file that sets the default compile time options. Do not edit this file directly, instead use a keymap specific `config.h`.
16
17 ### Keymap structure
18
19 In every keymap folder, the following files may be found. Only `keymap.c` is required, if the rest of the files are not found the default options will be chosen.
20
21 * `config.h`: the options to configure your keymap
22 * `keymap.c`: all of your keymap code, required
23 * `rules.mk`: the features of QMK that are enabled
24 * `readme.md`: a description of your keymap, how others might use it, and explanations of features. Please upload images to a service like imgur.
25
26 # The `config.h` file
27
28 There are 2 `config.h` locations:
29
30 * keyboard (`/keyboards/<keyboard>/config.h`)
31 * keymap (`/keyboards/<keyboard>/keymaps/<keymap>/config.h`)
32
33 If the keymap `config.h` exists that file is included by the build system and the keyboard `config.h` is not included. If you wish to override settings in your keymap's `config.h` you will need to include some glue code:
34
35 ```
36 #ifndef CONFIG_USER_H
37 #define CONFIG_USER_H
38
39 #include "../../config.h"
40 ```
41
42 If you want to override a setting from the parent `config.h` file, you need to `#undef` and then `#define` the setting again, like this:
43
44 ```c
45 #undef MY_SETTING
46 #define MY_SETTING 4
47 ```