mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-11-22 00:16:41 +06:00
Convert all headings to Title Case
This commit is contained in:
parent
6eb89ae906
commit
7b0356d1d4
|
@ -4,13 +4,13 @@
|
|||
|
||||
QMK (*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.
|
||||
|
||||
## How to get it {#how-to-get-it}
|
||||
## How to Get It {#how-to-get-it}
|
||||
|
||||
If 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.
|
||||
|
||||
Otherwise, 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`).
|
||||
|
||||
## How to compile {#how-to-compile}
|
||||
## How to Compile {#how-to-compile}
|
||||
|
||||
Before you are able to compile, you'll need to [install an environment](getting_started_build_tools.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:
|
||||
|
||||
|
@ -20,6 +20,6 @@ This would build the `rev4` revision of the `planck` with the `default` keymap.
|
|||
|
||||
make preonic:default
|
||||
|
||||
## How to customize {#how-to-customize}
|
||||
## How to Customize {#how-to-customize}
|
||||
|
||||
QMK has lots of [features](features.md) to explore, and a good deal of [reference documentation](http://docs.qmk.fm) to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md).
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
* [Getting started](README.md)
|
||||
* [Getting Started](README.md)
|
||||
* [QMK Introduction](getting_started_introduction.md)
|
||||
* [Install Build Tools](getting_started_build_tools.md)
|
||||
* Alternative: [Vagrant Guide](getting_started_vagrant.md)
|
||||
* [Build/Compile instructions](getting_started_make_guide.md)
|
||||
* [Flashing instructions](flashing.md)
|
||||
* [Build/Compile Instructions](getting_started_make_guide.md)
|
||||
* [Flashing Instructions](flashing.md)
|
||||
* [Contributing to QMK](contributing.md)
|
||||
* [How to Use Github](getting_started_github.md)
|
||||
|
||||
|
@ -31,9 +31,9 @@
|
|||
* [Layouts](feature_layouts.md)
|
||||
* [Leader Key](feature_leader_key.md)
|
||||
* [Macros](feature_macros.md)
|
||||
* [Mouse keys](feature_mouse_keys.md)
|
||||
* [Mouse Keys](feature_mouse_keys.md)
|
||||
* [Pointing Device](feature_pointing_device.md)
|
||||
* [PS2 Mouse](feature_ps2_mouse.md)
|
||||
* [PS/2 Mouse](feature_ps2_mouse.md)
|
||||
* [RGB Lighting](feature_rgblight.md)
|
||||
* [Space Cadet](feature_space_cadet.md)
|
||||
* [Stenography](feature_stenography.md)
|
||||
|
@ -65,12 +65,12 @@
|
|||
* [Documentation Best Practices](documentation_best_practices.md)
|
||||
* [Documentation Templates](documentation_templates.md)
|
||||
* [Glossary](glossary.md)
|
||||
* [Keymap overview](keymap.md)
|
||||
* [Keymap Overview](keymap.md)
|
||||
* [Unit Testing](unit_testing.md)
|
||||
|
||||
* For Makers and Modders
|
||||
* [Hand Wiring Guide](hand_wire.md)
|
||||
* [ISP flashing guide](isp_flashing_guide.md)
|
||||
* [ISP Flashing Guide](isp_flashing_guide.md)
|
||||
|
||||
* For a Deeper Understanding
|
||||
* [How Keyboards Work](how_keyboards_work.md)
|
||||
|
|
|
@ -4,4 +4,4 @@ A QMK collaborator is a keyboard maker/designer that is interested in helping QM
|
|||
* **Maintain the your keyboard's directory** - this may just require an initial setup to get your keyboard working, but it could also include accommodating changes made to QMK's core.
|
||||
* **Approve and merge your keyboard's keymap pull requests** - we like to encourage users to contribute their keymaps for others to see and work from when creating their own.
|
||||
|
||||
If you feel you meet these requirements, shoot us an email at hello@qmk.fm with an introduction and some links to your keyboard!
|
||||
If you feel you meet these requirements, shoot us an email at hello@qmk.fm with an introduction and some links to your keyboard!
|
||||
|
|
|
@ -22,4 +22,4 @@ You can also use any ARM processor that [ChibiOS](http://www.chibios.org) suppor
|
|||
* [Kinetis MKL26Z64](http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/l-series-ultra-low-power-m0-plus/kinetis-kl2x-48-mhz-usb-ultra-low-power-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KL2x)
|
||||
* [Kinetis MK20DX128](http://www.nxp.com/assets/documents/data/en/data-sheets/K20P64M50SF0.pdf)
|
||||
* [Kinetis MK20DX128](http://www.nxp.com/assets/documents/data/en/data-sheets/K20P64M50SF0.pdf)
|
||||
* [Kinetis MK20DX256](http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/k-series-performance-m4/k2x-usb/kinetis-k20-72-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K20_72)
|
||||
* [Kinetis MK20DX256](http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/k-series-performance-m4/k2x-usb/kinetis-k20-72-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K20_72)
|
||||
|
|
|
@ -25,7 +25,7 @@ Some keyboards have folders and sub-folders to allow for different hardware conf
|
|||
|
||||
This level contains all of the options for that particular keymap. If you wish to override a previous declaration, you can use `#undef <variable>` to undefine it, where you can then redefine it without an error.
|
||||
|
||||
# The `config.h` file
|
||||
# The `config.h` File
|
||||
|
||||
This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files, or anything besides this:
|
||||
|
||||
|
@ -164,7 +164,7 @@ If you define these options you will enable the associated feature, which may in
|
|||
|
||||
This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features.
|
||||
|
||||
## `rules.mk` options
|
||||
## `rules.mk` Options
|
||||
|
||||
### Build Options
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# How To Contribute
|
||||
# How to Contribute
|
||||
|
||||
👍🎉 First off, thanks for taking the time to read this and contribute! 🎉👍
|
||||
|
||||
|
@ -9,7 +9,7 @@ Third-party contributions help us grow and improve QMK. We want to make the pull
|
|||
* [General Guidelines](#general-guidelines)
|
||||
* [What does the Code of Conduct mean for me?](#what-does-the-code-of-conduct-mean-for-me)
|
||||
|
||||
## I Don't Want To Read This Whole Thing I Just Have a Question!
|
||||
## I Don't Want to Read This Whole Thing! I Just Have a Question!
|
||||
|
||||
If you'd like to ask questions about QMK you can do so on the [OLKB Subreddit](https://reddit.com/r/olkb) or on [Gitter](https://gitter.im/qmk/qmk_firmware).
|
||||
|
||||
|
@ -27,7 +27,7 @@ QMK is largely written in C, with specific features and parts written in C++. It
|
|||
|
||||
<!-- FIXME: We should include a list of resources for learning C here. -->
|
||||
|
||||
# Where can I go for help?
|
||||
# Where Can I Go for Help?
|
||||
|
||||
If you need help you can [open an issue](https://github.com/qmk/qmk_firmware/issues) or [chat on gitter](http://gitter.im/QMK/qmk_firmware).
|
||||
|
||||
|
@ -52,7 +52,7 @@ Never made an open source contribution before? Wondering how contributions work
|
|||
14. Make changes to the pull request if the reviewing maintainer recommends them.
|
||||
15. Celebrate your success after your pull request is merged!
|
||||
|
||||
# Coding conventions
|
||||
# Coding Conventions
|
||||
|
||||
Most of our style is pretty easy to pick up on, but right now it's not entirely consistent. You should match the style of the code surrounding your change, but if that code is inconsistent or unclear use the following guidelines:
|
||||
|
||||
|
@ -64,7 +64,7 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely
|
|||
* Optional Braces: Always include optional braces.
|
||||
* Good: if (condition) { return false; }
|
||||
* Bad: if (condition) return false;
|
||||
* We use C style comments: /* */
|
||||
* We use C style comments: `/* */`
|
||||
* Think of them as a story describing the feature
|
||||
* Use them liberally to explain why particular decisions were made.
|
||||
* Do not write obvious comments
|
||||
|
@ -147,6 +147,6 @@ We also ask that you follow these guidelines:
|
|||
|
||||
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), we'd love to talk about how QMK can be improved.
|
||||
|
||||
# What does the Code of Conduct mean for me?
|
||||
# What Does the Code of Conduct Mean for Me?
|
||||
|
||||
Our [Code of Conduct](https://github.com/qmk/qmk_firmware/blob/master/CODE_OF_CONDUCT.md) means that you are responsible for treating everyone on the project with respect and courtesy regardless of their identity. If you are the victim of any inappropriate behavior or comments as described in our Code of Conduct, we are here for you and will do the best to ensure that the abuser is reprimanded appropriately, per our code.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# How To Customize Your Keyboard's Behavior
|
||||
# How to Customize Your Keyboard's Behavior
|
||||
|
||||
For a lot of people a custom keyboard is about more than sending button presses to your computer. You want to be able to do things that are more complex than simple button presses and macros. QMK has hooks that allow you to inject code, override functionality, and otherwise customize how your keyboard behaves in different situations.
|
||||
|
||||
|
@ -34,13 +34,13 @@ enum my_keycodes {
|
|||
};
|
||||
```
|
||||
|
||||
## Programming The Behavior Of Any Keycode
|
||||
## Programming the Behavior of Any Keycode
|
||||
|
||||
When 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.
|
||||
|
||||
These function are called every time a key is pressed or released.
|
||||
|
||||
### Example `process_record_user()` implementation
|
||||
### Example `process_record_user()` Implementation
|
||||
|
||||
This example does two things. It defines the behavior for a custom keycode called `FOO`, and it supplements our Enter key by playing a tone whenever it is pressed.
|
||||
|
||||
|
@ -64,7 +64,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
```
|
||||
|
||||
### `process_record_*` Function documentation
|
||||
### `process_record_*` Function Documentation
|
||||
|
||||
* Keyboard/Revision: `bool process_record_kb(uint16_t keycode, keyrecord_t *record)`
|
||||
* Keymap: `bool process_record_user(uint16_t keycode, keyrecord_t *record)`
|
||||
|
@ -96,7 +96,7 @@ This allows you to control the 5 LED's defined as part of the USB Keyboard spec.
|
|||
* `USB_LED_COMPOSE`
|
||||
* `USB_LED_KANA`
|
||||
|
||||
### Example `led_set_kb()` implementation
|
||||
### Example `led_set_kb()` Implementation
|
||||
|
||||
```
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
|
@ -128,7 +128,7 @@ void led_set_kb(uint8_t usb_led) {
|
|||
}
|
||||
```
|
||||
|
||||
### `led_set_*` Function documentation
|
||||
### `led_set_*` Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void led_set_kb(uint8_t usb_led)`
|
||||
* Keymap: `void led_set_user(uint8_t usb_led)`
|
||||
|
@ -137,7 +137,7 @@ void led_set_kb(uint8_t usb_led) {
|
|||
|
||||
Before a keyboard can be used the hardware must be initialized. QMK handles initialization of the keyboard matrix itself, but if you have other hardware like LED's or i²c controllers you will need to set up that hardware before it can be used.
|
||||
|
||||
### Example `matrix_init_kb()` implementation
|
||||
### Example `matrix_init_kb()` Implementation
|
||||
|
||||
This example, at the keyboard level, sets up B1, B2, and B3 as LED pins.
|
||||
|
||||
|
@ -153,7 +153,7 @@ void matrix_init_kb(void) {
|
|||
}
|
||||
```
|
||||
|
||||
### `matrix_init_*` Function documentation
|
||||
### `matrix_init_*` Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void matrix_init_kb(void)`
|
||||
* Keymap: `void matrix_init_user(void)`
|
||||
|
@ -162,11 +162,11 @@ void matrix_init_kb(void) {
|
|||
|
||||
Whenever possible you should customize your keyboard by using `process_record_*()` and hooking into events that way, to ensure that your code does not have a negative performance impact on your keyboard. However, in rare cases it is necessary to hook into the matrix scanning. Be extremely careful with the performance of code in these functions, as it will be called at least 10 times per second.
|
||||
|
||||
### Example `matrix_scan_*` implementation
|
||||
### Example `matrix_scan_*` Implementation
|
||||
|
||||
This example has been deliberately omitted. You should understand enough about QMK internals to write this without an example before hooking into such a performance sensitive area. If you need help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) or [chat with us on gitter](https://gitter.im/qmk/qmk_firmware).
|
||||
|
||||
### `matrix_scan_*` Function documentation
|
||||
### `matrix_scan_*` Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void matrix_scan_kb(void)`
|
||||
* Keymap: `void matrix_scan_user(void)`
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Setting Up Eclipse for QMK Development
|
||||
# Setting up Eclipse for QMK Development
|
||||
|
||||
[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.
|
||||
|
||||
|
@ -16,16 +16,16 @@ The purpose of the is page is to document how to set-up Eclipse for developing A
|
|||
Note that this set-up has been tested on Ubuntu 16.04 only for the moment.
|
||||
|
||||
# Prerequisites
|
||||
## Build environment
|
||||
## Build Environment
|
||||
Before starting, you must have followed the [Getting Started](home.md#getting-started) section corresponding to your system. In particular, you must have been able to build the firmware with [the `make` command](../#the-make-command).
|
||||
|
||||
## Java
|
||||
Eclipse is a Java application, so you will need to install Java 8 or more recent to be able to run it. You may choose between the JRE or the JDK, the latter being useful if you intend to do Java development.
|
||||
|
||||
# Install Eclipse and its plugins
|
||||
# Install Eclipse and Its Plugins
|
||||
Eclipse comes in [several flavours](http://www.eclipse.org/downloads/eclipse-packages/) depending on the target usage that you will have. There is no package comprising the AVR stack, so we will need to start from Eclipse CDT (C/C++ Development Tooling) and install the necessary plugins.
|
||||
|
||||
## Download and install Eclipse CDT
|
||||
## Download and Install Eclipse CDT
|
||||
If you already have Eclipse CDT on your system, you can skip this step. However it is advised to keep it up-to-date for better support.
|
||||
|
||||
If you have another Eclipse package installed, it is normally possible to [install the CDT plugin over it](https://eclipse.org/cdt/downloads.php). However it is probably better to reinstall it from scratch to keep it light and avoid the clutter of tools that you don't need for the projects you will be working on.
|
||||
|
@ -41,10 +41,10 @@ When you are prompted with the Workspace Selector, select a directory that will
|
|||
|
||||
Once started, click the <kbd>Workbench</kbd> button at the top right to switch to the workbench view (there is a also checkbox at the bottom to skip the welcome screen at startup).
|
||||
|
||||
## Install the necessary plugins
|
||||
## Install the Necessary Plugins
|
||||
Note: you do not need to restart Eclipse after installing each plugin. Simply restart once all plugins are installed.
|
||||
|
||||
### [The AVR plugin](http://avr-eclipse.sourceforge.net/)
|
||||
### [The AVR Plugin](http://avr-eclipse.sourceforge.net/)
|
||||
This is the most important plugin as it will allow Eclipse to _understand_ AVR C code. Follow [the instructions for using the update site](http://avr-eclipse.sourceforge.net/wiki/index.php/Plugin_Download#Update_Site), and agree with the security warning for unsigned content.
|
||||
|
||||
### [ANSI Escape in Console](https://marketplace.eclipse.org/content/ansi-escape-console)
|
||||
|
@ -58,7 +58,7 @@ This plugin is necessary to properly display the colored build output generated
|
|||
Once both plugins are installed, restart Eclipse as prompted.
|
||||
|
||||
# Configure Eclipse for QMK
|
||||
## Importing the project
|
||||
## Importing the Project
|
||||
1. Click <kbd><kbd>File</kbd> > <kbd>New</kbd> > <kbd>Makefile Project with Existing Code</kbd></kbd>
|
||||
2. On the next screen:
|
||||
* Select the directory where you cloned the repository as _Existing Code Location_;
|
||||
|
@ -72,7 +72,7 @@ Once both plugins are installed, restart Eclipse as prompted.
|
|||
|
||||
¹ There might be issues for importing the project with a custom name. If it does not work properly, try leaving the default project name (i.e. the name of the directory, probably `qmk_firmware`).
|
||||
|
||||
## Build your keyboard
|
||||
## Build Your Keyboard
|
||||
We will now configure a make target that cleans the project and builds the keymap of your choice.
|
||||
|
||||
1. On the right side of the screen, select the <kbd>Make Target</kbd> tab
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
This page covers questions about building QMK. If you have not yet you should read the [Build Environment Setup](getting_started_build_tools.md) and [Make Instructions](getting_started_make_guide.md) guides.
|
||||
|
||||
## Can't program on Linux
|
||||
## Can't Program on Linux
|
||||
You will need proper permission to operate a device. For Linux users see udev rules below. Easy 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.
|
||||
|
||||
In short when your controller is ATMega32u4,
|
||||
|
@ -17,7 +17,7 @@ or just
|
|||
|
||||
But to run `make` with root privilege is not good idea. Use former method if possible.
|
||||
|
||||
## WINAVR is obsolete
|
||||
## WINAVR is Obsolete
|
||||
It is no longer recommended and may cause some problem.
|
||||
See [TMK Issue #99](https://github.com/tmk/tmk_keyboard/issues/99).
|
||||
|
||||
|
@ -33,7 +33,7 @@ You can buy a really unique VID:PID here. I don't think you need this for person
|
|||
- http://www.obdev.at/products/vusb/license.html
|
||||
- http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1
|
||||
|
||||
## Linux udev rules
|
||||
## Linux `udev` Rules
|
||||
On Linux you need proper privilege to access device file of MCU, you'll have to use `sudo` when flashing firmware. You can circumvent this with placing these files in `/etc/udev/rules.d/`.
|
||||
|
||||
**/etc/udev/rules.d/50-atmel-dfu.rules:**
|
||||
|
@ -53,7 +53,7 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
|
|||
```
|
||||
|
||||
|
||||
## Cortex: cstddef: No such file or directory
|
||||
## Cortex: `cstddef: No such file or directory`
|
||||
GCC 4.8 of Ubuntu 14.04 had this problem and had to update to 4.9 with this PPA.
|
||||
https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded
|
||||
|
||||
|
@ -62,7 +62,7 @@ https://github.com/tmk/tmk_keyboard/wiki/mbed-cortex-porting#compile-error-cstdd
|
|||
https://developer.mbed.org/forum/mbed/topic/5205/
|
||||
|
||||
|
||||
## `clock_prescale_set` and `clock_div_1` not available
|
||||
## `clock_prescale_set` and `clock_div_1` Not Available
|
||||
Your toolchain is too old to support the MCU. For example WinAVR 20100110 doesn't support ATMega32u2.
|
||||
|
||||
```
|
||||
|
|
|
@ -4,7 +4,7 @@ This page details various common questions people have about troubleshooting the
|
|||
|
||||
# Debug Console
|
||||
|
||||
## hid_listen can't recognize device
|
||||
## `hid_listen` Can't Recognize Device
|
||||
When debug console of your device is not ready you will see like this:
|
||||
|
||||
```
|
||||
|
@ -23,7 +23,7 @@ If you can't get this 'Listening:' message try building with `CONSOLE_ENABLE=yes
|
|||
You may need privilege to access the device on OS like Linux.
|
||||
- try `sudo hid_listen`
|
||||
|
||||
## Can't get message on console
|
||||
## Can't Get Message on Console
|
||||
Check:
|
||||
- *hid_listen* finds your device. See above.
|
||||
- Enable debug with pressing **Magic**+d. See [Magic Commands](https://github.com/tmk/tmk_keyboard#magic-commands).
|
||||
|
@ -31,7 +31,7 @@ Check:
|
|||
- try using 'print' function instead of debug print. See **common/print.h**.
|
||||
- disconnect other devices with console function. See [Issue #97](https://github.com/tmk/tmk_keyboard/issues/97).
|
||||
|
||||
## Linux or UNIX like system requires Super User privilege
|
||||
## Linux or UNIX Like System Requires Super User Privilege
|
||||
Just use 'sudo' to execute *hid_listen* with privilege.
|
||||
```
|
||||
$ sudo hid_listen
|
||||
|
@ -97,14 +97,14 @@ If your firmware built with `BOOTMAGIC_ENABLE` you need to turn its switch on by
|
|||
https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch
|
||||
|
||||
|
||||
## TrackPoint needs reset circuit(PS/2 mouse support)
|
||||
## TrackPoint Needs Reset Circuit (PS/2 Mouse Support)
|
||||
Without reset circuit you will have inconsistent reuslt due to improper initialize of the hardware. See circuit schematic of TPM754.
|
||||
|
||||
- http://geekhack.org/index.php?topic=50176.msg1127447#msg1127447
|
||||
- http://www.mikrocontroller.net/attachment/52583/tpm754.pdf
|
||||
|
||||
|
||||
## Can't read column of matrix beyond 16
|
||||
## Can't Read Column of Matrix Beyond 16
|
||||
Use `1UL<<16` instead of `1<<16` in `read_cols()` in [matrix.h] when your columns goes beyond 16.
|
||||
|
||||
In 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`.
|
||||
|
@ -112,7 +112,7 @@ In C `1` means one of [int] type which is [16bit] in case of AVR so you can't sh
|
|||
http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279
|
||||
|
||||
|
||||
## Bootloader jump doesn't work
|
||||
## Bootloader Jump Doesn't Work
|
||||
Properly configure bootloader size in **Makefile**. With wrong section size bootloader won't probably start with **Magic command** and **Boot Magic**.
|
||||
```
|
||||
# Size of Bootloaders in bytes:
|
||||
|
@ -161,14 +161,14 @@ https://github.com/tmk/tmk_keyboard/issues/179
|
|||
|
||||
If you are using a TeensyUSB, there is a [known bug](https://github.com/qmk/qmk_firmware/issues/164) in which the hardware reset button prevents the RESET key from working. Unplugging the keyboard and plugging it back in should resolve the problem.
|
||||
|
||||
## Special Extra key doesn't work(System, Audio control keys)
|
||||
## Special Extra Key Doesn't Work (System, Audio Control Keys)
|
||||
You need to define `EXTRAKEY_ENABLE` in `rules.mk` to use them in QMK.
|
||||
|
||||
```
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
```
|
||||
|
||||
## Wakeup from sleep doesn't work
|
||||
## Wakeup from Sleep Doesn't Work
|
||||
|
||||
In Windows check `Allow this device to wake the computer` setting in Power **Management property** tab of **Device Manager**. Also check BIOS setting.
|
||||
|
||||
|
@ -184,7 +184,7 @@ Pressing any key during sleep should wake host.
|
|||
Arduino leonardo and micro have **ATMega32U4** and can be used for TMK, though Arduino bootloader may be a problem.
|
||||
|
||||
|
||||
## Using PF4-7 pins of USB AVR?
|
||||
## Using PF4-7 Pins of USB AVR?
|
||||
You need to set JTD bit of MCUCR yourself to use PF4-7 as GPIO. Those pins are configured to serve JTAG function by default. MCUs like ATMega*U* or AT90USB* are affeteced with this.
|
||||
|
||||
If you are using Teensy this isn't needed. Teensy is shipped with JTAGEN fuse bit unprogrammed to disable the function.
|
||||
|
@ -200,7 +200,7 @@ https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hbkb/matrix.c#L67
|
|||
And read **26.5.1 MCU Control Register – MCUCR** of ATMega32U4 datasheet.
|
||||
|
||||
|
||||
## Adding LED indicators of Lock keys
|
||||
## Adding LED Indicators of Lock Keys
|
||||
You need your own LED indicators for CapsLock, ScrollLock and NumLock? See this post.
|
||||
|
||||
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-120.html#p191560
|
||||
|
@ -218,16 +218,16 @@ http://arduino.cc/en/Main/ArduinoBoardMicro
|
|||
https://geekhack.org/index.php?topic=14290.msg1563867#msg1563867
|
||||
|
||||
|
||||
## USB 3 compatibility
|
||||
## USB 3 Compatibility
|
||||
I heard some people have a problem with USB 3 port, try USB 2 port.
|
||||
|
||||
|
||||
## Mac compatibility
|
||||
## Mac Compatibility
|
||||
### OS X 10.11 and Hub
|
||||
https://geekhack.org/index.php?topic=14290.msg1884034#msg1884034
|
||||
|
||||
|
||||
## Problem on BIOS(UEFI)/Resume(Sleep&Wake)/Power cycles
|
||||
## Problem on BIOS (UEFI)/Resume (Sleep & Wake)/Power Cycles
|
||||
Some people reported their keyboard stops working on BIOS and/or after resume(power cycles).
|
||||
|
||||
As of now root of its cause is not clear but some build options seem to be related. In Makefile try to disable those options like `CONSOLE_ENABLE`, `NKRO_ENABLE`, `SLEEP_LED_ENABLE` and/or others.
|
||||
|
@ -237,7 +237,7 @@ https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
|||
|
||||
|
||||
|
||||
## FLIP doesn't work
|
||||
### AtLibUsbDfu.dll not found
|
||||
## FLIP Doesn't Work
|
||||
### `AtLibUsbDfu.dll` Not Found
|
||||
Remove current driver and reinstall one FLIP provides from DeviceManager.
|
||||
http://imgur.com/a/bnwzy
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
[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).
|
||||
|
||||
### Why the name Quantum?
|
||||
### Why the Name Quantum?
|
||||
|
||||
<!-- FIXME -->
|
||||
|
||||
|
@ -17,4 +17,3 @@ From a technical standpoint QMK builds upon TMK by adding several new features.
|
|||
From a project and community management standpoint TMK maintains all the officially supported keyboards by himself, with a bit of community support. Separate community maintained forks exist or can be created for other keyboards. Only a few keymaps are provided by default, so users typically don't share keymaps with each other. QMK encourages sharing of both keyboards and keymaps through a centrally managed repository, accepting all pull requests that follow the quality standards. These are mostly community maintained, but the QMK team also helps when necessary.
|
||||
|
||||
Both approaches have their merits and their drawbacks, and code flows freely between TMK and QMK when it makes sense.
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ See [Keycodes](keycodes.md) for an index of keycodes available to you. These lin
|
|||
|
||||
Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
|
||||
|
||||
## What Are The Default Keycodes?
|
||||
## What Are the Default Keycodes?
|
||||
|
||||
There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JIS. North America primarily uses ANSI, Europe and Africa primarily use ISO, and Japan uses JIS. Regions not mentioned typically use either ANSI or ISO. The keycodes corresponding to these layouts are shown here:
|
||||
|
||||
|
@ -18,25 +18,25 @@ There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JI
|
|||
|
||||
The key found on most modern keyboards that is located between `KC_RGUI` and `KC_RCTL` is actually called `KC_APP`. This is because when that key was invented there was already a key named `MENU` in the relevant standards, so MS chose to call that the `APP` key.
|
||||
|
||||
## `KC_SYSREQ` isn't working
|
||||
## `KC_SYSREQ` Isn't Working
|
||||
Use keycode for Print Screen(`KC_PSCREEN` or `KC_PSCR`) instead of `KC_SYSREQ`. Key combination of 'Alt + Print Screen' is recognized as 'System request'.
|
||||
|
||||
See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and
|
||||
- http://en.wikipedia.org/wiki/Magic_SysRq_key
|
||||
- http://en.wikipedia.org/wiki/System_request
|
||||
|
||||
## Power key doesn't work
|
||||
## Power Key Doesn't Work
|
||||
Use `KC_PWR` instead of `KC_POWER` or vice versa.
|
||||
- `KC_PWR` works with Windows and Linux, not with OSX.
|
||||
- `KC_POWER` works with OSX and Linux, not with Windows.
|
||||
|
||||
More info: http://geekhack.org/index.php?topic=14290.msg1327264#msg1327264
|
||||
|
||||
## Oneshot modifier
|
||||
## One Shot Modifier
|
||||
Solves my personal 'the' problem. I often got 'the' or 'THe' wrongly instead of 'The'. Oneshot Shift mitgates this for me.
|
||||
https://github.com/tmk/tmk_keyboard/issues/67
|
||||
|
||||
## Modifier/Layer stuck
|
||||
## Modifier/Layer Stuck
|
||||
Modifier keys or layers can be stuck unless layer switching is configured properly.
|
||||
For Modifier keys and layer actions you have to place `KC_TRANS` on same position of destination layer to unregister the modifier key or return to previous layer on release event.
|
||||
|
||||
|
@ -58,7 +58,7 @@ After enabling this feature use keycodes `KC_LCAP`, `KC_LNUM` and `KC_LSCR` in y
|
|||
|
||||
Old 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`.***
|
||||
|
||||
## Input special charactors other than ASCII like Cédille 'Ç'
|
||||
## Input Special Characters Other Than ASCII like Cédille 'Ç'
|
||||
NO UNIVERSAL METHOD TO INPUT THOSE WORKS OVER ALL SYSTEMS. You have to define **MACRO** in way specific to your OS or layout.
|
||||
|
||||
See this post for example **MACRO** code.
|
||||
|
@ -79,7 +79,7 @@ And see this for **Unicode** input.
|
|||
- http://en.wikipedia.org/wiki/Unicode_input
|
||||
|
||||
|
||||
## Apple/Mac keyboard Fn
|
||||
## Apple/Mac Keyboard `Fn`
|
||||
Not supported.
|
||||
|
||||
Apple/Mac keyboard sends keycode for Fn unlike most of other keyboards.
|
||||
|
@ -88,13 +88,13 @@ I think you can send Apple Fn key using Apple venter specific Page 0xff01 and us
|
|||
https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/AppleHIDUsageTables.h
|
||||
|
||||
|
||||
## Media control keys in Mac OSX
|
||||
#### KC_MNXT and KC_MPRV does not work on Mac
|
||||
## Media Control Keys in Mac OSX
|
||||
#### KC_MNXT and KC_MPRV Does Not Work on Mac
|
||||
Use `KC_MFFD`(`KC_MEDIA_FAST_FORWARD`) and `KC_MRWD`(`KC_MEDIA_REWIND`) instead of `KC_MNXT` and `KC_MPRV`.
|
||||
See https://github.com/tmk/tmk_keyboard/issues/195
|
||||
|
||||
|
||||
## Keys supported in Mac OSX?
|
||||
## Keys Supported in Mac OSX?
|
||||
You can know which keycodes are supported in OSX from this source code.
|
||||
|
||||
`usb_2_adb_keymap` array maps Keyboard/Keypad Page usages to ADB scancodes(OSX internal keycodes).
|
||||
|
@ -106,7 +106,7 @@ And `IOHIDConsumer::dispatchConsumerEvent` handles Consumer page usages.
|
|||
https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/IOHIDConsumer.cpp
|
||||
|
||||
|
||||
## JIS keys in Mac OSX
|
||||
## JIS Keys in Mac OSX
|
||||
Japanese JIS keyboard specific keys like `無変換(Muhenkan)`, `変換(Henkan)`, `ひらがな(hiragana)` are not recognized on OSX. You can use **Seil** to enable those keys, try following options.
|
||||
|
||||
* Enable NFER Key on PC keyboard
|
||||
|
@ -116,7 +116,7 @@ Japanese JIS keyboard specific keys like `無変換(Muhenkan)`, `変換(Henkan)`
|
|||
https://pqrs.org/osx/karabiner/seil.html
|
||||
|
||||
|
||||
## RN-42 Bluetooth doesn't work with Karabiner
|
||||
## RN-42 Bluetooth Doesn't Work with Karabiner
|
||||
Karabiner - Keymapping tool on Mac OSX - ignores inputs from RN-42 module by default. You have to enable this option to make Karabiner working with your keyboard.
|
||||
https://github.com/tekezo/Karabiner/issues/403#issuecomment-102559237
|
||||
|
||||
|
@ -125,11 +125,11 @@ https://github.com/tmk/tmk_keyboard/issues/213
|
|||
https://github.com/tekezo/Karabiner/issues/403
|
||||
|
||||
|
||||
## Esc and `~ on a single key
|
||||
## Esc and <code>`</code> on a Single Key
|
||||
|
||||
See the [Grave Escape](feature_grave_escape.md) feature.
|
||||
|
||||
## Arrow on Right Modifier keys with Dual-Role
|
||||
## Arrow on Right Modifier Keys with Dual-Role
|
||||
This 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**.
|
||||
```
|
||||
|
||||
|
@ -181,7 +181,7 @@ It seems Windows 10 ignores the code and Linux/Xorg recognizes but has no mappin
|
|||
Not 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.
|
||||
|
||||
|
||||
## What's weak_mods and real_mods in action_util.c
|
||||
## What's `weak_mods` and `real_mods` in `action_util.c`
|
||||
___TO BE IMPROVED___
|
||||
|
||||
real_mods is intended to retains state of real/physical modifier key state, while
|
||||
|
@ -204,7 +204,7 @@ here real_mods lost state for 'physical left shift'.
|
|||
weak_mods is ORed with real_mods when keyboard report is sent.
|
||||
https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57
|
||||
|
||||
## Timer functionality
|
||||
## Timer Functionality
|
||||
|
||||
It's possible to start timers and read values for time-specific events - here's an example:
|
||||
|
||||
|
|
|
@ -13,11 +13,11 @@ People often define custom names using `#define`. For example:
|
|||
|
||||
This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping it more readable.
|
||||
|
||||
### Limits of these aliases
|
||||
### Limits of These Aliases
|
||||
|
||||
Currently, the keycodes able to used with these functions are limited to the [Basic Keycodes](keycodes_basic.md), 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 [Basic Keycodes](keycodes_basic.md).
|
||||
|
||||
# Switching and toggling layers
|
||||
# Switching and Toggling Layers
|
||||
|
||||
These functions allow you to activate layers in various ways.
|
||||
|
||||
|
@ -27,7 +27,7 @@ These functions allow you to activate layers in various ways.
|
|||
* `TO(layer)` - Goes to a layer. This code is special, because it lets you go either up or down the stack -- just goes directly to the layer you want. So while other codes only let you go _up_ the stack (from layer 0 to layer 3, for example), `TO(2)` is going to get you to layer 2, no matter where you activate it from -- even if you're currently on layer 5. This gets activated on keydown (as soon as the key is pressed).
|
||||
* `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 2` for just two taps.
|
||||
|
||||
# Working With Layers
|
||||
# Working with Layers
|
||||
|
||||
Care must be taken when switching layers, it's possible to lock yourself into a layer with no way to deactivate that layer (without unplugging your keyboard.) We've created some guidelines to help users avoid the most common problems.
|
||||
|
||||
|
@ -51,7 +51,7 @@ Layers stack on top of each other in numerical order. When determining what a ke
|
|||
|
||||
Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](../tmk_core/common/action_layer.h).
|
||||
|
||||
# Modifier keys
|
||||
# Modifier Keys
|
||||
|
||||
These functions allow you to combine a mod with a keycode. When pressed the keydown for the mod will be sent first, and then *kc* will be sent. When released the keyup for *kc* will be sent and then the mod will be sent.
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ PLAY_LOOP(my_song);
|
|||
|
||||
It's advised that you wrap all audio features in `#ifdef AUDIO_ENABLE` / `#endif` to avoid causing problems when audio isn't built into the keyboard.
|
||||
|
||||
## Music mode
|
||||
## Music Mode
|
||||
|
||||
The music mode maps your columns to a chromatic scale, and your rows to octaves. This works best with ortholinear keyboards, but can be made to work with others. All keycodes less than `0xFF` get blocked, so you won't type while playing notes - if you have special keys/mods, those will still work. A work-around for this is to jump to a different layer with KC_NOs before (or after) enabling music mode.
|
||||
|
||||
|
@ -82,7 +82,7 @@ The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, a
|
|||
|
||||
#define PITCH_STANDARD_A 432.0f
|
||||
|
||||
## MIDI functionalty
|
||||
## MIDI Functionality
|
||||
|
||||
This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Auto Shift: Why do we need a shift key?
|
||||
# Auto Shift: Why Do We Need a Shift Key?
|
||||
|
||||
Tap a key and you get its character. Tap a key, but hold it *slightly* longer
|
||||
and you get its shifted state. Viola! No shift key needed!
|
||||
|
@ -10,7 +10,7 @@ fingers repetitively long distances. For us on the keyboard, the pinky does that
|
|||
all too often when reaching for the shift key. Auto Shift looks to alleviate that
|
||||
problem.
|
||||
|
||||
## How does it work?
|
||||
## How Does It Work?
|
||||
|
||||
When you tap a key, it stays depressed for a short period of time before it is
|
||||
then released. This depressed time is a different length for everyone. Auto Shift
|
||||
|
@ -20,7 +20,7 @@ when you release the key. If the time depressed is greater than or equal to the
|
|||
`AUTO_SHIFT_TIMEOUT`, then a shifted version of the key is emitted. If the time
|
||||
is less than the `AUTO_SHIFT_TIMEOUT` time, then the normal state is emitted.
|
||||
|
||||
## Are there limitations to Auto Shift?
|
||||
## Are There Limitations to Auto Shift?
|
||||
|
||||
Yes, unfortunately.
|
||||
|
||||
|
@ -38,7 +38,7 @@ Yes, unfortunately.
|
|||
tapping the keys, but really we have held it for a little longer than
|
||||
anticipated.
|
||||
|
||||
## How do I enable Auto Shift?
|
||||
## How Do I Enable Auto Shift?
|
||||
|
||||
Add to your `rules.mk` in the keymap folder:
|
||||
|
||||
|
@ -66,7 +66,7 @@ A sample is
|
|||
|
||||
#endif
|
||||
|
||||
### AUTO_SHIFT_TIMEOUT (value in ms)
|
||||
### AUTO_SHIFT_TIMEOUT (Value in ms)
|
||||
|
||||
This controls how long you have to hold a key before you get the shifted state.
|
||||
Obviously, this is different for everyone. For the common person, a setting of
|
||||
|
@ -86,7 +86,7 @@ quick. See "Auto Shift Setup" for more details!
|
|||
|
||||
### NO_AUTO_SHIFT_SPECIAL (simple define)
|
||||
|
||||
Do not Auto Shift special keys, which include -_, =+, [{, ]}, ;:, '", ,<, .>,
|
||||
Do not Auto Shift special keys, which include -\_, =+, [{, ]}, ;:, '", ,<, .>,
|
||||
and /?
|
||||
|
||||
### NO_AUTO_SHIFT_NUMERIC (simple define)
|
||||
|
@ -134,7 +134,7 @@ completely normal and with no intention of shifted keys.
|
|||
9. Remove the key bindings `KC_ASDN`, `KC_ASUP` and `KC_ASRP`.
|
||||
10. Compile and upload your new firmware.
|
||||
|
||||
#### An example run
|
||||
#### An Example Run
|
||||
|
||||
hello world. my name is john doe. i am a computer programmer playing with
|
||||
keyboards right now.
|
||||
|
@ -155,4 +155,4 @@ completely normal and with no intention of shifted keys.
|
|||
|
||||
The keyboard typed `115` which represents your current `AUTO_SHIFT_TIMEOUT`
|
||||
value. You are now set! Practice on the *D* key a little bit that showed up
|
||||
in the testing and you'll be golden.
|
||||
in the testing and you'll be golden.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Bluetooth
|
||||
|
||||
## Bluetooth functionality
|
||||
## Bluetooth Functionality
|
||||
|
||||
This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboards/comments/3psx0q/the_planck_keyboard_with_bluetooth_guide_and/?ref=search_posts), but can be enabled via the Makefile. The firmware will still output characters via USB, so be aware of this when charging via a computer. It would make sense to have a switch on the Bluefruit to turn it off at will.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Dynamic macros: record and replay macros in runtime
|
||||
# Dynamic Macros: Record and Replay Macros in Runtime
|
||||
|
||||
QMK supports temporary macros created on the fly. We call these Dynamic Macros. They are defined by the user from the keyboard and are lost when the keyboard is unplugged or otherwise rebooted.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Grave Escape
|
||||
|
||||
Grave Escape is a feature that allows you to share the grave key (`\`` and `~`) on the same key as Escape. When `KC_GESC` is used it will act as `KC_ESC`, unless Shift or GUI is pressed, in which case it will act as `KC_GRAVE`.
|
||||
Grave Escape is a feature that allows you to share the grave key (<code>`</code> and `~`) on the same key as Escape. When `KC_GESC` is used it will act as `KC_ESC`, unless Shift or GUI is pressed, in which case it will act as `KC_GRAVE`.
|
||||
|
||||
|
||||
| Key | Alias | Description |
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
## Key Lock: Holding down keys for you
|
||||
## Key Lock: Holding Down Keys for You
|
||||
|
||||
Sometimes, you need to hold down a specific key for a long period of time. Whether this is while typing in ALL CAPS, or playing a video game that hasn't implemented auto-run, Key Lock is here to help. Key Lock adds a new keycode, `KC_LOCK`, that will hold down the next key you hit for you. The key is released when you hit it again. Here's an example: let's say you need to type in all caps for a few sentences. You hit KC_LOCK, and then shift. Now, shift will be considered held until you hit it again. You can think of key lock as caps lock, but supercharged.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Layouts: Using a keymap with multiple keyboards
|
||||
# Layouts: Using a Keymap with Multiple Keyboards
|
||||
|
||||
The `layouts/` folder contains different physical key layouts that can apply to different keyboards.
|
||||
|
||||
|
@ -33,7 +33,7 @@ Each layout folder is named (`[a-z0-9_]`) after the physical aspects of the layo
|
|||
|
||||
New names should try to stick to the standards set by existing layouts, and can be discussed in the PR/Issue.
|
||||
|
||||
## Supporting a layout
|
||||
## Supporting a Layout
|
||||
|
||||
For a keyboard to support a layout, the variable (`[a-z0-9_]`) must be defined in it's `<keyboard>.h`, and match the number of arguments/keys (and preferrably the physical layout):
|
||||
|
||||
|
@ -49,7 +49,7 @@ The folder name must be added to the keyboard's `rules.mk`:
|
|||
|
||||
but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well.
|
||||
|
||||
## Tips for making layouts keyboard-agnostic
|
||||
## Tips for Making Layouts Keyboard-Agnostic
|
||||
|
||||
Instead of using `#include "planck.h"`, you can use this line to include whatever `<keyboard>.h` (`<folder>.h` should not be included here) file that is being compiled:
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# The Leader key: A new kind of modifier
|
||||
# The Leader Key: A New Kind of Modifier
|
||||
|
||||
If you've ever used Vim, you know what a Leader key is. If not, you're about to discover a wonderful concept. :) Instead of hitting Alt+Shift+W for example (holding down three keys at the same time), what if you could hit a _sequence_ of keys instead? So you'd hit our special modifier (the Leader key), followed by W and then C (just a rapid succession of keys), and something would happen.
|
||||
|
||||
|
@ -34,4 +34,4 @@ void matrix_scan_user(void) {
|
|||
}
|
||||
```
|
||||
|
||||
As you can see, you have three function. you can use - `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS` and `SEQ_THREE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously.
|
||||
As you can see, you have three function. you can use - `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS` and `SEQ_THREE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously.
|
||||
|
|
|
@ -6,7 +6,7 @@ Macros allow you to send multiple keystrokes when pressing just one key. QMK has
|
|||
**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.
|
||||
{% endhint %}
|
||||
|
||||
## The new way: `SEND_STRING()` & `process_record_user`
|
||||
## The New Way: `SEND_STRING()` & `process_record_user`
|
||||
|
||||
Sometimes you just want a key to type out words or phrases. For the most common situations we've provided `SEND_STRING()`, which will type out your string (i.e. a sequence of characters) for you. All ASCII characters that are easily translated to a keycode are supported (e.g. `\n\t`).
|
||||
|
||||
|
@ -105,13 +105,13 @@ They can be used like this:
|
|||
|
||||
Which would send LCTRL+a (LCTRL down, a, LCTRL up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes.
|
||||
|
||||
### Alternative keymaps
|
||||
### Alternative Keymaps
|
||||
|
||||
By default, it assumes a US keymap with a QWERTY layout; if you want to change that (e.g. if your OS uses software Colemak), include this somewhere in your keymap:
|
||||
|
||||
#include <sendstring_colemak.h>
|
||||
|
||||
### Strings in memory
|
||||
### Strings in Memory
|
||||
|
||||
If for some reason you're manipulating strings and need to print out something you just generated (instead of being a literal, constant string), you can use `send_string()`, like this:
|
||||
|
||||
|
@ -129,7 +129,7 @@ send_string(my_str);
|
|||
SEND_STRING(".."SS_TAP(X_END));
|
||||
```
|
||||
|
||||
## The old way: `MACRO()` & `action_get_macro`
|
||||
## The Old Way: `MACRO()` & `action_get_macro`
|
||||
|
||||
{% hint style='info' %}
|
||||
This is inherited from TMK, and hasn't been updated - it's recommend that you use `SEND_STRING` and `process_record_user` instead.
|
||||
|
@ -166,7 +166,7 @@ A macro can include the following commands:
|
|||
* W() wait (milliseconds).
|
||||
* END end mark.
|
||||
|
||||
### Mapping a Macro to a key
|
||||
### Mapping a Macro to a Key
|
||||
|
||||
Use the `M()` function within your `KEYMAP()` to call a macro. For example, here is the keymap for a 2-key keyboard:
|
||||
|
||||
|
@ -192,7 +192,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
|||
|
||||
When you press the key on the left it will type "Hi!" and when you press the key on the right it will type "Bye!".
|
||||
|
||||
### Naming your macros
|
||||
### Naming Your Macros
|
||||
|
||||
If you have a bunch of macros you want to refer to from your keymap while keeping the keymap easily readable you can name them using `#define` at the top of your file.
|
||||
|
||||
|
@ -207,7 +207,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
};
|
||||
```
|
||||
|
||||
## Advanced macro functions
|
||||
## Advanced Macro Functions
|
||||
|
||||
There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.
|
||||
|
||||
|
@ -243,7 +243,7 @@ This will clear all mods currently pressed.
|
|||
|
||||
This will clear all keys besides the mods currently pressed.
|
||||
|
||||
## Advanced Example: Single-key copy/paste
|
||||
## Advanced Example: Single-Key Copy/Paste
|
||||
|
||||
This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V` when released.
|
||||
|
||||
|
@ -262,5 +262,3 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
|||
return MACRO_NONE;
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
Mousekeys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer around, click up to 5 buttons, and even scroll in all 4 directions. QMK uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
||||
|
||||
## Adding Mousekeys To a Keymap
|
||||
## Adding Mousekeys to a Keymap
|
||||
|
||||
There are two steps to adding Mousekeys support to your keyboard. You must enable support in the Makefile and you must map mouse actions to keys on your keyboard.
|
||||
|
||||
### Adding Mousekeys support in the `Makefile`
|
||||
### Adding Mousekeys Support in the `Makefile`
|
||||
|
||||
To add support for Mousekeys you simply need to add a single line to your keymap's `Makefile`:
|
||||
|
||||
|
@ -17,7 +17,7 @@ MOUSEKEY_ENABLE = yes
|
|||
|
||||
You can see an example here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/keymaps/mouse_keys/Makefile
|
||||
|
||||
### Mapping Mouse Actions To Keyboard Keys
|
||||
### Mapping Mouse Actions to Keyboard Keys
|
||||
|
||||
You can use these keycodes within your keymap to map button presses to mouse actions:
|
||||
|
||||
|
@ -42,7 +42,7 @@ You can use these keycodes within your keymap to map button presses to mouse act
|
|||
|
||||
You can see an example in the `_ML` here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/keymaps/mouse_keys/keymap.c#L46
|
||||
|
||||
## Configuring the behavior of Mousekeys
|
||||
## Configuring the Behavior of Mousekeys
|
||||
|
||||
The default speed for controlling the mouse with the keyboard is intentionaly slow. You can adjust these parameters by adding these settings to your keymap's `config.h` file. All times are specified in miliseconds (ms).
|
||||
|
||||
|
@ -78,4 +78,4 @@ The top speed for scrolling movements.
|
|||
|
||||
### `MOUSEKEY_WHEEL_TIME_TO_MAX`
|
||||
|
||||
How long you want to hold down a scroll key for until `MOUSEKEY_WHEEL_MAX_SPEED` is reached. This controls how quickling your scrolling will accelerate.
|
||||
How long you want to hold down a scroll key for until `MOUSEKEY_WHEEL_MAX_SPEED` is reached. This controls how quickling your scrolling will accelerate.
|
||||
|
|
|
@ -44,4 +44,4 @@ case MS_SPECIAL:
|
|||
break;
|
||||
```
|
||||
|
||||
Recall that the mouse report is set to zero (except the buttons) whenever it is sent, so the scrolling would only occur once in each case.
|
||||
Recall that the mouse report is set to zero (except the buttons) whenever it is sent, so the scrolling would only occur once in each case.
|
||||
|
|
|
@ -6,7 +6,7 @@ To hook up a Trackpoint, you need to obtain a Trackpoint module (i.e. harvest fr
|
|||
|
||||
There are three available modes for hooking up PS/2 devices: USART (best), interrupts (better) or busywait (not recommended).
|
||||
|
||||
### Busywait version
|
||||
### Busywait Version
|
||||
|
||||
Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible.
|
||||
|
||||
|
@ -32,7 +32,7 @@ In your keyboard config.h:
|
|||
#endif
|
||||
```
|
||||
|
||||
### Interrupt version
|
||||
### Interrupt Version
|
||||
|
||||
The following example uses D2 for clock and D5 for data. You can use any INT or PCINT pin for clock, and any pin for data.
|
||||
|
||||
|
@ -70,7 +70,7 @@ In your keyboard config.h:
|
|||
#endif
|
||||
```
|
||||
|
||||
### USART version
|
||||
### USART Version
|
||||
|
||||
To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data. If one of those are unavailable, you need to use interrupt version.
|
||||
|
||||
|
@ -129,7 +129,7 @@ In your keyboard config.h:
|
|||
|
||||
### Additional Settings
|
||||
|
||||
#### PS/2 mouse features
|
||||
#### PS/2 Mouse Features
|
||||
|
||||
These enable settings supported by the PS/2 mouse protocol: http://www.computer-engineering.org/ps2mouse/
|
||||
|
||||
|
@ -170,7 +170,7 @@ void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution);
|
|||
void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate);
|
||||
```
|
||||
|
||||
#### Fine control
|
||||
#### Fine Control
|
||||
|
||||
Use the following defines to change the sensitivity and speed of the mouse.
|
||||
Note: you can also use `ps2_mouse_set_resolution` for the same effect (not supported on most touchpads).
|
||||
|
@ -181,7 +181,7 @@ Note: you can also use `ps2_mouse_set_resolution` for the same effect (not suppo
|
|||
#define PS2_MOUSE_V_MULTIPLIER 1
|
||||
```
|
||||
|
||||
#### Scroll button
|
||||
#### Scroll Button
|
||||
|
||||
If you're using a trackpoint, you will likely want to be able to use it for scrolling.
|
||||
Its possible to enable a "scroll button/s" that when pressed will cause the mouse to scroll instead of moving.
|
||||
|
@ -227,7 +227,7 @@ Fine control over the scrolling is supported with the following defines:
|
|||
#define PS2_MOUSE_SCROLL_DIVISOR_V 2
|
||||
```
|
||||
|
||||
#### Invert mouse and scroll axes
|
||||
#### Invert Mouse and Scroll Axes
|
||||
|
||||
To invert the X and Y axes you can put:
|
||||
|
||||
|
@ -247,7 +247,7 @@ To reverse the scroll axes you can put:
|
|||
|
||||
into config.h.
|
||||
|
||||
#### Debug settings
|
||||
#### Debug Settings
|
||||
|
||||
To debug the mouse, add `debug_mouse = true` or enable via bootmagic.
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31};
|
|||
const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
|
||||
```
|
||||
|
||||
### LED control
|
||||
### LED Control
|
||||
|
||||
Look in `rgblights.h` for all available functions, but if you want to control all or some LEDs your goto functions are:
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
## Space Cadet Shift: The future, built in
|
||||
## Space Cadet Shift: The Future, Built In
|
||||
|
||||
Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) the Space Cadet Shift quite well. Essentially, you hit the left Shift on its own, and you get an opening parenthesis; hit the right Shift on its own, and you get the closing one. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Tap Dance: A single key can do 3, 5, or 100 different things
|
||||
# Tap Dance: A Single Key Can Do 3, 5, or 100 Different Things
|
||||
|
||||
<!-- FIXME: Break this up into multiple sections -->
|
||||
|
||||
|
@ -78,7 +78,7 @@ enum {
|
|||
X_TAP_DANCE
|
||||
};
|
||||
```
|
||||
### Example 1: Send `:` on single tap, `;` on double tap
|
||||
### Example 1: Send `:` on Single Tap, `;` on Double Tap
|
||||
```c
|
||||
void dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
|
@ -103,7 +103,7 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
|||
[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset)
|
||||
};
|
||||
```
|
||||
### Example 2: Send "Safety Dance!" after 100 taps
|
||||
### Example 2: Send "Safety Dance!" After 100 Taps
|
||||
```c
|
||||
void dance_egg (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 100) {
|
||||
|
@ -117,7 +117,7 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
|||
};
|
||||
```
|
||||
|
||||
### Example 3: Turn LED lights on then off, one at a time
|
||||
### Example 3: Turn LED Lights On Then Off, One at a Time
|
||||
|
||||
```c
|
||||
// on each tap, light up one led, from right to left
|
||||
|
|
|
@ -14,7 +14,7 @@ When enabled, a `> ` prompt will appear, where you'll be able to type, backspace
|
|||
|
||||
`#define TERMINAL_HELP` enables some other output helpers that aren't really needed with this page.
|
||||
|
||||
## Future ideas
|
||||
## Future Ideas
|
||||
|
||||
* Keyboard/user-extendable commands
|
||||
* Smaller footprint
|
||||
|
@ -30,7 +30,7 @@ When enabled, a `> ` prompt will appear, where you'll be able to type, backspace
|
|||
* EEPROM read/write
|
||||
* Audio control
|
||||
|
||||
## Current commands
|
||||
## Current Commands
|
||||
|
||||
### `about`
|
||||
|
||||
|
@ -77,4 +77,4 @@ Prints out the entire keymap for a certain layer
|
|||
|
||||
### `exit`
|
||||
|
||||
Exits the terminal - same as `TERM_OFF`.
|
||||
Exits the terminal - same as `TERM_OFF`.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Unicode support
|
||||
# Unicode Support
|
||||
|
||||
There are three Unicode keymap definition method available in QMK:
|
||||
|
||||
|
@ -29,7 +29,7 @@ This is the current list of Unicode input method in QMK:
|
|||
* UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead.
|
||||
* UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows.
|
||||
|
||||
# Additional language support
|
||||
# Additional Language Support
|
||||
|
||||
In `quantum/keymap_extras/`, you'll see various language files - these work the same way as the alternative layout ones do. Most are defined by their two letter country/language code followed by an underscore and a 4-letter abbreviation of its name. `FR_UGRV` which will result in a `ù` when using a software-implemented AZERTY layout. It's currently difficult to send such characters in just the firmware.
|
||||
|
||||
|
@ -52,4 +52,3 @@ In the default script of AutoHotkey you can define custom hotkeys.
|
|||
|
||||
The hotkeys above are for the combination CtrlAltGui and CtrlAltGuiShift plus the letter a.
|
||||
AutoHotkey inserts the Text right of `Send, ` when this combination is pressed.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Userspace: sharing code between keymaps
|
||||
# Userspace: Sharing Code Between Keymaps
|
||||
|
||||
If you use more than one keyboard with a similar keymap, you might see the benefit in being able to share code between them. Create your own folder in `users/` named the same as your keymap (ideally your github username, `<name>`) with the following structure:
|
||||
|
||||
|
@ -93,4 +93,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make <keyboard>:<keymap">`, making frequent compiling easier. And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time.
|
||||
|
||||
Additionally, this should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely (and will dump the HEX in the ".build" folder instead).
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Flashing Intrustructions / Bootloader Information
|
||||
# Flashing Instructions and Bootloader Information
|
||||
|
||||
There are quite a few different types of bootloaders that keyboards use, and just about all of the use a different flashing method. Luckily, projects like the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) aim to be compatible with all the different types without having to think about it much, but this article will describe the different types of bootloaders, and available methods for flashing them.
|
||||
|
||||
|
@ -102,4 +102,3 @@ Flashing sequence:
|
|||
2. Wait for the OS to detect the device
|
||||
4. Flash a .hex file
|
||||
5. Reset the device into application mode (may be done automatically)
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ You will need to clone the repository to your Windows file system using the norm
|
|||
|
||||
Once 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.
|
||||
|
||||
### Toolchain setup
|
||||
### Toolchain Setup
|
||||
The 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.
|
||||
|
||||
1. Open "Bash On Ubuntu On Windows" from the start menu.
|
||||
|
@ -91,13 +91,13 @@ The Toolchain setup is done through the Windows Subsystem for Linux, and the pro
|
|||
4. Close the Bash command window, and re-open it.
|
||||
5. You are ready to compile and flash the firmware!
|
||||
|
||||
### Some important things to keep in mind
|
||||
### Some Important Things to Keep in Mind
|
||||
* You can run `util/wsl_install.sh` again to get all the newest updates.
|
||||
* Your QMK repository need to be on a Windows file system path, since WSL can't run executables outside it.
|
||||
* 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
|
||||
* 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.
|
||||
|
||||
## Windows (Vista and later) (Deprecated)
|
||||
## Windows (Vista and Later) (Deprecated)
|
||||
|
||||
These are the old instructions for Windows Vista and later. We recommend you use [MSYS2 as outlined above](#windows-with-msys2-recommended).
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# How to use Github with QMK
|
||||
# How to Use Github with QMK
|
||||
|
||||
Github can be a little tricky to those that aren't familiar with it - this guide will walk through each step of forking, cloning, and submitting a pull request with QMK.
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
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.
|
||||
|
||||
## Basic QMK structure
|
||||
## Basic QMK Structure
|
||||
|
||||
QMK is a fork of [Jun Wako](https://github.com/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.
|
||||
|
||||
### Keyboard project structure
|
||||
### Keyboard Project Structure
|
||||
|
||||
Within the folder `keyboards` and its subfolder `handwired` is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within it you'll find the following structure:
|
||||
|
||||
|
@ -14,7 +14,7 @@ Within the folder `keyboards` and its subfolder `handwired` is a directory for e
|
|||
* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `Makefile`
|
||||
* `config.h`: The file that sets the default compile time options. Do not edit this file directly, instead use a keymap specific `config.h`.
|
||||
|
||||
### Keymap structure
|
||||
### Keymap Structure
|
||||
|
||||
In every keymap folder, the following files may be found. Only `keymap.c` is required, and if the rest of the files are not found the default options will be chosen.
|
||||
|
||||
|
@ -23,7 +23,7 @@ In every keymap folder, the following files may be found. Only `keymap.c` is req
|
|||
* `rules.mk`: the features of QMK that are enabled
|
||||
* `readme.md`: a description of your keymap, how others might use it, and explanations of features. Please upload images to a service like imgur.
|
||||
|
||||
# The `config.h` file
|
||||
# The `config.h` File
|
||||
|
||||
There are 2 `config.h` locations:
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# More detailed make instruction
|
||||
# More Detailed `make` Instructions
|
||||
|
||||
The full syntax of the `make` command is `<keyboard_folder>:<keymap>:<target>`, where:
|
||||
|
||||
|
@ -33,7 +33,7 @@ Here are some examples commands
|
|||
* `make ergodox_infinity:algernon:clean` will clean the build output of the Ergodox Infinity keyboard.
|
||||
* `make planck/rev4:default:dfu COLOR=false` builds and uploads the keymap without color output.
|
||||
|
||||
## `rules.mk` options
|
||||
## `rules.mk` Options
|
||||
|
||||
Set these variables to `no` to disable them, and `yes` to enable them.
|
||||
|
||||
|
@ -133,7 +133,7 @@ This consumes about 5390 bytes.
|
|||
|
||||
This enables [key lock](feature_key_lock.md). This consumes an additional 260 bytes.
|
||||
|
||||
## Customizing Makefile options on a per-keymap basis
|
||||
## Customizing Makefile Options on a Per-Keymap Basis
|
||||
|
||||
If your keymap directory has a file called `rules.mk` any options you set in that file will take precedence over other `rules.mk` options for your particular keyboard.
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Using the `/Vagrantfile` in this repository requires you have [Vagrant](http://w
|
|||
|
||||
Other than having Vagrant and Virtualbox installed and possibly a restart of your computer afterwards, you can simple run a 'vagrant up' anywhere inside the folder where you checked out this project and it will start a Linux virtual machine that contains all the tools required to build this project. There is a post Vagrant startup hint that will get you off on the right foot, otherwise you can also reference the build documentation below.
|
||||
|
||||
# Flashing the firmware
|
||||
# Flashing the Firmware
|
||||
|
||||
The "easy" way to flash the firmware is using a tool from your host OS:
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Glossary of QMK terms
|
||||
# Glossary of QMK Terms
|
||||
|
||||
## ARM
|
||||
A line of 32-bit MCU's produced by a number of companies, such as Atmel, Cypress, Kinetis, NXP, ST, and TI.
|
||||
|
@ -165,6 +165,6 @@ Universal Serial Bus, the most common wired interface for a keyboard.
|
|||
## USB Host (or simply Host)
|
||||
The USB Host is your computer, or whatever device your keyboard is plugged into.
|
||||
|
||||
# Couldn't find the term you're looking for?
|
||||
# Couldn't Find the Term You're Looking For?
|
||||
|
||||
[Open an issue](https://github.com/qmk/qmk_firmware/issues) with your question and the term in question could be added here. Better still, open a pull request with the definition. :)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Quantum Hand-wiring Guide
|
||||
# Quantum Hand-Wiring Guide
|
||||
|
||||
Parts list:
|
||||
* *x* keyswitches (MX, Matias, Gateron, etc)
|
||||
|
@ -11,7 +11,7 @@ Parts list:
|
|||
* Tweezers (optional)
|
||||
* Wire cutters/snippers
|
||||
|
||||
## How the matrix works (why we need diodes)
|
||||
## How the Matrix Works (Why We Need Diodes)
|
||||
|
||||
The microcontroller (in this case, the Teensy 2.0) will be setup up via the firmware to send a logical 1 to the columns, one at a time, and read from the rows, all at once - this process is called matrix scanning. The matrix is a bunch of open switches that, by default, don't allow any current to pass through - the firmware will read this as no keys being pressed. As soon as you press one key down, the logical 1 that was coming from the column the keyswitch is attached to gets passed through the switch and to the corresponding row - check out the following 2x2 example:
|
||||
|
||||
|
@ -100,9 +100,9 @@ Things act as they should! Which will get us the following data:
|
|||
|
||||
The firmware can then use this correct data to detect what it should do, and eventually, what signals it needs to send to the OS.
|
||||
|
||||
# The actual hand-wiring
|
||||
# The Actual Hand-Wiring
|
||||
|
||||
## Getting things in place
|
||||
## Getting Things in Place
|
||||
|
||||
When starting this, you should have all of your stabilisers and keyswitches already installed (and optionally keycaps). If you're using a Cherry-type stabiliser (plate-mounted only, obviously), you'll need to install that before your keyswitches. If you're using Costar ones, you can installed them afterwards.
|
||||
|
||||
|
@ -112,7 +112,7 @@ Get your soldering iron heated-up and collect the rest of the materials from the
|
|||
|
||||
Before continuing, plan out where you're going to place your Teensy. If you're working with a board that has a large (6.25u) spacebar, it may be a good idea to place it in-between switches against the plate. Otherwise, you may want to trim some of the leads on the keyswitches where you plan on putting it - this will make it a little harder to solder the wire/diodes, but give you more room to place the Teensy.
|
||||
|
||||
## Preparing the diodes
|
||||
## Preparing the Diodes
|
||||
|
||||
It's a little easier to solder the diodes in place if you bend them at a 90º angle immediately after the black line - this will help to make sure you put them on the right way (direction matters), and in the correct position. The diodes will look like this when bent (with longer leads):
|
||||
|
||||
|
@ -125,7 +125,7 @@ It's a little easier to solder the diodes in place if you bend them at a 90º an
|
|||
|
||||
We'll be using the long lead at the bent end to connect it to the elbow (bent part) of the next diode, creating the row.
|
||||
|
||||
## Soldering the diodes
|
||||
## Soldering the Diodes
|
||||
|
||||
Starting at the top-left switch, place the diode (with tweezers if you have them) on the switch so that the diode itself is vertically aligned, and the black line is facing toward you. The straight end of the diode should be touching the left contact on the switch, and the bent end should be facing to the right and resting on the switch there, like this:
|
||||
|
||||
|
@ -159,7 +159,7 @@ After completing a row, use the wire cutters to trim the excess wire from the to
|
|||
|
||||
When all of the diodes are completely soldered, it's a good idea to quickly inspect each one to ensure that your solder joints are solid and sturdy - repairing things after this is possible, but more difficult.
|
||||
|
||||
## Soldering the columns
|
||||
## Soldering the Columns
|
||||
|
||||
You'll have some options in the next process - it's a good idea to insulate the column wires (since the diodes aren't), but if you're careful enough, you can use exposed wires for the columns - it's not recommended, though. If you're using single-cored wire, stripping the plastic off of the whole wire and feeding it back on is probably the best option, but can be difficult depending on the size and materials. You'll want to leave parts of the wire exposed where you're going to be solder it onto the keyswitch.
|
||||
|
||||
|
@ -169,7 +169,7 @@ Before beginning to solder, it helps to have your wire pre-bent (if using single
|
|||
|
||||
If you're not using any insulation, you can try to keep the column wires elevated, and solder them near the tips of the keyswitch contacts - if the wires are sturdy enough, they won't short out to the row wiring an diodes.
|
||||
|
||||
## Wiring things to the Teensy
|
||||
## Wiring Things to the Teensy
|
||||
|
||||
Now that the matrix itself is complete, it's time to connect what you've done to the Teensy. You'll be needing the number of pins equal to your number of columns + your number of rows. There are some pins on the Teensy that are special, like D6 (the LED on the chip), or some of the UART, SPI, I2C, or PWM channels, but only avoid those if you're planning something in addition to a keyboard. If you're unsure about wanting to add something later, you should have enough pins in total to avoid a couple.
|
||||
|
||||
|
@ -185,7 +185,7 @@ When you're done with the columns, start with the rows in the same process, from
|
|||
|
||||
As you move along, be sure that the Teensy is staying in place - recutting and soldering the wires is a pain!
|
||||
|
||||
# Getting some basic firmware set-up
|
||||
# Getting Some Basic Firmware Set Up
|
||||
|
||||
From here, you should have a working keyboard once you program a firmware. Before we attach the Teensy permanently to the keyboard, let's quickly get some firmware loaded onto the Teensy so we can test each keyswitch.
|
||||
|
||||
|
@ -201,13 +201,13 @@ You'll want to navigate to the `keyboards/<project_name>/` folder by typing, lik
|
|||
|
||||
cd keyboards/<project_name>
|
||||
|
||||
### config.h
|
||||
### `config.h`
|
||||
|
||||
The first thing you're going to want to modify is the `config.h` file. Find `MATRIX_ROWS` and `MATRIX_COLS` and change their definitions to match the dimensions of your keyboard's matrix.
|
||||
|
||||
Farther down are `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`. Change their definitions to match how you wired up your matrix (looking from the top of the keyboard, the rows run top-to-bottom and the columns run left-to-right). Likewise, change the definition of `UNUSED_PINS` to match the pins you did not use (this will save power).
|
||||
|
||||
### \<project_name\>.h
|
||||
### `<project_name>.h`
|
||||
|
||||
The next file you'll want to look at is `<project_name>.h`. You're going to want to rewrite the `KEYMAP` definition - the format and syntax here is extremely important, so pay attention to how things are setup. The first half of the definition are considered the arguments - this is the format that you'll be following in your keymap later on, so you'll want to have as many k*xy* variables here as you do keys. The second half is the part that the firmware actually looks at, and will contain gaps depending on how you wired your matrix.
|
||||
|
||||
|
@ -271,7 +271,7 @@ This would require our `KEYMAP` definition to look like this:
|
|||
|
||||
Notice how the `k11` and `KC_NO` switched places to represent the wiring, and the unused final column on the bottom row. Sometimes it'll make more sense to put a keyswitch on a particular column, but in the end, it won't matter, as long as all of them are accounted for. You can use this process to write out the `KEYMAP` for your entire keyboard - be sure to remember that your keyboard is actually backwards when looking at the underside of it.
|
||||
|
||||
### keymaps/<variant>/default.c
|
||||
### `keymaps/<variant>/default.c`
|
||||
|
||||
This is the actual keymap for your keyboard, and the main place you'll make changes as you perfect your layout. `default.c` is the file that gets pull by default when typing `make`, but you can make other files as well, and specify them by typing `make handwired/<keyboard>:<variant>`, which will pull `keymaps/<variant>/keymap.c`.
|
||||
|
||||
|
@ -302,7 +302,7 @@ Note that the layout of the keycodes is similar to the physical layout of our ke
|
|||
|
||||
It's also important to use the `KEYMAP` function we defined earlier - this is what allows the firmware to associate our intended readable keymap with the actual wiring.
|
||||
|
||||
## Compiling your firmware
|
||||
## Compiling Your Firmware
|
||||
|
||||
After you've written out your entire keymap, you're ready to get the firmware compiled and onto your Teensy. Before compiling, you'll need to get your [development environment set-up](getting_started_build_tools.md) - you can skip the dfu-programmer instructions, but you'll need to download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html) to get the firmware on your Teensy.
|
||||
|
||||
|
@ -310,7 +310,7 @@ Once everything is installed, running `make` in the terminal should get you some
|
|||
|
||||
Once you have your `<project_name>.hex` file, open up the Teensy loader application, and click the file icon. From here, navigate to your `QMK/keyboards/<project_name>/` folder, and select the `<project_name>.hex` file. Plug in your keyboard and press the button on the Teensy - you should see the LED on the device turn off once you do. The Teensy Loader app will change a little, and the buttons should be clickable - click the download button (down arrow), and then the reset button (right arrow), and your keyboard should be ready to go!
|
||||
|
||||
## Testing your firmware
|
||||
## Testing Your Firmware
|
||||
|
||||
Carefully flip your keyboard over, open up a new text document, and try typing - you should get the characters that you put into your keymap. Test each key, and note the ones that aren't working. Here's a quick trouble-shooting guide for non-working keys:
|
||||
|
||||
|
@ -324,7 +324,7 @@ Carefully flip your keyboard over, open up a new text document, and try typing -
|
|||
|
||||
If you've done all of these things, keep in mind that sometimes you might have had multiple things affecting the keyswitch, so it doesn't hurt to test the keyswitch by shorting it out at the end.
|
||||
|
||||
# Securing the Teensy, finishing your hardware, getting fancier firmware
|
||||
# Securing the Teensy, Finishing Your Hardware, Getting Fancier Firmware
|
||||
|
||||
Now that you have a working board, it's time to get things in their permanent positions. I've often used liberal amounts of hot glue to secure and insulate things, so if that's your style, start spreading that stuff like butter. Otherwise, double-sided tape is always an elegant solution, and electrical tape is a distant second. Due to the nature of these builds, a lot of this part is up to you and how you planned (or didn't plan) things out.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Keyboards With AVR Processors
|
||||
# Keyboards with AVR Processors
|
||||
|
||||
This page describes the support for for AVR processors in QMK. AVR processors include the atmega32u4, atmega32u2, at90usb1286, and other processors from Atmel Corporation. AVR processors are 8-bit MCU's that are designed to be easy to work with. The most common AVR processors in keyboards have on-board USB and plenty of GPIO for supporting large keyboard matrices. They are the most popular MCU for use in keyboards today.
|
||||
|
||||
|
@ -154,4 +154,3 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
|||
### Build Options
|
||||
|
||||
There are a number of features that can be turned on or off in `rules.mk`. See the [Config Options](config_options.md#feature-options) page for a detailed list and description.
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ QMK is used on a lot of different hardware. While support for the most common MC
|
|||
|
||||
# Available Drivers
|
||||
|
||||
## ProMicro (AVR only)
|
||||
## ProMicro (AVR Only)
|
||||
|
||||
Support for addressing pins on the ProMicro by their Arduino name rather than their AVR name. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
||||
|
||||
## SSD1306 (AVR only)
|
||||
## SSD1306 (AVR Only)
|
||||
|
||||
Support for SSD1306 based OLED displays. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
||||
|
||||
|
@ -22,6 +22,6 @@ Support for SSD1306 based OLED displays. This needs to be better documented, if
|
|||
|
||||
You can make use of uGFX within QMK to drive character and graphic LCD's, LED arrays, OLED, TFT, and other display technologies. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
||||
|
||||
## WS2812 (AVR only)
|
||||
## WS2812 (AVR Only)
|
||||
|
||||
Support for WS2811/WS2812{a,b,c} LED's. For more information see the [RGB Light](feature_rgblight.md) page.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
We welcome all keyboard projects into QMK, but ask that you try to stick to a couple guidelines that help us keep things organised and consistent.
|
||||
|
||||
## Naming your keyboard/project
|
||||
## Naming Your Keyboard/Project
|
||||
|
||||
All names should be lowercase alphanumeric, and separated by an underscore (`_`), but not begin with one. Your directory and your `.h` and `.c` files should have exactly the same name. All folders should follow the same format.
|
||||
|
||||
|
@ -10,7 +10,7 @@ All names should be lowercase alphanumeric, and separated by an underscore (`_`)
|
|||
|
||||
All projects need to have a `readme.md` file that explains what the keyboard is, who made it, where it is available, and links to more information. Please follow the [published template](documentation_templates.md#keyboard-readmemd-template).
|
||||
|
||||
## Image/Hardware files
|
||||
## Image/Hardware Files
|
||||
|
||||
In an effort to keep the repo size down, we're no longer accepting images of any format in the repo, with few exceptions. Hosting them elsewhere (imgur) and linking them in the `readme.md` is the preferred method.
|
||||
|
||||
|
@ -95,7 +95,7 @@ All key positions and rotations are specified in relation to the top-left corner
|
|||
* **Important**: These are relative to the top-left of the key, not absolute.
|
||||
* Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]`
|
||||
|
||||
### How Is The Metadata Exposed?
|
||||
### How is the Metadata Exposed?
|
||||
|
||||
This metadata is primarily used in two ways:
|
||||
|
||||
|
@ -104,11 +104,11 @@ This metadata is primarily used in two ways:
|
|||
|
||||
Configurator authors can see the [QMK Compiler](https://docs.compile.qmk.fm/api_docs.html) docs for more information on using the JSON API.
|
||||
|
||||
## Non-production/handwired projects
|
||||
## Non-Production/Handwired Projects
|
||||
|
||||
We're happy to accept any project that uses QMK, including prototypes and handwired ones, but we have a separate `/keyboards/handwired/` folder for them, so the main `/keyboards/` folder doesn't get overcrowded. If a prototype project becomes a production project at some point in the future, we'd be happy to move it to the main `/keyboards/` folder!
|
||||
|
||||
## Warnings as errors
|
||||
## Warnings as Errors
|
||||
|
||||
When developing your keyboard, keep in mind that all warnings will be treated as errors - these small warnings can build-up and cause larger errors down the road (and keeping them is generally a bad practice).
|
||||
|
||||
|
@ -132,6 +132,6 @@ The core of QMK is licensed under the [GNU General Public License](https://www.g
|
|||
|
||||
If your keyboard makes use of the [uGFX](https://ugfx.io) features within QMK you must comply with the [uGFX License](https://ugfx.io/license.html), which requires a separate commercial license before selling a device containing uGFX.
|
||||
|
||||
## Technical details
|
||||
## Technical Details
|
||||
|
||||
If you're looking for more information on making your keyboard work with QMK, [check out the hardware section](hardware.md)!
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# How keys are registered, and interpreted by computers
|
||||
# How Keys Are Registered, and Interpreted by Computers
|
||||
|
||||
In this file, you can will learn the concepts of how keyboards work over USB,
|
||||
and you'll be able to better understand what you can expect from changing your
|
||||
firmware directly.
|
||||
|
||||
## Schematic view
|
||||
## Schematic View
|
||||
|
||||
Whenever you type on 1 particular key, here is the chain of actions taking
|
||||
place:
|
||||
|
@ -49,7 +49,7 @@ layout is set to QWERTY, a sample of the matching table is as follow:
|
|||
| 0x1D | z/Z |
|
||||
| ... | ... |
|
||||
|
||||
## Back to the firmware
|
||||
## Back to the Firmware
|
||||
|
||||
As the layout is generally fixed (unless you create your own), the firmware can actually call a keycode by its layout name directly to ease things for you. This is exactly what is done here with `KC_A` actually representing `0x04` in QWERTY. The full list can be found in [keycodes](keycodes.md).
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ If you're having trouble flashing/erasing your board, and running into cryptic e
|
|||
|
||||
You're likely going to need to ISP flash your board/device to get it working again. Luckily, this process is pretty straight-forward, provided you have any extra programmable keyboard, Arduino, or Teensy 2.0/Teensy 2.0++. There are also dedicated ISP flashers available for this, but most cost >$15, and it's assumed that if you are googling this error, this is the first you've heard about ISP flashing, and don't have one readily available (whereas you might have some other AVR board). __We'll be using a Teensy 2.0 with Windows 10 in this guide__ - if you are comfortable doing this on another system, please consider editing this guide and contributing those instructions!
|
||||
|
||||
## Software needed
|
||||
## Software Needed
|
||||
|
||||
* [The Arduino IDE](https://www.arduino.cc/en/Main/Software)
|
||||
* [Teensyduino](https://www.pjrc.com/teensy/td_download.html) (if you're using a Teensy)
|
||||
|
@ -38,7 +38,7 @@ This is pretty straight-forward - we'll be connecting like-things to like-things
|
|||
Flasher VCC <-> Keyboard VCC
|
||||
Flasher GND <-> Keyboard GND
|
||||
|
||||
## The ISP firmware
|
||||
## The ISP Firmware
|
||||
|
||||
Make sure your keyboard is unplugged from any device, and plug in your Teensy.
|
||||
|
||||
|
@ -62,13 +62,13 @@ And make the changes in the last four lines. If you're using something besides t
|
|||
|
||||
Once you've made your changes, you can click the Upload button (right arrow), which will open up the Teensy flasher app - you'll need to press the reset button on the Teensy the first time, but after that, it's automatic (you shouldn't be flashing this more than once, though). Once flashed, the orange LED on the Teensy will flash on and off, indicating it's ready for some action.
|
||||
|
||||
## The .hex file
|
||||
## The `.hex` File
|
||||
|
||||
Before flashing your firmware, you're going to need to and do a little preparation. We'll be appending [this bootloader (also a .hex file)](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1_0_0.hex) to the end of our firmware by opening the original .hex file in a text editor, and removing the last line, which should be `:00000001FF` (this is an EOF message). After that's been removed, copy the entire bootloader's contents and paste it at the end of the original file, and save it.
|
||||
|
||||
It's possible to use other bootloaders here in the same way, but __you need a bootloader__, otherwise you'll have to ISP to write new firmware to your keyboard.
|
||||
|
||||
## Flashing your firmware
|
||||
## Flashing Your Firmware
|
||||
|
||||
Make sure your keyboard is unplugged from any device, and plug in your Teensy.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Basic keycodes
|
||||
# Basic Keycodes
|
||||
|
||||
Basic keycodes are based on [HID Usage Keyboard/Keypad Page(0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with following exceptions:
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# US ANSI Shifted symbols
|
||||
# US ANSI Shifted Symbols
|
||||
|
||||
These 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.
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
QMK keymaps are defined inside a C source file. The data structure is an array of arrays. The outer array is a list of layer arrays while the inner layer array is a list of keys. Most keyboards define a `KEYMAP()` macro to help you create this array of arrays.
|
||||
|
||||
|
||||
## Keymap and layers
|
||||
## Keymap and Layers
|
||||
In QMK, **`const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]`** holds multiple **layers** of keymap information in **16 bit** data holding the **action code**. You can define **32 layers** at most.
|
||||
|
||||
For trivial key definitions, the higher 8 bits of the **action code** are all 0 and the lower 8 bits holds the USB HID usage code generated by the key as **keycode**.
|
||||
|
@ -27,7 +27,7 @@ Respective layers can be validated simultaneously. Layers are indexed with 0 to
|
|||
|
||||
Sometimes, the action code stored in keymap may be referred as keycode in some documents due to the TMK history.
|
||||
|
||||
### Keymap layer status
|
||||
### Keymap Layer Status
|
||||
The state of the Keymap layer is determined by two 32 bit parameters:
|
||||
|
||||
* **`default_layer_state`** indicates a base keymap layer (0-31) which is always valid and to be referred (the default layer).
|
||||
|
@ -75,7 +75,7 @@ Note that ***higher layer has higher priority on stack of layers***, namely firm
|
|||
You can place `KC_TRANS` on overlay layer changes just part of layout to fall back on lower or base layer.
|
||||
Key with `KC_TRANS` (`KC_TRNS` and `_______` are the alias) doesn't has its own keycode and refers to lower valid layers for keycode, instead.
|
||||
|
||||
## Anatomy Of A `keymap.c`
|
||||
## Anatomy of a `keymap.c`
|
||||
|
||||
For this example we will walk through an [older version of the default Clueboard 66% keymap](https://github.com/qmk/qmk_firmware/blob/ca01d94005f67ec4fa9528353481faa622d949ae/keyboards/clueboard/keymaps/default/keymap.c). You'll find it helpful to open that file in another browser window so you can look at everything in context.
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ All keycodes within quantum are numbers between `0x0000` and `0xFFFF`. Within yo
|
|||
|
||||
On 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.
|
||||
|
||||
## QMK keycodes
|
||||
## QMK Keycodes
|
||||
|
||||
|Name|Description|
|
||||
|----|-----------|
|
||||
|
|
|
@ -18,7 +18,7 @@ Note that Google Test and therefore any test has to be written in C++, even if t
|
|||
|
||||
One thing to remember, is that you have to append `extern "C"` around all of your C file includes.
|
||||
|
||||
## Adding tests for new or existing features
|
||||
## Adding Tests for New or Existing Features
|
||||
|
||||
If you want to unit test some feature, then take a look at the existing serial_link tests, in the `quantum/serial_link/tests folder`, and follow the steps below to create a similar structure.
|
||||
|
||||
|
@ -34,21 +34,21 @@ If you want to unit test some feature, then take a look at the existing serial_l
|
|||
|
||||
Note how there's several different tests, each mocking out a separate part. Also note that each of them only compiles the very minimum that's needed for the tests. It's recommend that you try to do the same. For a relevant video check out [Matt Hargett "Advanced Unit Testing in C & C++](https://www.youtube.com/watch?v=Wmy6g-aVgZI)
|
||||
|
||||
## Running the tests
|
||||
## Running the Tests
|
||||
|
||||
To run all the tests in the codebase, type `make test`. You can also run test matching a substring by typing `make test:matchingsubstring` Note that the tests are always compiled with the native compiler of your platform, so they are also run like any other program on your computer.
|
||||
|
||||
## Debugging the tests
|
||||
## Debugging the Tests
|
||||
|
||||
If there are problems with the tests, you can find the executable in the `./build/test` folder. You should be able to run those with GDB or a similar debugger.
|
||||
|
||||
## Full Integration tests
|
||||
## Full Integration Tests
|
||||
|
||||
It's not yet possible to do a full integration test, where you would compile the whole firmware and define a keymap that you are going to test. However there are plans for doing that, because writing tests that way would probably be easier, at least for people that are not used to unit testing.
|
||||
|
||||
In that model you would emulate the input, and expect a certain output from the emulated keyboard.
|
||||
|
||||
# Tracing variables
|
||||
# Tracing Variables
|
||||
|
||||
Sometimes you might wonder why a variable gets changed and where, and this can be quite tricky to track down without having a debugger. It's of course possible to manually add print statements to track it, but you can also enable the variable trace feature. This works for both for variables that are changed by the code, and when the variable is changed by some memory corruption.
|
||||
|
||||
|
@ -65,4 +65,4 @@ This will add a traced variable named "layer" (the name is just for your informa
|
|||
|
||||
In order to actually detect changes to the variables you should call `VERIFY_TRACED_VARIABLES` around the code that you think that modifies the variable. If a variable is modified it will tell you between which two `VERIFY_TRACED_VARIABLES` calls the modification happened. You can then add more calls to track it down further. I don't recommend spamming the codebase with calls. It's better to start with a few, and then keep adding them in a binary search fashion. You can also delete the ones you don't need, as each call need to store the file name and line number in the ROM, so you can run out of memory if you add too many calls.
|
||||
|
||||
Also remember to delete all the tracing code once you have found the bug, as you wouldn't want to create a pull request with tracing code.
|
||||
Also remember to delete all the tracing code once you have found the bug, as you wouldn't want to create a pull request with tracing code.
|
||||
|
|
Loading…
Reference in New Issue
Block a user