aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskullY <skullydazed@gmail.com>2017-07-03 01:30:36 -0700
committerskullY <skullydazed@gmail.com>2017-07-03 01:30:36 -0700
commitd8e29b53fe5d57f2102b77f0ce9932cdb8b021b2 (patch)
tree14dd7d4c51a3d0bb046acb29ad96ca2b5f76f55b
parentea8df568f23b79eba13ef9e914d8b1ce94688858 (diff)
downloadqmk_firmware-d8e29b53fe5d57f2102b77f0ce9932cdb8b021b2.tar.gz
qmk_firmware-d8e29b53fe5d57f2102b77f0ce9932cdb8b021b2.zip
Update a bunch of docs
-rw-r--r--docs/README.md17
-rw-r--r--docs/_summary.md3
-rw-r--r--docs/adding_features_to_qmk.md17
-rw-r--r--docs/build_environment_setup.md30
-rw-r--r--docs/custom_quantum_functions.md6
-rw-r--r--docs/differences_from_tmk.md7
-rw-r--r--docs/documentation_best_practices.md39
-rw-r--r--docs/eclipse.md4
-rw-r--r--docs/faq.md70
-rw-r--r--docs/faq_build.md63
-rw-r--r--docs/faq_keymap.md94
-rw-r--r--docs/glossary.md31
-rw-r--r--docs/key_functions.md23
-rw-r--r--docs/macros.md8
-rw-r--r--docs/make_instructions.md6
-rw-r--r--docs/quantum_keycodes.md26
-rw-r--r--docs/tap_dance.md8
-rw-r--r--docs/understanding_qmk.md128
18 files changed, 253 insertions, 327 deletions
diff --git a/docs/README.md b/docs/README.md
index 3346df2a0..06597a2b6 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,23 +1,16 @@
1# Quantum Mechanical Keyboard Firmware 1# Quantum Mechanical Keyboard Firmware
2 2
3## Getting started 3## What is QMK Firmware? {#what-is-qmk-firmware}
4
5* [What is QMK Firmware?](#what-is-qmk-firmware)
6* [How to get it](#how-to-get-it)
7* [How to compile](#how-to-compile)
8* [How to customize](#how-to-customize)
9
10### What is QMK Firmware? {#what-is-qmk-firmware}
11 4
12QMK (*Quantum Mechanical Keyboard*) is an open source community that maintains QMK Firmware, QMK Flasher, qmk.fm, and these docs. QMK Firmware is a keyboard firmware based on the [tmk\_keyboard](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR controllers, and more specifically, the [OLKB product line](http://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/). It has also been ported to ARM chips using ChibiOS. You can use it to power your own hand-wired or custom keyboard PCB. 5QMK (*Quantum Mechanical Keyboard*) is an open source community that maintains QMK Firmware, QMK Flasher, qmk.fm, and these docs. QMK Firmware is a keyboard firmware based on the [tmk\_keyboard](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR controllers, and more specifically, the [OLKB product line](http://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/). It has also been ported to ARM chips using ChibiOS. You can use it to power your own hand-wired or custom keyboard PCB.
13 6
14### How to get it {#how-to-get-it} 7## How to get it {#how-to-get-it}
15 8
16If you plan on contributing a keymap, keyboard, or features to QMK, the easiest thing to do is [fork the repo through Github](https://github.com/qmk/qmk_firmware#fork-destination-box), and clone your repo locally to make your changes, push them, then open a [Pull Request](https://github.com/qmk/qmk_firmware/pulls) from your fork. 9If you plan on contributing a keymap, keyboard, or features to QMK, the easiest thing to do is [fork the repo through Github](https://github.com/qmk/qmk_firmware#fork-destination-box), and clone your repo locally to make your changes, push them, then open a [Pull Request](https://github.com/qmk/qmk_firmware/pulls) from your fork.
17 10
18Otherwise, you can either download it directly ([zip](https://github.com/qmk/qmk_firmware/zipball/master), [tar](https://github.com/qmk/qmk_firmware/tarball/master)), or clone it via git (`git@github.com:qmk/qmk_firmware.git`), or https (`https://github.com/qmk/qmk_firmware.git`). 11Otherwise, you can either download it directly ([zip](https://github.com/qmk/qmk_firmware/zipball/master), [tar](https://github.com/qmk/qmk_firmware/tarball/master)), or clone it via git (`git@github.com:qmk/qmk_firmware.git`), or https (`https://github.com/qmk/qmk_firmware.git`).
19 12
20### How to compile {#how-to-compile} 13## How to compile {#how-to-compile}
21 14
22Before you are able to compile, you'll need to [install an environment](build_environment_setup.md) for AVR or/and ARM development. Once that is complete, you'll use the `make` command to build a keyboard and keymap with the following notation: 15Before you are able to compile, you'll need to [install an environment](build_environment_setup.md) for AVR or/and ARM development. Once that is complete, you'll use the `make` command to build a keyboard and keymap with the following notation:
23 16
@@ -27,6 +20,6 @@ This would build the `rev4` revision of the `planck` with the `default` keymap.
27 20
28 make preonic-default 21 make preonic-default
29 22
30### How to customize {#how-to-customize} 23## How to customize {#how-to-customize}
31 24
32QMK has lots of [features](features/README.md) to explore, and a good deal of [reference documentation](reference/README.md) to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md). \ No newline at end of file 25QMK has lots of [features](features/README.md) to explore, and a good deal of [reference documentation](reference/README.md) to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md).
diff --git a/docs/_summary.md b/docs/_summary.md
index 1b87399fb..975a92376 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -23,15 +23,16 @@
23 * [Quantum Keycodes](quantum_keycodes.md) 23 * [Quantum Keycodes](quantum_keycodes.md)
24 * [The Config File](config_options.md) 24 * [The Config File](config_options.md)
25 * [Customizing Functionality](custom_quantum_functions.md) 25 * [Customizing Functionality](custom_quantum_functions.md)
26 * [Documentation Best Practices](documentation_best_practices.md)
26 27
27* For makers and modders 28* For makers and modders
28 * [Adding a keyboard to QMK](adding_a_keyboard_to_qmk.md) 29 * [Adding a keyboard to QMK](adding_a_keyboard_to_qmk.md)
29 * [Porting your keyboard to QMK](porting_your_keyboard_to_qmk.md) 30 * [Porting your keyboard to QMK](porting_your_keyboard_to_qmk.md)
30 * [Modding your keyboard](modding_your_keyboard.md) 31 * [Modding your keyboard](modding_your_keyboard.md)
32 * [Understanding QMK](understanding_qmk.md)
31 * [Adding features to QMK](adding_features_to_qmk.md) 33 * [Adding features to QMK](adding_features_to_qmk.md)
32 * [ISP flashing guide](isp_flashing_guide.md) 34 * [ISP flashing guide](isp_flashing_guide.md)
33 35
34* Other topics 36* Other topics
35 * [General FAQ](faq.md) 37 * [General FAQ](faq.md)
36 * [Differences from TMK](differences_from_tmk.md)
37 * [Using Eclipse with QMK](eclipse.md) 38 * [Using Eclipse with QMK](eclipse.md)
diff --git a/docs/adding_features_to_qmk.md b/docs/adding_features_to_qmk.md
index f6f7cba20..fb036496c 100644
--- a/docs/adding_features_to_qmk.md
+++ b/docs/adding_features_to_qmk.md
@@ -1,7 +1,16 @@
1If you have an idea for a custom feature or extra hardware connection, we'd love to accept it into QMK! These are generally done via [pull request](https://github.com/qmk/qmk_firmware/pulls) after forking, and here are some things to keep in mind when creating one: 1# How To Add Features To QMK
2 2
3* **Disable by default** - memory is a pretty limited on most chips QMK supports, and it's important that current keymaps aren't broken, so please allow your feature to be turned **on**, rather than being turned off. If you think it should be on by default, or reduces the size of the code, [open an issue](https://github.com/qmk/qmk_firmware/issues) for everyone to discuss it! 3If you have an idea for a custom feature or extra hardware connection, we'd love to accept it into QMK!
4
5Before you put a lot of work into building your new feature you should make sure you are implementing it in the best way. You can get a basic understanding of QMK by reading [Understaning QMK](understanding_qmk.html), which will take you on a tour of the QMK program flow. From here you should talk to us to get a sense of the best way to implement your idea. There are two main ways to do this:
6
7* [Chat on Gitter](https://gitter.im/qmk/qmk_firmware)
8* [Open an Issue](https://github.com/qmk/qmk_firmware/issues/new)
9
10Once you have implemented your new feature you will generally submit a [pull request](https://github.com/qmk/qmk_firmware/pulls). Here are some things to keep in mind when creating one:
11
12* **Disabled by default** - memory is a pretty limited on most chips QMK supports, and it's important that current keymaps aren't broken, so please allow your feature to be turned **on**, rather than being turned off. If you think it should be on by default, or reduces the size of the code, please talk with us about it.
4* **Compile locally before submitting** - hopefully this one is obvious, but things need to compile! Our Travis system will catch any issues, but it's generally faster for you to compile a few keyboards locally instead of waiting for the results to come back. 13* **Compile locally before submitting** - hopefully this one is obvious, but things need to compile! Our Travis system will catch any issues, but it's generally faster for you to compile a few keyboards locally instead of waiting for the results to come back.
5* **Consider subprojects and different chip-bases** - there are several keyboards that have subprojects that have allow for slightly different configurations, and even different chip-bases. Try to make a feature supported in ARM and AVR, or automatically disabled in one that doesn't work. 14* **Consider subprojects and different chip-bases** - there are several keyboards that have subprojects that have allow for slightly different configurations, and even different chip-bases. Try to make a feature supported in ARM and AVR, or automatically disabled in one that doesn't work.
6* **Explain your feature** - submitting a markdown write-up of what your feature does with your PR may be needed, and it will allow a collaborator to easily copy it into the wiki for documentation (after proofing and editing). 15* **Explain your feature** - Document it in `docs/`, either as a new file or as part of an existing file. If you don't document it other people won't be able to benefit from your hard work.
7* **Don't refactor code** - to maintain a clear vision of how things are laid out in QMK, we try to plan out refactors in-depth, and have a collaborator make the changes. If you have an idea for refactoring, or suggestions, [open an issue](https://github.com/qmk/qmk_firmware/issues). \ No newline at end of file 16* **Don't refactor code** - to maintain a clear vision of how things are laid out in QMK, we try to plan out refactors in-depth, and have a collaborator make the changes. If you have an idea for refactoring, or suggestions, [open an issue](https://github.com/qmk/qmk_firmware/issues).
diff --git a/docs/build_environment_setup.md b/docs/build_environment_setup.md
index 442038a58..2282e9d13 100644
--- a/docs/build_environment_setup.md
+++ b/docs/build_environment_setup.md
@@ -1,19 +1,25 @@
1### Windows 10 1# Build Environment Setup
2 2
3#### Creators Update 3This page describes setting up the build environment for QMK. These instructions cover AVR processors (such as the atmega32u4.)
4
5<!-- FIXME: We should have ARM instructions somewhere. -->
6
7# Windows 10
8
9## Creators Update
4If you have Windows 10 with Creators Update or later, you can build and flash the firmware directly. Before the Creators Update, only building was possible. If you don't have it yet or if are unsure, follow [these instructions](https://support.microsoft.com/en-us/instantanswers/d4efb316-79f0-1aa1-9ef3-dcada78f3fa0/get-the-windows-10-creators-update). 10If you have Windows 10 with Creators Update or later, you can build and flash the firmware directly. Before the Creators Update, only building was possible. If you don't have it yet or if are unsure, follow [these instructions](https://support.microsoft.com/en-us/instantanswers/d4efb316-79f0-1aa1-9ef3-dcada78f3fa0/get-the-windows-10-creators-update).
5 11
6#### Windows Subsystem for Linux 12## Windows Subsystem for Linux
7In addition to the Creators Update, you need Windows 10 Subystem for Linux, so install it following [these instructions](http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/). If you already have the Windows 10 Subsystem for Linux from the Anniversary update it's recommended that you [upgrade](https://betanews.com/2017/04/14/upgrade-windows-subsystem-for-linux/) it to 16.04LTS, because some keyboards don't compile with the toolchains included in 14.04LTS. Note that you need to know what your are doing if you chose the `sudo do-release-upgrade` method. 13In addition to the Creators Update, you need Windows 10 Subystem for Linux, so install it following [these instructions](http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/). If you already have the Windows 10 Subsystem for Linux from the Anniversary update it's recommended that you [upgrade](https://betanews.com/2017/04/14/upgrade-windows-subsystem-for-linux/) it to 16.04LTS, because some keyboards don't compile with the toolchains included in 14.04LTS. Note that you need to know what your are doing if you chose the `sudo do-release-upgrade` method.
8 14
9#### Git 15## Git
10If you already have cloned the repository on your Windows file system you can ignore this section. 16If you already have cloned the repository on your Windows file system you can ignore this section.
11 17
12You will need to clone the repository to your Windows file system using the normal Git for Windows and **not** the WSL Git. So if you haven't installed Git before, [download](https://git-scm.com/download/win) and install it. Then [set it up](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup), it's important that you setup the e-mail and user name, especially if you are planning to contribute. 18You will need to clone the repository to your Windows file system using the normal Git for Windows and **not** the WSL Git. So if you haven't installed Git before, [download](https://git-scm.com/download/win) and install it. Then [set it up](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup), it's important that you setup the e-mail and user name, especially if you are planning to contribute.
13 19
14Once Git is installed, open the Git bash command and change the directory to where you want to clone QMK, note that you have to use forward slashes, and that your c drive is accessed like this `/c/path/to/where/you/want/to/go`. Then run `git clone --recurse-submodules https://github.com/qmk/qmk_firmware`, this will create a new folder `qmk_firmware` as a subfolder of the current one. 20Once Git is installed, open the Git bash command and change the directory to where you want to clone QMK, note that you have to use forward slashes, and that your c drive is accessed like this `/c/path/to/where/you/want/to/go`. Then run `git clone --recurse-submodules https://github.com/qmk/qmk_firmware`, this will create a new folder `qmk_firmware` as a subfolder of the current one.
15 21
16#### Toolchain setup 22## Toolchain setup
17The Toolchain setup is done through the Windows Subsystem for Linux, and the process is fully automated. If you want to do everything manually, there are no other instructions than the scripts themselves, but you can always open issues and ask for more information. 23The Toolchain setup is done through the Windows Subsystem for Linux, and the process is fully automated. If you want to do everything manually, there are no other instructions than the scripts themselves, but you can always open issues and ask for more information.
18 24
191. Open "Bash On Ubuntu On Windows" from the start menu. 251. Open "Bash On Ubuntu On Windows" from the start menu.
@@ -22,13 +28,13 @@ The Toolchain setup is done through the Windows Subsystem for Linux, and the pro
224. Close the Bash command window, and re-open it. 284. Close the Bash command window, and re-open it.
235. You are ready to compile and flash the firmware! 295. You are ready to compile and flash the firmware!
24 30
25#### Some important things to keep in mind 31## Some important things to keep in mind
26* You can run `util/wsl_install.sh` again to get all the newest updates. 32* You can run `util/wsl_install.sh` again to get all the newest updates.
27* Your QMK repository need to be on a Windows file system path, since WSL can't run executables outside it. 33* Your QMK repository need to be on a Windows file system path, since WSL can't run executables outside it.
28* The WSL Git is **not** compatible with the Windows Git, so use the Windows Git Bash or a windows Git GUI for all Git operations 34* The WSL Git is **not** compatible with the Windows Git, so use the Windows Git Bash or a windows Git GUI for all Git operations
29* You can edit files either inside WSL or normally using Windows, but note that if you edit makefiles or shell scripts, make sure you are using an editor that saves the files with Unix line endings. Otherwise the compilation might not work. 35* You can edit files either inside WSL or normally using Windows, but note that if you edit makefiles or shell scripts, make sure you are using an editor that saves the files with Unix line endings. Otherwise the compilation might not work.
30 36
31### Windows (Vista and later) 37# Windows (Vista and later)
321. If you have ever installed WinAVR, uninstall it. 381. If you have ever installed WinAVR, uninstall it.
332. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. 392. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**.
343. If you are going to flash Infinity based keyboards you will need to install dfu-util, refer to the instructions by [Input Club](https://github.com/kiibohd/controller/wiki/Loading-DFU-Firmware). 403. If you are going to flash Infinity based keyboards you will need to install dfu-util, refer to the instructions by [Input Club](https://github.com/kiibohd/controller/wiki/Loading-DFU-Firmware).
@@ -40,7 +46,7 @@ The Toolchain setup is done through the Windows Subsystem for Linux, and the pro
40 46
41If you have trouble and want to ask for help, it is useful to generate a *Win_Check_Output.txt* file by running `Win_Check.bat` in the `\util` folder. 47If you have trouble and want to ask for help, it is useful to generate a *Win_Check_Output.txt* file by running `Win_Check.bat` in the `\util` folder.
42 48
43### Mac 49# Mac
44If you're using [homebrew,](http://brew.sh/) you can use the following commands: 50If you're using [homebrew,](http://brew.sh/) you can use the following commands:
45 51
46 brew tap osx-cross/avr 52 brew tap osx-cross/avr
@@ -59,7 +65,7 @@ If you are going to flash Infinity based keyboards you will also need dfu-util
59 65
60 brew install dfu-util 66 brew install dfu-util
61 67
62### Linux 68# Linux
63 69
64To ensure you are always up to date, you can just run `sudo util/install_dependencies.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.** 70To ensure you are always up to date, you can just run `sudo util/install_dependencies.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.**
65 71
@@ -91,7 +97,7 @@ Debian/Ubuntu example:
91 sudo apt-get update 97 sudo apt-get update
92 sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi 98 sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi
93 99
94### Docker 100# Docker
95 101
96If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap: 102If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap:
97 103
@@ -109,10 +115,10 @@ docker run -e keymap=default -e subproject=ez -e keyboard=ergobox --rm -v D:/Use
109 115
110This will compile the targeted keyboard/keymap and leave it in your QMK directory for you to flash. 116This will compile the targeted keyboard/keymap and leave it in your QMK directory for you to flash.
111 117
112### Vagrant 118# Vagrant
113If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [vagrant guide](vagrant_guide.md). 119If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [vagrant guide](vagrant_guide.md).
114 120
115## Verify Your Installation 121# Verify Your Installation
1161. If you haven't already, obtain this repository ([https://github.com/qmk/qmk_firmware](https://github.com/qmk/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application. 1221. If you haven't already, obtain this repository ([https://github.com/qmk/qmk_firmware](https://github.com/qmk/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application.
1172. Open up a terminal or command prompt and navigate to the `qmk_firmware` folder using the `cd` command. The command prompt will typically open to your home directory. If, for example, you cloned the repository to your Documents folder, then you would type `cd Documents/qmk_firmware`. If you extracted the file from a zip, then it may be named `qmk_firmware-master` instead. 1232. Open up a terminal or command prompt and navigate to the `qmk_firmware` folder using the `cd` command. The command prompt will typically open to your home directory. If, for example, you cloned the repository to your Documents folder, then you would type `cd Documents/qmk_firmware`. If you extracted the file from a zip, then it may be named `qmk_firmware-master` instead.
1183. To confirm that you're in the correct location, you can display the contents of your current folder using the `dir` command on Windows, or the `ls` command on Linux or Mac. You should see several files, including `readme.md` and a `quantum` folder. From here, you need to navigate to the appropriate folder under `keyboards/`. For example, if you're building for a Planck, run `cd keyboards/planck`. 1243. To confirm that you're in the correct location, you can display the contents of your current folder using the `dir` command on Windows, or the `ls` command on Linux or Mac. You should see several files, including `readme.md` and a `quantum` folder. From here, you need to navigate to the appropriate folder under `keyboards/`. For example, if you're building for a Planck, run `cd keyboards/planck`.
diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md
index 0d6def45b..c017c0cdb 100644
--- a/docs/custom_quantum_functions.md
+++ b/docs/custom_quantum_functions.md
@@ -34,9 +34,9 @@ enum my_keycodes {
34}; 34};
35``` 35```
36 36
37## Programming The Behavior Of A Keycode 37## Programming The Behavior Of Any Keycode
38 38
39When you want to override the behavior of an existing key, or define the behavior for a new key, you should use the `process_record_{kb,user}()` functions. These are called by QMK during key processing before the actual key event is handled. If these functions return `true` QMK will process the keycodes as usual. That can be handy for extending the functionality of a key rather than replacing it. If these functions return `false` QMK will skip the normal key handling, and it will be up you to send and key up or down events that are required. 39When you want to override the behavior of an existing key, or define the behavior for a new key, you should use the `process_record_kb()' and `process_record_user()` functions. These are called by QMK during key processing before the actual key event is handled. If these functions return `true` QMK will process the keycodes as usual. That can be handy for extending the functionality of a key rather than replacing it. If these functions return `false` QMK will skip the normal key handling, and it will be up you to send any key up or down events that are required.
40 40
41These function are called every time a key is pressed or released. 41These function are called every time a key is pressed or released.
42 42
@@ -57,7 +57,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
57 case KC_ENTER: 57 case KC_ENTER:
58 // Play a tone when enter is pressed 58 // Play a tone when enter is pressed
59 if (record->event.pressed) { 59 if (record->event.pressed) {
60 PLAY_NOTE_ARRAY(tone_enter); 60 PLAY_NOTE_ARRAY(tone_qwerty);
61 } 61 }
62 return true; // Let QMK send the enter press/release events 62 return true; // Let QMK send the enter press/release events
63 } 63 }
diff --git a/docs/differences_from_tmk.md b/docs/differences_from_tmk.md
deleted file mode 100644
index 10ca329dc..000000000
--- a/docs/differences_from_tmk.md
+++ /dev/null
@@ -1,7 +0,0 @@
1Understanding the essential changes made on the [tmk_keyboard firmware](http://github.com/tmk/tmk_keyboard) should help you understand the QMK Firmware.
2
3| Firmware |TMK |QMK |
4|------------------------------|-----------------------|-------------------------|
5| Maintainer |hasu (@tmk) |Jack Humbert et al. |
6| Build path customization | `TMK_DIR = ...` | `include .../Makefile` |
7| `keymaps` array data | 3D array of `uint8_t` holding **keycode** | 3D array of `uint16_t` holding **keycode** |
diff --git a/docs/documentation_best_practices.md b/docs/documentation_best_practices.md
new file mode 100644
index 000000000..1c06387f7
--- /dev/null
+++ b/docs/documentation_best_practices.md
@@ -0,0 +1,39 @@
1# Documentation Best Practices
2
3This page exists to document best practices when writing documentation for QMK. Following these guidelines will help to keep a consistent tone and style, which will in turn help other people more easily understand QMK.
4
5# Page Opening
6
7Your documentation page should generally start with an H1 heading, followed by a 1 paragrah description of what the user will find on this page. Keep in mind that this heading and paragraph will sit next to the Table of Contents, so keep the heading short and avoid long strings with no whitespace.
8
9Example:
10
11```
12# My Page Title
13
14This page covers my super cool feature. You can use this feature to make coffee, squeeze fresh oj, and have an egg mcmuffin and hashbrowns delivered from your local macca's by drone.
15```
16
17# Headings
18
19Your page should generally have multiple "H1" headings. Only H1 and H2 headings will included in the Table of Contents, so plan them out appropriately. Excess width should be avoided in H1 and H2 headings to prevent the Table of Contents from getting too wide.
20
21# Styled Hint Blocks
22
23You can have styled hint blocks drawn around text to draw attention to it.
24
25{% hint style='info' %}
26This uses \{\% hint style='info' \%\}
27{% endhint %}
28
29{% hint style='tip' %}
30This uses \{\% hint style='tip' \%\}
31{% endhint %}
32
33{% hint style='danger' %}
34This uses \{\% hint style='danger' \%\}
35{% endhint %}
36
37{% hint style='working' %}
38This uses \{\% hint style='working' \%\}
39{% endhint %}
diff --git a/docs/eclipse.md b/docs/eclipse.md
index ec5f2dc0d..a63b84607 100644
--- a/docs/eclipse.md
+++ b/docs/eclipse.md
@@ -1,3 +1,5 @@
1# Setting Up Eclipse for QMK Development
2
1[Eclipse](https://en.wikipedia.org/wiki/Eclipse_(software)) is an open-source [Integrated Development Environment](https://en.wikipedia.org/wiki/Integrated_development_environment) (IDE) widely used for Java development, but with an extensible plugin system that allows to customize it for other languages and usages. 3[Eclipse](https://en.wikipedia.org/wiki/Eclipse_(software)) is an open-source [Integrated Development Environment](https://en.wikipedia.org/wiki/Integrated_development_environment) (IDE) widely used for Java development, but with an extensible plugin system that allows to customize it for other languages and usages.
2 4
3Using an IDE such as Eclipse provides many advantages over a plain text editor, such as: 5Using an IDE such as Eclipse provides many advantages over a plain text editor, such as:
@@ -81,4 +83,4 @@ We will now configure a make target that cleans the project and builds the keyma
816. Leave the other options checked and click <kbd>OK</kbd>. Your make target will now appear under the selected keyboard. 836. Leave the other options checked and click <kbd>OK</kbd>. Your make target will now appear under the selected keyboard.
827. (Optional) Toggle the <kbd>Hide Empty Folders</kbd> icon button above the targets tree to only show your build target. 847. (Optional) Toggle the <kbd>Hide Empty Folders</kbd> icon button above the targets tree to only show your build target.
838. Double-click the build target you created to trigger a build. 858. Double-click the build target you created to trigger a build.
849. Select the <kbd>Console</kbd> view at the bottom to view the running build. \ No newline at end of file 869. Select the <kbd>Console</kbd> view at the bottom to view the running build.
diff --git a/docs/faq.md b/docs/faq.md
index 0636d8b54..c46861030 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -1,31 +1,33 @@
1## READ FIRST 1# Frequently Asked Questions
2- **README** of top directory : https://github.com/tmk/tmk_keyboard/blob/master/README.md
3- **README** of target project(keyboard/converter) directory.
4 2
5Note that you'll need to read **both**. 3## What is QMK?
6 4
5[QMK](https://github.com/qmk), short for Quantum Mechanical Keyboard, is a group of people building tools for custom keyboards. We started with the [QMK firmware](https://github.com/qmk/qmk_firmware), a heavily modified fork of [TMK](https://github.com/tmk/tmk_keyboard).
7 6
8# Build 7## What Differences Are There Between QMK and TMK?
9- [[FAQ/Build]]
10 8
9TMK was originally designed and implemented by [Jun Wako](https://github.com/tmk). QMK started as [Jack Humbert's](https://github.com/jackhumbert) fork of TMK for the Planck. After a while Jack's fork had diverged quite a bit from TMK, and in 2015 Jack decided to rename his fork to QMK.
11 10
12# Keymap 11From a technical standpoint QMK builds upon TMK by adding several new features. Most notably QMK has expanded the number of available keycodes and uses these to implement advanced features like `S()`, `LCTL()`, and `MO()`. You can see a complete list of these keycodes in [Quantum Keycodes](quantum_keycodes.html).
13- [[FAQ/Keymap]]
14 12
13From a project and community management standpoint TMK prefers to have keyboards maintained in separate forks while QMK prefers to have keyboards maintained in one central repository.
15 14
16# Debug Console 15# Debug Console
17## hid_listen can't recognize device 16## hid_listen can't recognize device
18When debug console of your device is not ready you will see like this: 17When debug console of your device is not ready you will see like this:
19 18
20 Waiting for device:......... 19```
20Waiting for device:.........
21```
21 22
22once the device is pluged in then *hid_listen* finds it you will get this message: 23once the device is pluged in then *hid_listen* finds it you will get this message:
23 24
24 Waiting for new device:......................... 25```
25 Listening: 26Waiting for new device:.........................
27Listening:
28```
26 29
27Check if you can't get this 'Listening:' message: 30If you can't get this 'Listening:' message try building with `CONSOLE_ENABLE=yes` in [Makefile]
28- build with `CONSOLE_ENABLE=yes` in **Makefile**.
29 31
30You may need privilege to access the device on OS like Linux. 32You may need privilege to access the device on OS like Linux.
31- try `sudo hid_listen` 33- try `sudo hid_listen`
@@ -73,41 +75,13 @@ Without reset circuit you will have inconsistent reuslt due to improper initiali
73 75
74 76
75## Can't read column of matrix beyond 16 77## Can't read column of matrix beyond 16
76Use `1UL<<16` instead of `1<<16` in `read_cols()` in **matrix.h** when your columns goes beyond 16. 78Use `1UL<<16` instead of `1<<16` in `read_cols()` in [matrix.h] when your columns goes beyond 16.
77 79
78In C `1` means one of **int** type which is **16bit** in case of AVR so you can't shift left more than 15. You will get unexpected zero when you say `1<<16`. You have to use **unsigned long** type with `1UL`. 80In C `1` means one of [int] type which is [16bit] in case of AVR so you can't shift left more than 15. You will get unexpected zero when you say `1<<16`. You have to use [unsigned long] type with `1UL`.
79 81
80http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279 82http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279
81 83
82 84
83
84## Pull-up Resistor
85In some case converters needed to have pull-up resistors to work correctly. Place the resistor between VCC and signal line in parallel.
86
87For example:
88```
89Keyboard Conveter
90 ,------.
915V------+------|VCC |
92 | | |
93 R | |
94 | | |
95Signal--+------|PD0 |
96 | |
97GND------------|GND |
98 `------'
99R: 1K Ohm resistor
100```
101
102https://github.com/tmk/tmk_keyboard/issues/71
103
104
105## Arduino Micro's pin naming is confusing
106Note that Arduino Micro PCB marking is different from real AVR port name. D0 of Arduino Micro is not PD0, PD0 is D3. Check schematic yourself.
107http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
108
109
110
111## Bootloader jump doesn't work 85## Bootloader jump doesn't work
112Properly configure bootloader size in **Makefile**. With wrong section size bootloader won't probably start with **Magic command** and **Boot Magic**. 86Properly configure bootloader size in **Makefile**. With wrong section size bootloader won't probably start with **Magic command** and **Boot Magic**.
113``` 87```
@@ -157,20 +131,20 @@ https://github.com/tmk/tmk_keyboard/issues/179
157 131
158 132
159## Special Extra key doesn't work(System, Audio control keys) 133## Special Extra key doesn't work(System, Audio control keys)
160You need to define `EXTRAKEY_ENABLE` in **makefile** to use them in TMK. 134You need to define `EXTRAKEY_ENABLE` in `rules.mk` to use them in QMK.
135
161``` 136```
162EXTRAKEY_ENABLE = yes # Audio control and System control 137EXTRAKEY_ENABLE = yes # Audio control and System control
163``` 138```
164http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-60.html#p157919
165
166 139
167## Wakeup from sleep doesn't work 140## Wakeup from sleep doesn't work
141
168In Windows check `Allow this device to wake the computer` setting in Power **Management property** tab of **Device Manager**. Also check BIOS setting. 142In Windows check `Allow this device to wake the computer` setting in Power **Management property** tab of **Device Manager**. Also check BIOS setting.
169 143
170Pressing any key during sleep should wake host. 144Pressing any key during sleep should wake host.
171 145
172
173## Using Arduino? 146## Using Arduino?
147
174**Note that Arduino pin naming is different from actual chip.** For example, Arduino pin `D0` is not `PD0`. Check circuit with its schematics yourself. 148**Note that Arduino pin naming is different from actual chip.** For example, Arduino pin `D0` is not `PD0`. Check circuit with its schematics yourself.
175 149
176- http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf 150- http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf
@@ -235,4 +209,4 @@ https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
235## FLIP doesn't work 209## FLIP doesn't work
236### AtLibUsbDfu.dll not found 210### AtLibUsbDfu.dll not found
237Remove current driver and reinstall one FLIP provides from DeviceManager. 211Remove current driver and reinstall one FLIP provides from DeviceManager.
238http://imgur.com/a/bnwzy \ No newline at end of file 212http://imgur.com/a/bnwzy
diff --git a/docs/faq_build.md b/docs/faq_build.md
index ba8b52af1..ebe8caccd 100644
--- a/docs/faq_build.md
+++ b/docs/faq_build.md
@@ -1,5 +1,6 @@
1## READ FIRST 1# Frequently Asked Build Questions
2- https://github.com/qmk/qmk_firmware/blob/master/docs/build_guide.md 2
3This page covers questions about building QMK. If you have not yet you should read the [Build Guide](https://github.com/qmk/qmk_firmware/blob/master/docs/build_guide.md).
3 4
4In short, 5In short,
5 6
@@ -8,12 +9,10 @@ In short,
8 $ make [-f Makefile.<variant>] [KEYMAP=...] dfu 9 $ make [-f Makefile.<variant>] [KEYMAP=...] dfu
9 10
10 11
11## Can't program on Linux and Mac 12## Can't program on Linux
12You will need proper permission to operate a device. For Linux users see udev rules below. 13You will need proper permission to operate a device. For Linux users see udev rules below.
13Easy way is to use `sudo` command, if you are not familiar with this command check its manual with `man sudo` or this page on line. 14Easy way is to use `sudo` command, if you are not familiar with this command check its manual with `man sudo` or this page on line.
14 15
15https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/sudo.8.html
16
17In short when your controller is ATMega32u4, 16In short when your controller is ATMega32u4,
18 17
19 $ sudo dfu-programmer atmega32u4 erase --force 18 $ sudo dfu-programmer atmega32u4 erase --force
@@ -26,63 +25,14 @@ or just
26 25
27But to run `make` with root privilege is not good idea. Use former method as possible. 26But to run `make` with root privilege is not good idea. Use former method as possible.
28 27
29## Do 'make clean' before 'make'
30You'll need `make clean` after you edit **config.h** or change options like `KEYMAP`.
31
32Frist remove all files made in previous build,
33
34 $ make clean
35
36then build new firmware.
37
38 $ make [KEYMAP=...]
39
40Also you can always try `make clean` when you get other strange result during build.
41
42
43## WINAVR is obsolete 28## WINAVR is obsolete
44It is no longer recommended and may cause some problem. 29It is no longer recommended and may cause some problem.
45See [Issue #99](https://github.com/tmk/tmk_keyboard/issues/99). 30See [Issue #99](https://github.com/tmk/tmk_keyboard/issues/99).
46 31
47## USB stack: LUFA or PJRC?
48Use **LUFA**.
49
50**PJRC** stack won't be supported actively anymore. There is no reason to hesitate to use LUFA except for binary size(about 1KB lager?). But **PJRC** is still very useful for debug and development purpose.
51See also [Issue #50](https://github.com/tmk/tmk_keyboard/issues/50) and [Issue #58](https://github.com/tmk/tmk_keyboard/issues/58).
52
53## Edit configuration but not change
54You will need followings after editing `CONSOLE_ENABLE`, `NKRO_ENABLE`, `EXTRAKEY_ENABLE` or `MOUSEKEY_ENABLE` option in **Makefile**.
55
56### 1. make clean
57This will be needed when you edit **config.h**.
58
59### 2. Remove Drivers from Device Manager(Windows)
60**Windows only.** Linux, OSX and other OS's doesn't require this. It looks like Windows keeps using driver installed when device was connected first time even after the device changes its configuration. To load proper drivers for new configuration you need to remove existent drivers from **Drvice Manager**.
61
62### 3. Build with different VID:PID
63**Windows only.** If method 2. does't work fou you try this. Change Vendor ID or Product ID in **config.h** and build firmware. Windows should recognize it as whole new device and start drivers install process.
64
65### 4. Just try other ports
66This will be useful and the easiest workaround for **Windows**.
67
68
69
70## USB VID and PID 32## USB VID and PID
71You can use any ID you want with editing `config.h`. Using any presumably unused ID will be no problem in fact except for very least chance of collision with other product. 33You can use any ID you want with editing `config.h`. Using any presumably unused ID will be no problem in fact except for very least chance of collision with other product.
72 34
73For example TMK uses following numbers by default. 35Most boards in QMK use `0xFEED` as the vendor ID. You should look through other keyboards to make sure you pick a unique Product ID.
74```
75keyboard:
76hhkb: FEED:CAFE
77gh60: FEED:6060
78
79converter:
80x68k: FEED:6800
81ps2: FEED:6512
82adb: FEED:0ADB
83ibm4704: FEED:4704
84pc98: FEED:9898
85```
86 36
87Also see this. 37Also see this.
88https://github.com/tmk/tmk_keyboard/issues/150 38https://github.com/tmk/tmk_keyboard/issues/150
@@ -112,7 +62,6 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
112``` 62```
113 63
114 64
115
116## Cortex: cstddef: No such file or directory 65## Cortex: cstddef: No such file or directory
117GCC 4.8 of Ubuntu 14.04 had this problem and had to update to 4.9 with this PPA. 66GCC 4.8 of Ubuntu 14.04 had this problem and had to update to 4.9 with this PPA.
118https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded 67https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded
@@ -148,4 +97,4 @@ Note that Teensy2.0++ bootloader size is 2048byte. Some Makefiles may have wrong
148# LUFA bootloader 4096 97# LUFA bootloader 4096
149# USBaspLoader 2048 98# USBaspLoader 2048
150OPT_DEFS += -DBOOTLOADER_SIZE=2048 99OPT_DEFS += -DBOOTLOADER_SIZE=2048
151``` \ No newline at end of file 100```
diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md
index 623726ab2..d6442ac53 100644
--- a/docs/faq_keymap.md
+++ b/docs/faq_keymap.md
@@ -1,10 +1,13 @@
1## READ FIRST 1# Frequently Asked Keymap Questions
2https://github.com/tmk/tmk_core/blob/master/doc/keymap.md
3 2
4## How to get keycode 3This page covers questions people often have about keymaps. If you haven't you should read [Keymap Overview](keymap.html) first.
5See [Keycodes](Keycodes). Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
6 4
7## Sysrq key 5## What Keycodes Can I Use?
6See [Basic Keycodes](keycodes.html) and [Quantum Keycodes](quantum_keycodes.html) for most of the keys you can define.
7
8Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
9
10## `KC_SYSREQ` isn't working
8Use keycode for Print Screen(`KC_PSCREEN` or `KC_PSCR`) instead of `KC_SYSREQ`. Key combination of 'Alt + Print Screen' is recognized as 'System request'. 11Use keycode for Print Screen(`KC_PSCREEN` or `KC_PSCR`) instead of `KC_SYSREQ`. Key combination of 'Alt + Print Screen' is recognized as 'System request'.
9 12
10See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and 13See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and
@@ -16,7 +19,7 @@ Use `KC_PWR` instead of `KC_POWER` or vice versa.
16- `KC_PWR` works with Windows and Linux, not with OSX. 19- `KC_PWR` works with Windows and Linux, not with OSX.
17- `KC_POWER` works with OSX and Linux, not with Windows. 20- `KC_POWER` works with OSX and Linux, not with Windows.
18 21
19http://geekhack.org/index.php?topic=14290.msg1327264#msg1327264 22More info: http://geekhack.org/index.php?topic=14290.msg1327264#msg1327264
20 23
21## Oneshot modifier 24## Oneshot modifier
22Solves my personal 'the' problem. I often got 'the' or 'THe' wrongly instead of 'The'. Oneshot Shift mitgates this for me. 25Solves my personal 'the' problem. I often got 'the' or 'THe' wrongly instead of 'The'. Oneshot Shift mitgates this for me.
@@ -32,15 +35,17 @@ For Modifier keys and layer actions you have to place `KC_TRANS` on same positio
32 35
33 36
34## Mechanical Lock Switch Support 37## Mechanical Lock Switch Support
35https://github.com/tmk/tmk_keyboard#mechanical-locking-support
36
37This feature is for *mechanical lock switch* like this Alps one.
38http://deskthority.net/wiki/Alps_SKCL_Lock
39 38
40Using enabling this feature and using keycodes `LCAP`, `LNUM` or `LSCR` in keymap you can use physical locking CapsLock, NumLock or ScrollLock keys as you expected. 39This feature is for *mechanical lock switch* like [this Alps one](http://deskthority.net/wiki/Alps_SKCL_Lock). You can enable it by adding this to your `config.h`:
40
41```
42#define LOCKING_SUPPORT_ENABLE
43#define LOCKING_RESYNC_ENABLE
44```
41 45
42Old vintage mechanical keyboards occasionally have lock switches but modern ones don't have. ***You don't need this feature in most case and just use keycodes `CAPS`, `NLCK` and `SLCK`.*** 46After enabling this feature use keycodes `KC_LCAP`, `KC_LNUM` and `KC_LSCR` in your keymap instead.
43 47
48Old vintage mechanical keyboards occasionally have lock switches but modern ones don't have. ***You don't need this feature in most case and just use keycodes `KC_CAPS`, `KC_NLCK` and `KC_SLCK`.***
44 49
45## Input special charactors other than ASCII like Cédille 'Ç' 50## Input special charactors other than ASCII like Cédille 'Ç'
46NO UNIVERSAL METHOD TO INPUT THOSE WORKS OVER ALL SYSTEMS. You have to define **MACRO** in way specific to your OS or layout. 51NO UNIVERSAL METHOD TO INPUT THOSE WORKS OVER ALL SYSTEMS. You have to define **MACRO** in way specific to your OS or layout.
@@ -111,68 +116,12 @@ https://github.com/tekezo/Karabiner/issues/403
111 116
112## Esc and `~ on a key 117## Esc and `~ on a key
113 118
114You can define FC660 and Poker style ESC with `ACTION_LAYER_MODS`. 119Use `GRAVE_ESC` or `KC_GESC` in your keymap.
115https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
116
117```
118#include "keymap_common.h"
119
120
121/* Leopold FC660
122 * https://elitekeyboards.com/products.php?sub=leopold,compact&pid=fc660c
123 * Shift + Esc = ~
124 * Fn + Esc = `
125 *
126 * Votex Poker II
127 * https://adprice.fedorapeople.org/poker2_manual.pdf
128 * Fn + Esc = `
129 * Fn + Shift + Esc = ~
130 */
131const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
132 /* 0: qwerty */
133 [0] = KEYMAP( \
134 ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS,BSPC, \
135 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
136 LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \
137 FN0, NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,ESC, \
138 LCTL,LGUI,LALT, SPC, RALT,FN1, RGUI,RCTL),
139 [1] = KEYMAP( \
140 GRV, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
141 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
142 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
143 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
144 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
145 [2] = KEYMAP( \
146 GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS, \
147 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
148 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
149 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
150 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
151};
152
153const uint16_t PROGMEM fn_actions[] = {
154 // https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
155 [0] = ACTION_LAYER_MODS(1, MOD_LSFT),
156 [1] = ACTION_LAYER_MOMENTARY(2),
157};
158```
159
160Otherwise, you can write code, see this.
161https://github.com/p3lim/keyboard_firmware/commit/fd799c12b69a5ab5addd1d4c03380a1b8ef8e9dc
162
163
164## 32 Fn keys are not enough?
165### actionmap
166It uses 16 bit codes and has no limitation of 32 Fn at the expense of memory space. TMK keymap is actually is 8 bit codes as subset of the actionmap.
167https://github.com/tmk/tmk_keyboard/issues?utf8=%E2%9C%93&q=is%3Aissue+actionmap
168
169### extension for modified keys
170https://geekhack.org/index.php?topic=41989.msg1885526#msg1885526
171
172 120
173## Arrow on Right Modifier keys with Dual-Role 121## Arrow on Right Modifier keys with Dual-Role
174This turns right modifer keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**. 122This turns right modifer keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**.
175``` 123```
124
176#include "keymap_common.h" 125#include "keymap_common.h"
177 126
178 127
@@ -211,18 +160,16 @@ const uint16_t PROGMEM fn_actions[] = {
211 160
212``` 161```
213 162
214
215Dual-role key: https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys 163Dual-role key: https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
216 164
217 165
218## Eject on Mac OSX 166## Eject on Mac OSX
219`EJCT` keycode works on OSX. https://github.com/tmk/tmk_keyboard/issues/250 167`KC_EJCT` keycode works on OSX. https://github.com/tmk/tmk_keyboard/issues/250
220It seems Windows 10 ignores the code and Linux/Xorg recognizes but has no mapping by default. 168It seems Windows 10 ignores the code and Linux/Xorg recognizes but has no mapping by default.
221 169
222Not sure what keycode Eject is on genuine Apple keyboard actually. HHKB uses `F20` for Eject key(`Fn+f`) on Mac mode but this is not same as Apple Eject keycode probably. 170Not sure what keycode Eject is on genuine Apple keyboard actually. HHKB uses `F20` for Eject key(`Fn+f`) on Mac mode but this is not same as Apple Eject keycode probably.
223 171
224 172
225
226## What's weak_mods and real_mods in action_util.c 173## What's weak_mods and real_mods in action_util.c
227___TO BE IMPROVED___ 174___TO BE IMPROVED___
228 175
@@ -262,4 +209,3 @@ if (timer_elapsed(key_timer) < 100) {
262``` 209```
263 210
264It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in. 211It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in.
265
diff --git a/docs/glossary.md b/docs/glossary.md
index f69b1709b..fac1952a6 100644
--- a/docs/glossary.md
+++ b/docs/glossary.md
@@ -1,10 +1,29 @@
1# Glossary of QMK terms 1# Glossary of QMK terms
2 2
3git 3## Dynamic Macro
4: versioning software used at the commandline 4A macro which has been recorded on the keyboard and which will be lost when the keyboard is unplugged or the computer rebooted.
5 5
6keymap 6## git
7: an array of keycodes mapped to a physical keyboard layout, which are processed on key presses and releases 7Versioning software used at the commandline
8 8
9matrix 9## Keycode
10: a wiring pattern of columns and rows (and usually diodes) that enables the MCU to detect keypresses with a fewer number of pins \ No newline at end of file 10A 2-byte number that represents a particular key. `0x00`-`0xFF` are used for [Basic Keycodes](keycodes.html) while `0x100`-`0xFFFF` are used for [Quantum Keycodes](quantum_keycodes.html).
11
12## Keymap
13An array of keycodes mapped to a physical keyboard layout, which are processed on key presses and releases
14
15## Matrix
16A wiring pattern of columns and rows (and usually diodes) that enables the MCU to detect keypresses with a fewer number of pins
17
18## Macro
19A feature that lets you send muiltple keypress events (hid reports) after having pressed only a single key.
20
21## Mousekeys
22A feature that lets you control your mouse cursor and click from your keyboard.
23
24* [Mousekeys Documentation](mouse_keys.html)
25
26## Tap Dance
27A feature that lets you assign muiltple keycodes to the same key based on how many times you press it.
28
29* [Tap Dance Documentation](tap_dance.html)
diff --git a/docs/key_functions.md b/docs/key_functions.md
index 74b80b42f..8a579f305 100644
--- a/docs/key_functions.md
+++ b/docs/key_functions.md
@@ -2,20 +2,18 @@
2 2
3Your keymap can include shortcuts to common operations (called "function actions" in tmk). 3Your keymap can include shortcuts to common operations (called "function actions" in tmk).
4 4
5These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk `ACTION_*` functions, please see the [TMK documentation](keymap.md#2-action). 5These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the qmk `ACTION_*` functions, please see the [Keymap documentation](keymap.md#2-action).
6 6
7Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - the benefit here is being able to use more than 32 function actions (up to 4096), if you happen to need them. 7Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - the benefit here is being able to use more than 32 function actions (up to 4096), if you happen to need them.
8 8
9### Limits of these aliases 9## Limits of these aliases
10 10
11Currently, the keycodes able to used with these functions are limited to the TMK ones, meaning you can't use keycodes like `KC_TILD`, or anything greater than 0xFF. For a full list of the keycodes able to be used, [see this list](keycode.txt). 11Currently, the keycodes able to used with these functions are limited to the [Basic Keycodes](keycodes.html), meaning you can't use keycodes like `KC_TILD`, or anything greater than 0xFF. For a full list of the keycodes able to be used, [see this list](keycodes.html).
12 12
13### Switching and toggling layers 13# Switching and toggling layers
14 14
15`MO(layer)` - momentary switch to *layer*. As soon as you let go of the key, the layer is deactivated and you pop back out to the previous layer. When you apply this to a key, that same key must be set as `KC_TRNS` on the destination layer. Otherwise, you won't make it back to the original layer when you release the key (and you'll get a keycode sent). You can only switch to layers *above* your current layer. If you're on layer 0 and you use `MO(1)`, that will switch to layer 1 just fine. But if you include `MO(3)` on layer 5, that won't do anything for you -- because layer 3 is lower than layer 5 on the stack. 15`MO(layer)` - momentary switch to *layer*. As soon as you let go of the key, the layer is deactivated and you pop back out to the previous layer. When you apply this to a key, that same key must be set as `KC_TRNS` on the destination layer. Otherwise, you won't make it back to the original layer when you release the key (and you'll get a keycode sent). You can only switch to layers *above* your current layer. If you're on layer 0 and you use `MO(1)`, that will switch to layer 1 just fine. But if you include `MO(3)` on layer 5, that won't do anything for you -- because layer 3 is lower than layer 5 on the stack.
16 16
17`OSL(layer)` - momentary switch to *layer*, as a one-shot operation. So if you have a key that's defined as `OSL(1)`, and you tap that key, then only the very next keystroke would come from layer 1. You would drop back to layer zero immediately after that one keystroke. That's handy if you have a layer full of custom shortcuts -- for example, a dedicated key for closing a window. So you tap your one-shot layer mod, then tap that magic 'close window' key, and keep typing like a boss. Layer 1 would remain active as long as you hold that key down, too (so you can use it like a momentary toggle-layer key with extra powers).
18
19`LT(layer, kc)` - momentary switch to *layer* when held, and *kc* when tapped. Like `MO()`, this only works upwards in the layer stack (`layer` must be higher than the current layer). 17`LT(layer, kc)` - momentary switch to *layer* when held, and *kc* when tapped. Like `MO()`, this only works upwards in the layer stack (`layer` must be higher than the current layer).
20 18
21`TG(layer)` - toggles a layer on or off. As with `MO()`, you should set this key as `KC_TRNS` in the destination layer so that tapping it again actually toggles back to the original layer. Only works upwards in the layer stack. 19`TG(layer)` - toggles a layer on or off. As with `MO()`, you should set this key as `KC_TRNS` in the destination layer so that tapping it again actually toggles back to the original layer. Only works upwards in the layer stack.
@@ -25,7 +23,7 @@ Currently, the keycodes able to used with these functions are limited to the TMK
25`TT(layer)` - Layer Tap-Toggle. If you hold the key down, the layer becomes active, and then deactivates when you let go. And if you tap it, the layer simply becomes active (toggles on). It needs 5 taps by default, but you can set it by defining `TAPPING_TOGGLE`, for example, `#define TAPPING_TOGGLE 1` for just one tap. 23`TT(layer)` - Layer Tap-Toggle. If you hold the key down, the layer becomes active, and then deactivates when you let go. And if you tap it, the layer simply becomes active (toggles on). It needs 5 taps by default, but you can set it by defining `TAPPING_TOGGLE`, for example, `#define TAPPING_TOGGLE 1` for just one tap.
26 24
27 25
28### Fun with modifier keys 26# Modifier keys
29 27
30* `LSFT(kc)` - applies left Shift to *kc* (keycode) - `S(kc)` is an alias 28* `LSFT(kc)` - applies left Shift to *kc* (keycode) - `S(kc)` is an alias
31* `RSFT(kc)` - applies right Shift to *kc* 29* `RSFT(kc)` - applies right Shift to *kc*
@@ -43,6 +41,8 @@ You can also chain these, like this:
43 41
44 LALT(LCTL(KC_DEL)) -- this makes a key that sends Alt, Control, and Delete in a single keypress. 42 LALT(LCTL(KC_DEL)) -- this makes a key that sends Alt, Control, and Delete in a single keypress.
45 43
44# Shifted Keycodes
45
46The following shortcuts automatically add `LSFT()` to keycodes to get commonly used symbols. Their long names are also available and documented in `quantum/quantum_keycodes.h`. 46The following shortcuts automatically add `LSFT()` to keycodes to get commonly used symbols. Their long names are also available and documented in `quantum/quantum_keycodes.h`.
47 47
48 KC_TILD ~ 48 KC_TILD ~
@@ -67,8 +67,15 @@ The following shortcuts automatically add `LSFT()` to keycodes to get commonly u
67 KC_PIPE | 67 KC_PIPE |
68 KC_COLN : 68 KC_COLN :
69 69
70# One Shot
71
70`OSM(mod)` - this is a "one shot" modifier. So let's say you have your left Shift key defined as `OSM(MOD_LSFT)`. Tap it, let go, and Shift is "on" -- but only for the next character you'll type. So to write "The", you don't need to hold down Shift -- you tap it, tap t, and move on with life. And if you hold down the left Shift key, it just works as a left Shift key, as you would expect (so you could type THE). There's also a magical, secret way to "lock" a modifier by tapping it multiple times. If you want to learn more about that, open an issue. :) 72`OSM(mod)` - this is a "one shot" modifier. So let's say you have your left Shift key defined as `OSM(MOD_LSFT)`. Tap it, let go, and Shift is "on" -- but only for the next character you'll type. So to write "The", you don't need to hold down Shift -- you tap it, tap t, and move on with life. And if you hold down the left Shift key, it just works as a left Shift key, as you would expect (so you could type THE). There's also a magical, secret way to "lock" a modifier by tapping it multiple times. If you want to learn more about that, open an issue. :)
71 73
74`OSL(layer)` - momentary switch to *layer*, as a one-shot operation. So if you have a key that's defined as `OSL(1)`, and you tap that key, then only the very next keystroke would come from layer 1. You would drop back to layer zero immediately after that one keystroke. That's handy if you have a layer full of custom shortcuts -- for example, a dedicated key for closing a window. So you tap your one-shot layer mod, then tap that magic 'close window' key, and keep typing like a boss. Layer 1 would remain active as long as you hold that key down, too (so you can use it like a momentary toggle-layer key with extra powers).
75
76
77# Mod Tap
78
72`MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down. 79`MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down.
73 80
74These are the values you can use for the `mod` in `MT()` and `OSM()`: 81These are the values you can use for the `mod` in `MT()` and `OSM()`:
@@ -97,7 +104,7 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac
97 * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped 104 * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped
98 * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift. 105 * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift.
99 106
100##### Permissive Hold 107# Permissive Hold
101 108
102As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option: 109As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option:
103 110
diff --git a/docs/macros.md b/docs/macros.md
index 1418d24ab..3d5b05b4a 100644
--- a/docs/macros.md
+++ b/docs/macros.md
@@ -1,8 +1,10 @@
1# Macros - Send multiple keystrokes when pressing just one key 1# Macros
2 2
3QMK has a number of ways to define and use macros. These can do anything you want- type common phrases for you, copypasta, repetitive game movements, or even help you code. 3Macros allow you to send multiple keystrokes when pressing just one key. QMK has a number of ways to define and use macros. These can do anything you want- type common phrases for you, copypasta, repetitive game movements, or even help you code.
4 4
5{% hint style='danger' %}
5**Security Note**: While it is possible to use macros to send passwords, credit card numbers, and other sensitive information it is a supremely bad idea to do so. Anyone who gets ahold of your keyboard will be able to access that information by opening a text editor. 6**Security Note**: While it is possible to use macros to send passwords, credit card numbers, and other sensitive information it is a supremely bad idea to do so. Anyone who gets ahold of your keyboard will be able to access that information by opening a text editor.
7{% endhint %}
6 8
7# Macro Definitions 9# Macro Definitions
8 10
@@ -135,7 +137,7 @@ This will clear all mods currently pressed.
135 137
136This will clear all keys besides the mods currently pressed. 138This will clear all keys besides the mods currently pressed.
137 139
138# Advanced Example: Single-key copy/paste (hold to copy, tap to paste) 140# Advanced Example: Single-key copy/paste
139 141
140This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V` when released. 142This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V` when released.
141 143
diff --git a/docs/make_instructions.md b/docs/make_instructions.md
index 6f88f9106..64c1cb0f0 100644
--- a/docs/make_instructions.md
+++ b/docs/make_instructions.md
@@ -48,7 +48,7 @@ Here are some examples commands
48* `make ergodox-infinity-algernon-clean` will clean the build output of the Ergodox Infinity keyboard. This example uses the full syntax and can be run from any folder with a `Makefile` 48* `make ergodox-infinity-algernon-clean` will clean the build output of the Ergodox Infinity keyboard. This example uses the full syntax and can be run from any folder with a `Makefile`
49* `make dfu COLOR=false` from within a keymap folder, builds and uploads the keymap, but without color output. 49* `make dfu COLOR=false` from within a keymap folder, builds and uploads the keymap, but without color output.
50 50
51## The `Makefile` 51# The `Makefile`
52 52
53There are 5 different `make` and `Makefile` locations: 53There are 5 different `make` and `Makefile` locations:
54 54
@@ -62,7 +62,7 @@ The root contains the code used to automatically figure out which keymap or keym
62 62
63For keyboards and subprojects, the make files are split in two parts `Makefile` and `rules.mk`. All settings can be found in the `rules.mk` file, while the `Makefile` is just there for support and including the root `Makefile`. Keymaps contain just one `Makefile` for simplicity. 63For keyboards and subprojects, the make files are split in two parts `Makefile` and `rules.mk`. All settings can be found in the `rules.mk` file, while the `Makefile` is just there for support and including the root `Makefile`. Keymaps contain just one `Makefile` for simplicity.
64 64
65### Makefile options 65## Makefile options
66 66
67Set these variables to `no` to disable them, and `yes` to enable them. 67Set these variables to `no` to disable them, and `yes` to enable them.
68 68
@@ -158,7 +158,7 @@ This enables using the Quantum SYSEX API to send strings (somewhere?)
158 158
159This consumes about 5390 bytes. 159This consumes about 5390 bytes.
160 160
161### Customizing Makefile options on a per-keymap basis 161## Customizing Makefile options on a per-keymap basis
162 162
163If your keymap directory has a file called `Makefile` (note the filename), any Makefile options you set in that file will take precedence over other Makefile options for your particular keyboard. 163If your keymap directory has a file called `Makefile` (note the filename), any Makefile options you set in that file will take precedence over other Makefile options for your particular keyboard.
164 164
diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md
index e9edad03e..a59d8fbc8 100644
--- a/docs/quantum_keycodes.md
+++ b/docs/quantum_keycodes.md
@@ -4,7 +4,7 @@ All keycodes within quantum are numbers between `0x0000` and `0xFFFF`. Within yo
4 4
5On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are used to implement advanced quantum features. If you define your own custom keycodes they will be put into this range as well. Keycodes above `0x00FF` may not be used with any of the mod/layer-tap keys listed 5On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are used to implement advanced quantum features. If you define your own custom keycodes they will be put into this range as well. Keycodes above `0x00FF` may not be used with any of the mod/layer-tap keys listed
6 6
7# Quantum keycodes 7## QMK keycodes
8 8
9|Name|Description| 9|Name|Description|
10|----|-----------| 10|----|-----------|
@@ -18,7 +18,7 @@ On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are
18|`M(n)`|to call macro n| 18|`M(n)`|to call macro n|
19|`MACROTAP(n)`|to macro-tap n idk FIXME| 19|`MACROTAP(n)`|to macro-tap n idk FIXME|
20 20
21# Bootmagic Keycodes 21## Bootmagic Keycodes
22 22
23Shortcuts for bootmagic options (these work even when bootmagic is off.) 23Shortcuts for bootmagic options (these work even when bootmagic is off.)
24 24
@@ -44,7 +44,7 @@ Shortcuts for bootmagic options (these work even when bootmagic is off.)
44|`MAGIC_UNSWAP_ALT_GUI`/`AG_NORM`|Disable the Alt/GUI switching| 44|`MAGIC_UNSWAP_ALT_GUI`/`AG_NORM`|Disable the Alt/GUI switching|
45|`MAGIC_TOGGLE_NKRO`|Turn NKRO on or off| 45|`MAGIC_TOGGLE_NKRO`|Turn NKRO on or off|
46 46
47# Audio 47## Audio
48 48
49```c 49```c
50#ifdef AUDIO_ENABLE 50#ifdef AUDIO_ENABLE
@@ -69,7 +69,7 @@ Shortcuts for bootmagic options (these work even when bootmagic is off.)
69#endif 69#endif
70``` 70```
71 71
72## Midi 72### Midi
73 73
74#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) 74#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
75 MI_ON, // send midi notes when music mode is enabled 75 MI_ON, // send midi notes when music mode is enabled
@@ -157,7 +157,7 @@ MI_MODSD, // decrease modulation speed
157MI_MODSU, // increase modulation speed 157MI_MODSU, // increase modulation speed
158#endif // MIDI_ADVANCED 158#endif // MIDI_ADVANCED
159 159
160# Backlight 160## Backlight
161 161
162These keycodes control the backlight. Most keyboards use this for single color in-switch lighting. 162These keycodes control the backlight. Most keyboards use this for single color in-switch lighting.
163 163
@@ -171,7 +171,7 @@ These keycodes control the backlight. Most keyboards use this for single color i
171|`BL_TOGG`|Toggle the backlight on or off| 171|`BL_TOGG`|Toggle the backlight on or off|
172|`BL_STEP`|Step through backlight levels, wrapping around to 0 when you reach the top.| 172|`BL_STEP`|Step through backlight levels, wrapping around to 0 when you reach the top.|
173 173
174# RGBLIGHT WS2818 LEDs 174## RGBLIGHT WS2818 LEDs
175 175
176This controls the `RGBLIGHT` functionality. Most keyboards use WS2812 (and compatible) LEDs for underlight or case lighting. 176This controls the `RGBLIGHT` functionality. Most keyboards use WS2812 (and compatible) LEDs for underlight or case lighting.
177 177
@@ -203,7 +203,7 @@ This is used when multiple keyboard outputs can be selected. Currently this only
203|`OUT_USB`|usb only| 203|`OUT_USB`|usb only|
204|`OUT_BT`|bluetooth (when `BLUETOOTH_ENABLE`)| 204|`OUT_BT`|bluetooth (when `BLUETOOTH_ENABLE`)|
205 205
206# Modifiers 206## Modifiers
207 207
208These are special keycodes that simulate pressing several modifiers at once. 208These are special keycodes that simulate pressing several modifiers at once.
209 209
@@ -219,7 +219,7 @@ These are special keycodes that simulate pressing several modifiers at once.
219 * |`KC_LCA`|`LCTL` + `LALT`| 219 * |`KC_LCA`|`LCTL` + `LALT`|
220 */ 220 */
221 221
222## Modifiers with keys 222### Modifiers with keys
223 223
224|Name|Description| 224|Name|Description|
225|----|-----------| 225|----|-----------|
@@ -238,7 +238,7 @@ These are special keycodes that simulate pressing several modifiers at once.
238|`SCMD(kc)`/`SWIN(kc)`|`LGUI` + `LSFT` + `kc`| 238|`SCMD(kc)`/`SWIN(kc)`|`LGUI` + `LSFT` + `kc`|
239|`LCA(kc)`|`LCTL` + `LALT` + `kc`| 239|`LCA(kc)`|`LCTL` + `LALT` + `kc`|
240 240
241## One Shot Keys 241### One Shot Keys
242 242
243Most modifiers work by being held down while you push another key. You can use `OSM()` to setup a "One Shot" modifier. When you tap a one shot mod it will remain is a pressed state until you press another key. 243Most modifiers work by being held down while you push another key. You can use `OSM()` to setup a "One Shot" modifier. When you tap a one shot mod it will remain is a pressed state until you press another key.
244 244
@@ -249,7 +249,7 @@ To specify a your modifier you need to pass the `MOD` form of the key. For examp
249|`OSM(mod)`|use mod for one keypress| 249|`OSM(mod)`|use mod for one keypress|
250|`OSL(layer)`|switch to layer for one keypress| 250|`OSL(layer)`|switch to layer for one keypress|
251 251
252## Mod-tap keys 252### Mod-tap keys
253 253
254These keycodes will press the mod(s) when held, and the key when tapped. They only work with [basic keycodes](basic_keycodes.md). 254These keycodes will press the mod(s) when held, and the key when tapped. They only work with [basic keycodes](basic_keycodes.md).
255 255
@@ -271,7 +271,7 @@ These keycodes will press the mod(s) when held, and the key when tapped. They on
271|`SCMD_T(kc)`/`SWIN_T(kc)`|`LGUI` + `LSFT` when held, `kc` when tapped| 271|`SCMD_T(kc)`/`SWIN_T(kc)`|`LGUI` + `LSFT` when held, `kc` when tapped|
272|`LCA_T(kc)`|`LCTL` + `LALT` when held, `kc` when tapped| 272|`LCA_T(kc)`|`LCTL` + `LALT` when held, `kc` when tapped|
273 273
274# US ANSI Shifted symbols 274## US ANSI Shifted symbols
275 275
276These keycodes correspond to characters that are "shifted" on a standard US ANSI keyboards. They do not have dedicated keycodes but are instead typed by holding down shift and then sending a keycode. 276These keycodes correspond to characters that are "shifted" on a standard US ANSI keyboards. They do not have dedicated keycodes but are instead typed by holding down shift and then sending a keycode.
277 277
@@ -301,7 +301,7 @@ It's important to remember that all of these keycodes send a left shift - this m
301|`KC_QUES`|`KC_QUESTION`|question mark `?`| 301|`KC_QUES`|`KC_QUESTION`|question mark `?`|
302|`KC_DQT`/`KC_DQUO`|`KC_DOUBLE_QUOTE`|double quote `"`| 302|`KC_DQT`/`KC_DQUO`|`KC_DOUBLE_QUOTE`|double quote `"`|
303 303
304# Layer Changes 304## Layer Changes
305 305
306These are keycodes that can be used to change the current layer. 306These are keycodes that can be used to change the current layer.
307 307
@@ -315,7 +315,7 @@ These are keycodes that can be used to change the current layer.
315|`TT(layer)`|tap toggle? idk FIXME| 315|`TT(layer)`|tap toggle? idk FIXME|
316|`OSL(layer)`|switch to layer for one keycode| 316|`OSL(layer)`|switch to layer for one keycode|
317 317
318# Unicode 318## Unicode
319 319
320These keycodes can be used in conjuction with the [Unicode](unicode_and_additional_language_support.md) support. 320These keycodes can be used in conjuction with the [Unicode](unicode_and_additional_language_support.md) support.
321 321
diff --git a/docs/tap_dance.md b/docs/tap_dance.md
index 25827a648..38b2ee999 100644
--- a/docs/tap_dance.md
+++ b/docs/tap_dance.md
@@ -1,5 +1,7 @@
1# Tap Dance: A single key can do 3, 5, or 100 different things 1# Tap Dance: A single key can do 3, 5, or 100 different things
2 2
3<!-- FIXME: Break this up into multiple sections -->
4
3Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/qmk/qmk_firmware/pull/451). Here's how algernon describes the feature: 5Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/qmk/qmk_firmware/pull/451). Here's how algernon describes the feature:
4 6
5With this feature one can specify keys that behave differently, based on the amount of times they have been tapped, and when interrupted, they get handled before the interrupter. 7With this feature one can specify keys that behave differently, based on the amount of times they have been tapped, and when interrupted, they get handled before the interrupter.
@@ -34,7 +36,9 @@ Our next stop is `matrix_scan_tap_dance()`. This handles the timeout of tap-danc
34 36
35For the sake of flexibility, tap-dance actions can be either a pair of keycodes, or a user function. The latter allows one to handle higher tap counts, or do extra things, like blink the LEDs, fiddle with the backlighting, and so on. This is accomplished by using an union, and some clever macros. 37For the sake of flexibility, tap-dance actions can be either a pair of keycodes, or a user function. The latter allows one to handle higher tap counts, or do extra things, like blink the LEDs, fiddle with the backlighting, and so on. This is accomplished by using an union, and some clever macros.
36 38
37### Examples 39# Examples
40
41## Simple Example
38 42
39Here's a simple example for a single definition: 43Here's a simple example for a single definition:
40 44
@@ -59,6 +63,8 @@ qk_tap_dance_action_t tap_dance_actions[] = {
59TD(TD_ESC_CAPS) 63TD(TD_ESC_CAPS)
60``` 64```
61 65
66## Complex Example
67
62Here's a more complex example involving custom actions: 68Here's a more complex example involving custom actions:
63 69
64```c 70```c
diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md
index f01d50416..28927f0ef 100644
--- a/docs/understanding_qmk.md
+++ b/docs/understanding_qmk.md
@@ -1,7 +1,5 @@
1# Understanding QMK's Code 1# Understanding QMK's Code
2 2
3<!-- toc -->
4
5This document attempts to explain how the QMK firmware works from a very high level. It assumes you understand basic programming concepts but does not (except where needed to demonstrate) assume familiarity with C. It assumes that you have a basic understanding of the following documents: 3This document attempts to explain how the QMK firmware works from a very high level. It assumes you understand basic programming concepts but does not (except where needed to demonstrate) assume familiarity with C. It assumes that you have a basic understanding of the following documents:
6 4
7* [QMK Overview](qmk_overview.md) 5* [QMK Overview](qmk_overview.md)
@@ -12,45 +10,27 @@ This document attempts to explain how the QMK firmware works from a very high le
12 10
13You can think of QMK as no different from any other computer program. It is started, performs its tasks, and then ends. The entry point for the program is the `main()` function, just like it is on any other C program. However, for a newcomer to QMK it can be confusing because the `main()` function appears in multiple places, and it can be hard to tell which one to look at. 11You can think of QMK as no different from any other computer program. It is started, performs its tasks, and then ends. The entry point for the program is the `main()` function, just like it is on any other C program. However, for a newcomer to QMK it can be confusing because the `main()` function appears in multiple places, and it can be hard to tell which one to look at.
14 12
15The reason for this is the different platforms that QMK supports. The most common platform is `lufa`, which runs on AVR processors such at the atmega32u4. We also support `chibios`, `pjrc`, `vusb`, and `bluefruit`, and may support more in the future. 13The reason for this is the different platforms that QMK supports. The most common platform is `lufa`, which runs on AVR processors such at the atmega32u4. We also support `chibios` and `vusb`.
16 14
17Let's focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1129). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1182). This is [The Main Loop](#the_main_loop). 15We'll focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1129). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1182). This is [The Main Loop](#the_main_loop).
18 16
19## The Main Loop 17## The Main Loop
20 18
21This section of code is called "The Main Loop" because it's responsible for looping over the same set of instructions forever. This is where QMK dispatches out to the functions responsible for making the keyboard do everything it is supposed to. At first glance it can look like a lot of functionality but most of the time the code will be disabled by `#define`'s. 19This section of code is called "The Main Loop" because it's responsible for looping over the same set of instructions forever. This is where QMK dispatches out to the functions responsible for making the keyboard do everything it is supposed to do. At first glance it can look like a lot of functionality but most of the time the code will be disabled by `#define`'s.
22
23### USB Suspend
24
25```
26 #if !defined(NO_USB_STARTUP_CHECK)
27 while (USB_DeviceState == DEVICE_STATE_Suspended) {
28 print("[s]");
29 suspend_power_down();
30 if (USB_Device_RemoteWakeupEnabled && suspend_wakeup_condition()) {
31 USB_Device_SendRemoteWakeup();
32 }
33 }
34 #endif
35```
36
37This section of code handles the USB suspend state. This state is entered when the computer the keyboard is plugged into is suspended. In this state we don't do anything but wait for the computer we're plugged into to wake up.
38
39### `keyboard_task()`
40 20
41``` 21```
42 keyboard_task(); 22 keyboard_task();
43``` 23```
44 24
45This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keyboard.c#L154), and it is responsible for detecting changes in the matrix and turning LED's on and off. 25This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keyboard.c#L154), and it is responsible for detecting changes in the matrix and turning status LED's on and off.
46 26
47Within `keyboard_task()` you'll find code to handle: 27Within `keyboard_task()` you'll find code to handle:
48 28
49* Matrix Scanning 29* [Matrix Scanning](#matrix-scanning)
50* Mouse Handling 30* Mouse Handling
51* Serial Link(s) 31* Serial Link(s)
52* Visualizer 32* Visualizer
53* Keyboard state LED's (Caps Lock, Num Lock, Scroll Lock) 33* Keyboard status LED's (Caps Lock, Num Lock, Scroll Lock)
54 34
55#### Matrix Scanning 35#### Matrix Scanning
56 36
@@ -60,18 +40,18 @@ While there are different strategies for doing the actual matrix detection, they
60 40
61 41
62``` 42```
63 { 43{
64 {0,0,0,0}, 44 {0,0,0,0},
65 {0,0,0,0}, 45 {0,0,0,0},
66 {0,0,0,0}, 46 {0,0,0,0},
67 {0,0,0,0}, 47 {0,0,0,0},
68 {0,0,0,0} 48 {0,0,0,0}
69 } 49}
70``` 50```
71 51
72That datastructure is a direct representation of the matrix for a 4 row by 5 column numpad. When a key is pressed that key's position within the matrix will be returned as `1` instead of `0`. 52That datastructure is a direct representation of the matrix for a 4 row by 5 column numpad. When a key is pressed that key's position within the matrix will be returned as `1` instead of `0`.
73 53
74Matrix Scanning runs many times per second. The exact rate varies but typically it runs at least 10 times per second to avoid perceptable lag. 54Matrix Scanning runs many times per second. The exact rate varies but typically it runs at least 10 times per second to avoid perceptible lag.
75 55
76##### Matrix to Physical Layout Map 56##### Matrix to Physical Layout Map
77 57
@@ -114,67 +94,65 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
114} 94}
115``` 95```
116 96
117Notice how all of these arguments match up with the first half of the `KEYMAP()` macro from the last section? This is basically where we take a keycode and map it to our Matrix Scan from earlier. 97Notice how all of these arguments match up with the first half of the `KEYMAP()` macro from the last section? This is how we take a keycode and map it to our Matrix Scan from earlier.
118 98
119##### State Change Detection 99##### State Change Detection
120 100
121The matrix scanning described above tells us the state of the matrix at a given moment, but your computer only wants to know about changes, it doesn't care about the current state. QMK stores the results from the last matrix scan and compares the results from this matrix to determine when a key has been pressed or released. 101The matrix scanning described above tells us the state of the matrix at a given moment, but your computer only wants to know about changes, it doesn't care about the current state. QMK stores the results from the last matrix scan and compares the results from this matrix to determine when a key has been pressed or released.
122 102
123Let's look at an example. We'll hop into the middle of a keyboard scanning look to find that our previous scan looks like this: 103Let's look at an example. We'll hop into the middle of a keyboard scanning loop to find that our previous scan looks like this:
124 104
125``` 105```
126 { 106{
127 {0,0,0,0}, 107 {0,0,0,0},
128 {0,0,0,0}, 108 {0,0,0,0},
129 {0,0,0,0}, 109 {0,0,0,0},
130 {0,0,0,0}, 110 {0,0,0,0},
131 {0,0,0,0} 111 {0,0,0,0}
132 } 112}
133``` 113```
134 114
135And when our current scan completes it will look like this: 115And when our current scan completes it will look like this:
136 116
137``` 117```
138 { 118{
139 {1,0,0,0}, 119 {1,0,0,0},
140 {0,0,0,0}, 120 {0,0,0,0},
141 {0,0,0,0}, 121 {0,0,0,0},
142 {0,0,0,0}, 122 {0,0,0,0},
143 {0,0,0,0} 123 {0,0,0,0}
144 } 124}
145``` 125```
146 126
147Comparing against our keymap we can see that the pressed key is KC_NLCK. From here we dispatch to the `process_record` set of functions. 127Comparing against our keymap we can see that the pressed key is KC_NLCK. From here we dispatch to the `process_record` set of functions.
148 128
149(FIXME: Feels like this section could be fleshed out more.) 129<!-- FIXME: Magic happens between here and process_record -->
150
151(FIXME: Magic happens between here and process_record)
152 130
153##### Process Record 131##### Process Record
154 132
155The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events looks something like this: 133The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is described below, using cluecard whenever we need to look at the keyboard/keymap level functions.
156 134
157* `void process_record(keyrecord_t *record)` 135* [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L128)
158 * `bool process_record_quantum(keyrecord_t *record)` 136 * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L140)
159 * Map this record to a keycode 137 * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L143)
160 * `bool process_record_kb(uint16_t keycode, keyrecord_t *record)` 138 * [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/keyboards/cluecard/cluecard.c#L20)
161 * `bool process_record_user(uint16_t keycode, keyrecord_t *record)` 139 * [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/keyboards/cluecard/keymaps/default/keymap.c#L58)
162 * `bool process_midi(uint16_t keycode, keyrecord_t *record)` 140 * [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_midi.c#L102)
163 * `bool process_audio(uint16_t keycode, keyrecord_t *record)` 141 * [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_audio.c#L10)
164 * `bool process_music(uint16_t keycode, keyrecord_t *record)` 142 * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_music.c#L69)
165 * `bool process_tap_dance(uint16_t keycode, keyrecord_t *record)` 143 * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_tap_dance.c#L75)
166 * `bool process_leader(uint16_t keycode, keyrecord_t *record)` 144 * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_leader.c#L32)
167 * `bool process_chording(uint16_t keycode, keyrecord_t *record)` 145 * [`bool process_chording(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_chording.c#L41)
168 * `bool process_combo(uint16_t keycode, keyrecord_t *record)` 146 * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_combo.c#L115)
169 * `bool process_unicode(uint16_t keycode, keyrecord_t *record)` 147 * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode.c#L22)
170 * `bool process_ucis(uint16_t keycode, keyrecord_t *record)` 148 * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_ucis.c#L91)
171 * `bool process_printer(uint16_t keycode, keyrecord_t *record)` 149 * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_printer.c#L77)
172 * `bool process_unicode_map(uint16_t keycode, keyrecord_t *record)` 150 * [`bool process_unicode_map(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicodemap.c#L47)
173 * Identify and process quantum specific keycodes 151 * [Identify and process quantum specific keycodes](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L211)
174 * Identify and process standard keycodes
175 152
176At any step during this chain of events a function (such as `process_record_kb()`) can `return false` and processing of that keypress will end immediately. 153At any step during this chain of events a function (such as `process_record_kb()`) can `return false` to halt all further processing.
177 154
155<!--
178#### Mouse Handling 156#### Mouse Handling
179 157
180FIXME: This needs to be written 158FIXME: This needs to be written
@@ -190,3 +168,5 @@ FIXME: This needs to be written
190#### Keyboard state LED's (Caps Lock, Num Lock, Scroll Lock) 168#### Keyboard state LED's (Caps Lock, Num Lock, Scroll Lock)
191 169
192FIXME: This needs to be written 170FIXME: This needs to be written
171
172-->