From 08c682c193f43e5d54df990680ae93fc2e06150a Mon Sep 17 00:00:00 2001 From: Evan Travers Date: Tue, 28 Aug 2018 19:35:24 -0500 Subject: Docs: Add docs for the `LAYOUT_*` macro to layouts (#3772) When moving my planck layout to my let's split, I ran into this issue because I had copied my planck layout from the default layout which just used the `{}` array form for the keymap layers. I checked the docs, but this bit wasn't clear to me. I'm sure @ishtob or @drashna helped me on discord, but this seemed to be the logical place to add a helpful hint. --- docs/feature_layouts.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/feature_layouts.md b/docs/feature_layouts.md index bfae920440..1ee8b5e35c 100644 --- a/docs/feature_layouts.md +++ b/docs/feature_layouts.md @@ -53,6 +53,8 @@ but the `LAYOUT_` variable must be defined in `.h` as well. ## Tips for Making Layouts Keyboard-Agnostic +### Includes + Instead of using `#include "planck.h"`, you can use this line to include whatever `.h` (`.h` should not be included here) file that is being compiled: #include QMK_KEYBOARD_H @@ -72,3 +74,7 @@ For example: ``` Note that the names are lowercase and match the folder/file names for the keyboard/revision exactly. + +### Keymaps + +In order to support both split and non-split keyboards with the same layout, you need to use the keyboard agnostic `LAYOUT_` macro in your keymap. For instance, in order for a Let's Split and Planck to share the same layout file, you need to use `LAYOUT_ortho_4x12` instead of `LAYOUT_planck_grid` or just `{}` for a C array. -- cgit v1.2.3 From 097f1a299f2d0e0e5afe174b8cfc1eea1b00c7cf Mon Sep 17 00:00:00 2001 From: fauxpark Date: Thu, 30 Aug 2018 11:05:02 +1000 Subject: Mask off keycode/layer/mod where possible in LT(), MT(), etc. (#3430) * Mask off keycode/layer/mod where possible in LT(), MT(), etc. * Don't need these parentheses * Put back parentheses for order of operations --- docs/feature_advanced_keycodes.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index f93b8033a5..5713234be1 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -13,9 +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 +### Caveats -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). +Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored. + +Additionally, if at least one right-handed modifier is specified in a Mod Tap or Layer Tap, it will cause all modifiers specified to become right-handed, so it is not possible to mix and match the two. # Switching and Toggling Layers @@ -103,10 +105,6 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift. -?> Due to the way that keycodes are structured, any modifiers specified as part of `kc`, such as `LCTL()` or `KC_LPRN`, will only activate when held instead of tapped. - -?> Additionally, if there is at least one right-handed modifier, any other modifiers in a chain of functions will turn into their right-handed equivalents, so it is not possible to "mix and match" the two. - # One Shot Keys One shot keys are keys that remain active until the next key is pressed, and then are released. This allows you to type keyboard combinations without pressing more than one key at a time. These keys are usually called "Sticky keys" or "Dead keys". -- cgit v1.2.3 From 4cd4e1ded686f2799cfd87750200fcd6fba445ee Mon Sep 17 00:00:00 2001 From: arlenk <33534303+arlenk@users.noreply.github.com> Date: Wed, 29 Aug 2018 21:20:41 -0400 Subject: Docs: add process_terminal() and update links to other functions (#3778) * add process_terminal() and update links to other functions * convert links to permalinks and add a few missing process_* functions * update links in main text as well --- docs/understanding_qmk.md | 53 ++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 24 deletions(-) (limited to 'docs') diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md index 4544cb2602..bf695d008d 100644 --- a/docs/understanding_qmk.md +++ b/docs/understanding_qmk.md @@ -12,7 +12,7 @@ You can think of QMK as no different from any other computer program. It is star The reason for this is the different platforms that QMK supports. The most common platform is `lufa`, which runs on AVR processors such at the atmega32u4. We also support `chibios` and `vusb`. -We'll focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1129). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1182). This is [The Main Loop](#the_main_loop). +We'll focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/tmk_core/protocol/lufa/lufa.c#L1019). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/tmk_core/protocol/lufa/lufa.c#L1060). This is [The Main Loop](#the-main-loop). ## The Main Loop @@ -22,7 +22,7 @@ This section of code is called "The Main Loop" because it's responsible for loop keyboard_task(); ``` -This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keyboard.c#L154), and it is responsible for detecting changes in the matrix and turning status LED's on and off. +This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/tmk_core/common/keyboard.c#L206), and it is responsible for detecting changes in the matrix and turning status LED's on and off. Within `keyboard_task()` you'll find code to handle: @@ -77,7 +77,7 @@ At the keyboard level we define a C macro (typically named `KEYMAP()`) which map Notice how the second block of our `KEYMAP()` macro matches the Matrix Scanning array above? This macro is what will map the matrix scanning array to keycodes. However, if you look at a 17 key numpad you'll notice that it has 3 places where the matrix could have a switch but doesn't, due to larger keys. We have populated those spaces with `KC_NO` so that our keymap definition doesn't have to. -You can also use this macro to handle unusual matrix layouts, for example the [Clueboard rev 2](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/rev2/rev2.h). Explaining that is outside the scope of this document. +You can also use this macro to handle unusual matrix layouts, for example the [Clueboard rev 2](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/keyboards/clueboard/66/rev2/rev2.h). Explaining that is outside the scope of this document. ##### Keycode Assignment @@ -129,27 +129,32 @@ Comparing against our keymap we can see that the pressed key is KC_NLCK. From he ##### Process Record - -The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is described below, using cluecard whenever we need to look at the keyboard/keymap level functions. - -* [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L128) - * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L140) - * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L143) - * [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/card/card.c#L20) - * [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/card/keymaps/default/keymap.c#L58) - * [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_midi.c#L102) - * [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_audio.c#L10) - * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_music.c#L69) - * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_tap_dance.c#L75) - * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_leader.c#L32) - * [`bool process_chording(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_chording.c#L41) - * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_combo.c#L115) - * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode.c#L22) - * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_ucis.c#L91) - * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_printer.c#L77) - * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_auto_shift.c#L47) - * [`bool process_unicode_map(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicodemap.c#L47) - * [Identify and process quantum specific keycodes](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L211) +The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is listed below, using cluecard whenever we need to look at the keyboard/keymap level functions. Depending on options set in rule.mk or elsewhere, only a subset of the functions below will be included in final firmware. + +* [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/tmk_core/common/action.c#L172) + * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/quantum.c#L193) + * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/quantum.c#L213) + * [`void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/process_keycode/process_tap_dance.c#L115) + * [`bool process_key_lock(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/process_keycode/process_key_lock.c#L62) + * [`bool process_clicky(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/process_keycode/process_clicky.c#L44) + * [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/keyboards/clueboard/card/card.c#L20) + * [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/keyboards/clueboard/card/keymaps/default/keymap.c#L58) + * [`bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/fdd0f915271f79b104aa5d216566bcc3fd134e85/quantum/rgb_matrix.c#L139) + * [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_midi.c#L81) + * [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_audio.c#L19) + * [`bool process_steno(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_steno.c#L160) + * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_music.c#L114) + * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_tap_dance.c#L136) + * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_leader.c#L38) + * [`bool process_chording(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_chording.c#L41) + * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_combo.c#L115) + * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_unicode.c#L22) + * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_ucis.c#L91) + * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_printer.c#L77) + * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_auto_shift.c#L94) + * [`bool process_unicode_map(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_unicodemap.c#L47) + * [`bool process_terminal(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_terminal.c#L264) + * [Identify and process quantum specific keycodes](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/quantum.c#L287) At any step during this chain of events a function (such as `process_record_kb()`) can `return false` to halt all further processing. -- cgit v1.2.3 From 1acaf2b2c22eb6bd77374b93101480207829db04 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Thu, 30 Aug 2018 16:22:29 +1000 Subject: Tweak the wording in "Becoming a QMK Collaborator" --- docs/becoming_a_qmk_collaborator.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/becoming_a_qmk_collaborator.md b/docs/becoming_a_qmk_collaborator.md index 3cac63c97b..16ae0d569e 100644 --- a/docs/becoming_a_qmk_collaborator.md +++ b/docs/becoming_a_qmk_collaborator.md @@ -1,7 +1,9 @@ -A QMK collaborator is a keyboard maker/designer that is interested in helping QMK grow and fully support their keyboard(s), and encouraging their users/customers to submit features, ideas, and keymaps. We're always looking to add more keyboards and collaborators, but we ask that they fulfill these requirements: +# Becoming a QMK Collaborator -* **Have a PCB available for sale** - unfortunately there's just too much variation and complications with handwired keyboards. -* **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. +A QMK collaborator is a keyboard maker or designer that is interested in helping QMK grow and fully support their keyboard(s), and encouraging their users and customers to submit features, ideas, and keymaps. We're always looking to add more keyboards and collaborators, but we ask that they fulfill these requirements: + +* **Have a PCB available for sale.** Unfortunately there's just too much variation and complications with handwired keyboards. +* **Maintain your keyboard in QMK.** This may just require an initial setup to get your keyboard working, but it could also include accommodating changes made to QMK's core that might break or render any custom code redundant. +* **Approve and merge keymap pull requests for your keyboard.** 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! -- cgit v1.2.3 From ce3ccd3f4a5e8ff8ac391887f3357dd8e985a452 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 31 Aug 2018 02:37:05 +1000 Subject: Docs: Tabulate Modifier & Mod-Tap keycode listings in advanced keycodes docs (#3799) --- docs/feature_advanced_keycodes.md | 114 ++++++++++++++++++++++---------------- docs/keycodes.md | 4 +- 2 files changed, 69 insertions(+), 49 deletions(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 5713234be1..5f30359e0d 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -57,53 +57,73 @@ Sometimes, you might want to switch between layers in a macro or as part of a ta # 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. - -* `LSFT(kc)` or `S(kc)` - applies left Shift to *kc* (keycode) -* `RSFT(kc)` - applies right Shift to *kc* -* `LCTL(kc)` - applies left Control to *kc* -* `RCTL(kc)` - applies right Control to *kc* -* `LALT(kc)` - applies left Alt to *kc* -* `RALT(kc)` - applies right Alt to *kc* -* `LGUI(kc)` - applies left GUI (command/win) to *kc* -* `RGUI(kc)` - applies right GUI (command/win) to *kc* -* `HYPR(kc)` - applies Hyper (all modifiers) to *kc* -* `MEH(kc)` - applies Meh (all modifiers except Win/Cmd) to *kc* -* `LCAG(kc)` - applies CtrlAltGui to *kc* - -You can also chain these, like this: - - LALT(LCTL(KC_DEL)) -- this makes a key that sends Alt, Control, and Delete in a single keypress. - -# Mod Tap - -`MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down. - -These are the values you can use for the `mod` in `MT()` and `OSM()`: - - * MOD_LCTL - * MOD_LSFT - * MOD_LALT - * MOD_LGUI - * MOD_RCTL - * MOD_RSFT - * MOD_RALT - * MOD_RGUI - * MOD_HYPR - * MOD_MEH - -These can also be combined like `MOD_LCTL | MOD_LSFT` e.g. `MT(MOD_LCTL | MOD_LSFT, KC_ESC)` which would activate Control and Shift when held, and send Escape when tapped. - -We've added shortcuts to make common modifier/tap (mod-tap) mappings more compact: - - * `CTL_T(kc)` - is LCTL when held and *kc* when tapped - * `SFT_T(kc)` - is LSFT when held and *kc* when tapped - * `ALT_T(kc)` - is LALT when held and *kc* when tapped - * `ALGR_T(kc)` - is AltGr when held and *kc* when tapped - * `GUI_T(kc)` - is LGUI when held and *kc* when tapped - * `ALL_T(kc)` - is Hyper (all mods) when held and *kc* when tapped. To read more about what you can do with a Hyper key, see [this blog post by Brett Terpstra](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) - * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped - * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift. +These allow you to combine a modifier with a keycode. When pressed, the keydown event for the modifier, then `kc` will be sent. On release, the keyup event for `kc`, then the modifier will be sent. + +|Key |Aliases |Description | +|----------|----------------------|----------------------------------------------------| +|`LCTL(kc)`| |Hold Left Control and press `kc` | +|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | +|`LALT(kc)`| |Hold Left Alt and press `kc` | +|`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | +|`RCTL(kc)`| |Hold Right Control and press `kc` | +|`RSFT(kc)`| |Hold Right Shift and press `kc` | +|`RALT(kc)`| |Hold Right Alt and press `kc` | +|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | +|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| +|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | +|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | +|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` | +|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | +|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | + +You can also chain them, for example `LCTL(LALT(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress. + +# Mod-Tap + +The Mod-Tap key `MT(mod, kc)` acts like a modifier when held, and a regular keycode when tapped. In other words, you can have a key that sends Escape when you tap it, but functions as a Control or Shift key when you hold it down. + +The modifiers this keycode and `OSM()` accept are prefixed with `MOD_`, not `KC_`: + +|Modifier |Description | +|----------|----------------------------------------| +|`MOD_LCTL`|Left Control | +|`MOD_LSFT`|Left Shift | +|`MOD_LALT`|Left Alt | +|`MOD_LGUI`|Left GUI (Windows/Command/Meta key) | +|`MOD_RCTL`|Right Control | +|`MOD_RSFT`|Right Shift | +|`MOD_RALT`|Right Alt | +|`MOD_RGUI`|Right GUI (Windows/Command/Meta key) | +|`MOD_HYPR`|Hyper (Left Control, Shift, Alt and GUI)| +|`MOD_MEH` |Meh (Left Control, Shift, and Alt) | + +You can combine these by ORing them together like so: + +```c +MT(MOD_LCTL | MOD_LSFT, KC_ESC) +``` + +This key would activate Left Control and Left Shift when held, and send Escape when tapped. + +For convenience, QMK includes some Mod-Tap shortcuts to make common combinations more compact in your keymap: + +|Key |Aliases |Description | +|------------|---------------------------------------|-------------------------------------------------------| +|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped | +|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped | +|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped | +|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped | +|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped | +|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped | +|`LGUI_T(kc)`|`LCMD_T(kc)`, `RWIN_T(kc)`, `GUI_T(kc)`|Left GUI when held, `kc` when tapped | +|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | +|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped | +|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped| +|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped | +|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped | +|`ALL_T(kc)` | |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)| +|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | # One Shot Keys diff --git a/docs/keycodes.md b/docs/keycodes.md index fd3776bb72..c344a75283 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -318,7 +318,7 @@ This is a reference only. Each group of keys links to the page documenting their ## [Modifiers](feature_advanced_keycodes.md#modifier-keys) |Key |Aliases |Description | -|----------|---------- |----------------------------------------------------| +|----------|----------------------|----------------------------------------------------| |`KC_HYPR` | |Hold Left Control, Shift, Alt and GUI | |`KC_MEH` | |Hold Left Control, Shift and Alt | |`LCTL(kc)`| |Hold Left Control and press `kc` | @@ -353,7 +353,7 @@ This is a reference only. Each group of keys links to the page documenting their |`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped | |`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped | |`ALL_T(kc)` | |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)| -|`SCMD_T(kc)`|`SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | ## [RGB Lighting](feature_rgblight.md) -- cgit v1.2.3 From 73a3399d0ef7e06db70fc2964a3f2a35e9aca25d Mon Sep 17 00:00:00 2001 From: yiancar Date: Fri, 24 Aug 2018 15:38:31 +0300 Subject: Add the ability to disable the USB startup check for Chibios - Added support for NO_USB_STARTUP_CHECK. This allows the keyboard do function and not get stuck in a SUSPENDED state loop in case of no USB connection. - Added support for WAIT_FOR_USB. In LUFA no keyboard has this flag enable therefor no keyboard waits for usb to be active. - Added documentation for both configuration flags as they were missing. --- docs/config_options.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index e978bcce82..eaaa59872c 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -248,3 +248,7 @@ Use these to enable or disable building certain features. The more you have enab * Enable Bluetooth with the Adafruit EZ-Key HID * `SPLIT_KEYBOARD` * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common +* `WAIT_FOR_USB` + * Forces the keyboard to wait for a USB connection to be established before it starts up +* `NO_USB_STARTUP_CHECK` + * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master. -- cgit v1.2.3 From 6d6d91c834ef3415425e21d895d4ec91c67fd4b8 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Fri, 14 Sep 2018 02:24:10 +0900 Subject: rgblight.[ch] more configurable (#3582) * add temporary test code rgblight-macro-test1.[ch] * rgblight.h : mode auto numberring and auto generate mode name symbol No change in build result. * rgblight.c use RGBLIGHT_MODE_xxx symbols No change in build result. * quantum.c use RGBLIGHT_MODE_xxx symbols No change in build result. * fix build break. when RGB_MATRIX_ENABLE defined * add temporary test code rgblight-macro-test2.[ch] * modify rgblight_mode_eeprom_helper() and rgblight_sethsv_eeprom_helper() * modify rgblight_task() * configurable each effect compile on/off in config.h * update docs/feature_rgblight.md * fix conflict. docs/feature_rgblight.md * remove temporary test code rgblight-macro-test*.[ch] * fix comment typo. * remove old mode number from comment * update docs/feature_rgblight.md about effect mode * Revert "update docs/feature_rgblight.md about effect mode" This reverts commit 43890663fcc9dda1899df7a37d382fc38b1a6d6d. * some change docs/feature_rgblight.md * fix typo * docs/feature_rgblight.md update: revise mode number table --- docs/feature_rgblight.md | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'docs') diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index d48941a04f..925dca724b 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -79,20 +79,23 @@ Your RGB lighting can be configured by placing these `#define`s in your `config. ## Animations -Not only can this lighting be whatever color you want, if `RGBLIGHT_ANIMATIONS` is defined, you also have a number of animation modes at your disposal: - -|Mode |Description | -|-----|---------------------| -|1 |Solid color | -|2-5 |Solid color breathing| -|6-8 |Cycling rainbow | -|9-14 |Swirling rainbow | -|15-20|Snake | -|21-23|Knight | -|24 |Christmas | -|25-34|Static gradient | -|35 |RGB Test | -|36 |Alternating | + +Not only can this lighting be whatever color you want, +if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a number of animation modes at your disposal: + +|Mode number symbol |Additional number |Description | +|-----------------------------|-------------------|---------------------------------------| +|`RGBLIGHT_MODE_STATIC_LIGHT` | *None* |Solid color (this mode is always enabled) | +|`RGBLIGHT_MODE_BREATHING` | 0,1,2,3 |Solid color breathing | +|`RGBLIGHT_MODE_RAINBOW_MOOD` | 0,1,2 |Cycling rainbow | +|`RGBLIGHT_MODE_RAINBOW_SWIRL`| 0,1,2,3,4,5 |Swirling rainbow | +|`RGBLIGHT_MODE_SNAKE` | 0,1,2,3,4,5 |Snake | +|`RGBLIGHT_MODE_KNIGHT` | 0,1,2 |Knight | +|`RGBLIGHT_MODE_CHRISTMAS` | *None* |Christmas | +|`RGBLIGHT_MODE_STATIC_GRADIENT`| 0,1,..,9 |Static gradient | +|`RGBLIGHT_MODE_RGB_TEST` | *None* |RGB Test | +|`RGBLIGHT_MODE_ALTERNATING` | *None* |Alternating | + Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstration. @@ -100,7 +103,16 @@ The following options can be used to tweak the various animations: |Define |Default |Description | |------------------------------------|-------------|-------------------------------------------------------------------------------------| -|`RGBLIGHT_ANIMATIONS` |*Not defined*|If defined, enables additional animation modes | +|`RGBLIGHT_EFFECT_BREATHING` |*Not defined*|If defined, enable breathing animation mode. | +|`RGBLIGHT_EFFECT_RAINBOW_MOOD` |*Not defined*|If defined, enable rainbow mood animation mode. | +|`RGBLIGHT_EFFECT_RAINBOW_SWIRL` |*Not defined*|If defined, enable rainbow swirl animation mode. | +|`RGBLIGHT_EFFECT_SNAKE` |*Not defined*|If defined, enable snake animation mode. | +|`RGBLIGHT_EFFECT_KNIGHT` |*Not defined*|If defined, enable knight animation mode. | +|`RGBLIGHT_EFFECT_CHRISTMAS` |*Not defined*|If defined, enable christmas animation mode. | +|`RGBLIGHT_EFFECT_STATIC_GRADIENT` |*Not defined*|If defined, enable static gradient mode. | +|`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|If defined, enable RGB test animation mode. | +|`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|If defined, enable alternating animation mode. | +|`RGBLIGHT_ANIMATIONS` |*Not defined*|If defined, enables all additional animation modes | |`RGBLIGHT_EFFECT_BREATHE_CENTER` |`1.85` |Used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 | |`RGBLIGHT_EFFECT_BREATHE_MAX` |`255` |The maximum brightness for the breathing mode. Valid values are 1 to 255 | |`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation | -- cgit v1.2.3 From 170de1273cde78d93b3f955aca133a4d690742b2 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 13 Sep 2018 11:22:05 -0700 Subject: Add an easy way to create new keymaps for your favorite keyboard (#3868) * initial commit of keymap creation script * create default keymap * pass shellcheck * provide a better usage message * change printf string to more accurately reflect the path * make it more easily understood * found another typo * add documentation regarding the new_keymap script * enforce lowercase for userinputs --- docs/newbs_building_firmware.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs') diff --git a/docs/newbs_building_firmware.md b/docs/newbs_building_firmware.md index f227d623f0..ac6bff2bc7 100644 --- a/docs/newbs_building_firmware.md +++ b/docs/newbs_building_firmware.md @@ -22,6 +22,20 @@ Start by navigating to the `keymaps` folder for your keyboard. Once you have the `keymaps` folder open you will want to create a copy of the `default` folder. We highly recommend you name your folder the same as your GitHub username, but you can use any name you want as long as it contains only lower case letters, numbers, and the underscore character. +To automate the process, you also have the option to run the `new_keymap.sh` script. + +Navigate to the `qmk_firmware/util` directory and type the following: + +``` +./new_keymap.sh +``` + +For example, for a user named John, trying to make a new keymap for the 1up60hse, they would type in + +``` +./new_keymap.sh 1upkeyboards/1up60hse john +``` + ## Open `keymap.c` In Your Favorite Text Editor Open up your `keymap.c`. Inside this file you'll find the structure that controls how your keyboard behaves. At the top of `keymap.c` there may be some defines and enums that make the keymap easier to read. Farther down you'll find a line that looks like this: -- cgit v1.2.3 From b1f11636c63694f0e94504e5752e963c73f86c3b Mon Sep 17 00:00:00 2001 From: James Laird-Wah Date: Sat, 15 Sep 2018 11:50:12 +1000 Subject: docs/contributing: add `#pragma once` to Coding Conventions This supersedes the older include guard mechanism since all the compilers now support it. It's easier for new users and less prone to error. --- docs/contributing.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/contributing.md b/docs/contributing.md index 8242cc1adc..7ed7cd06a5 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -70,6 +70,7 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely * Do not write obvious comments * If you not sure if a comment is obvious, go ahead and include it. * In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns. +* We use `#pragma once` at the start of header files rather than old-style include guards (`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`) # General Guidelines -- cgit v1.2.3 From 743449472e58651ec8111e6f70811103fb0a28bd Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Mon, 17 Sep 2018 10:48:02 -0700 Subject: Make `PREVENT_STUCK_MODIFIERS` the default (#3107) * Remove chording as it is not documented, not used, and needs work. * Make Leader Key an optional feature. * Switch from `PREVENT_STUCK_MODIFIERS` to `STRICT_LAYER_RELEASE` * Remove `#define PREVENT_STUCK_MODIFIERS` from keymaps. --- docs/config_options.md | 4 ++-- docs/feature_leader_key.md | 8 ++++++++ docs/understanding_qmk.md | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index eaaa59872c..072857727b 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -119,8 +119,8 @@ If you define these options you will enable the associated feature, which may in * `#define FORCE_NKRO` * NKRO by default requires to be turned on, this forces it on during keyboard startup regardless of EEPROM setting. NKRO can still be turned off but will be turned on again if the keyboard reboots. -* `#define PREVENT_STUCK_MODIFIERS` - * stores the layer a key press came from so the same layer is used when the key is released, regardless of which layers are enabled +* `#define STRICT_LAYER_RELEASE` + * force a key release to be evaluated using the current layer stack instead of remembering which layer it came from (used for advanced cases) ## Behaviors That Can Be Configured diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 46633b2870..0c3f4a1332 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -39,3 +39,11 @@ void matrix_scan_user(void) { As you can see, you have a few function. You can use `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS`, `SEQ_THREE_KEYS` up to `SEQ_FIVE_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. + +## Adding Leader Key Support in the `rules.mk` + +To add support for Leader Key you simply need to add a single line to your keymap's `rules.mk`: + +``` +LEADER_ENABLE = yes +``` diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md index bf695d008d..35596cc692 100644 --- a/docs/understanding_qmk.md +++ b/docs/understanding_qmk.md @@ -129,6 +129,7 @@ Comparing against our keymap we can see that the pressed key is KC_NLCK. From he ##### Process Record + The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is listed below, using cluecard whenever we need to look at the keyboard/keymap level functions. Depending on options set in rule.mk or elsewhere, only a subset of the functions below will be included in final firmware. * [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/tmk_core/common/action.c#L172) @@ -146,7 +147,6 @@ The `process_record()` function itself is deceptively simple, but hidden within * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_music.c#L114) * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_tap_dance.c#L136) * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_leader.c#L38) - * [`bool process_chording(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_chording.c#L41) * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_combo.c#L115) * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_unicode.c#L22) * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_ucis.c#L91) -- cgit v1.2.3 From 244e1c5a57eecd349c7d88e1af42d1b3467aeafe Mon Sep 17 00:00:00 2001 From: dsissitka Date: Sun, 16 Sep 2018 17:49:20 -0400 Subject: Fix LEADER_KEY docs. LEADER_KEY needs to be set in config.h, not keymap.c. Credit goes to @randywallace for figuring this one out: https://github.com/qmk/qmk_firmware/issues/2514#issuecomment-384847485 --- docs/feature_leader_key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 0c3f4a1332..92aebd463d 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -5,7 +5,7 @@ If you've ever used Vim, you know what a Leader key is. If not, you're about to That's what `KC_LEAD` does. Here's an example: 1. Pick a key on your keyboard you want to use as the Leader key. Assign it the keycode `KC_LEAD`. This key would be dedicated just for this -- it's a single action key, can't be used for anything else. -2. Include the line `#define LEADER_TIMEOUT 300` somewhere in your keymap.c file, probably near the top. The 300 there is 300ms -- that's how long you have for the sequence of keys following the leader. You can tweak this value for comfort, of course. +2. Include the line `#define LEADER_TIMEOUT 300` in your config.h. The 300 there is 300ms -- that's how long you have for the sequence of keys following the leader. You can tweak this value for comfort, of course. 3. Within your `matrix_scan_user` function, do something like this: ``` -- cgit v1.2.3 From a6d1db2c275f2e33e23135a6e410dbc8d19720a2 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Mon, 17 Sep 2018 09:23:43 -0700 Subject: Create AG_TOGG code to toggle Alt/Gui swap. --- docs/feature_bootmagic.md | 1 + docs/keycodes.md | 1 + 2 files changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index d6915d3559..586b5d8370 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md @@ -57,6 +57,7 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug |`MAGIC_UNNO_GUI` | |Enable the GUI keys | |`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)| |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Left Alt and Left GUI | +|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Left Alt and GUI swap | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | |`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock | diff --git a/docs/keycodes.md b/docs/keycodes.md index c344a75283..6676bb53c9 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -271,6 +271,7 @@ This is a reference only. Each group of keys links to the page documenting their |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | |`MAGIC_UNHOST_NKRO` | |Force NKRO off | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | +|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides| |`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off | ## [Bluetooth](feature_bluetooth.md) -- cgit v1.2.3 From 334e2629df4adb44b0ac0dff3363a6daebc072e7 Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Thu, 20 Sep 2018 00:18:15 +0100 Subject: Remove redefinition of `_______` in documentation example (#3924) * Remove redefinition of `_______` in documentation example * Slight rewording to include purpose of defintions * Update include to newer macro --- docs/keymap.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/keymap.md b/docs/keymap.md index b28d21a21d..382a0e911b 100644 --- a/docs/keymap.md +++ b/docs/keymap.md @@ -89,11 +89,15 @@ There are 3 main sections of a `keymap.c` file you'll want to concern yourself w At the top of the file you'll find this: - #include "clueboard.h" + #include QMK_KEYBOARD_H // Helpful defines #define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) - #define _______ KC_TRNS + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * You can use _______ in place for KC_TRNS (transparent) * + * Or you can use XXXXXXX for KC_NO (NOOP) * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // Each layer gets a name for readability. // The underscores don't mean anything - you can @@ -105,7 +109,9 @@ At the top of the file you'll find this: #define _FL 1 #define _CL 2 -These are some handy definitions we can use when building our keymap and our custom function. The `GRAVE_MODS` definition will be used later in our custom function. The `_______` define makes it easier to see what keys a layer is overriding, while the `_BL`, `_FL`, and `_CL` defines make it easier to refer to each of our layers. +These are some handy definitions we can use when building our keymap and our custom function. The `GRAVE_MODS` definition will be used later in our custom function, and the following `_BL`, `_FL`, and `_CL` defines make it easier to refer to each of our layers. + +Note: You may also find some older keymap files may also have a define(s) for `_______` and/or `XXXXXXX`. These can be used in place for `KC_TRNS` and `KC_NO` respectively, making it easier to see what keys a layer is overriding. These definitions are now unecessary, as they are included by default. ### Layers and Keymaps -- cgit v1.2.3 From 58b9b22670c2c36e8502826349d8f752d8b3ab37 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 23 Sep 2018 22:49:17 +0200 Subject: Circuitry sample for PS/2 Mouse (#3959) Added a sample circuitry for handling the connection of a PS/2 Mouse. Even if it's written that a circuitry is needed, there're a lot of other things and the information gets lost really fast. A really simple sample helps to remember who wants to implement the functionality about the circuitry. --- docs/feature_ps2_mouse.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'docs') diff --git a/docs/feature_ps2_mouse.md b/docs/feature_ps2_mouse.md index 909406e7d2..01e2cc63db 100644 --- a/docs/feature_ps2_mouse.md +++ b/docs/feature_ps2_mouse.md @@ -6,6 +6,24 @@ 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). +### The Cirtuitry between Trackpoint and Controller + +To get the things working, a 4.7K drag is needed between the two lines DATA and CLK and the line 5+. + +``` + + DATA ----------+--------- PIN + | + 4.7K + | +MODULE 5+ --------+--+--------- PWR CONTROLLER + | + 4.7K + | + CLK ------+------------ PIN +``` + + ### Busywait Version Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible. -- cgit v1.2.3 From e72e4b6920299176a322a2862f930b7ee5f73dff Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 8 May 2018 18:46:29 -0700 Subject: Store Clicky status in EEPROM --- docs/feature_audio.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/feature_audio.md b/docs/feature_audio.md index 039c62cdf1..fe210c09b9 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -128,13 +128,11 @@ This adds a click sound each time you hit a button, to simulate click sounds fro * `CK_UP` - Increases the frequency of the clicks * `CK_DOWN` - Decreases the frequency of the clicks + The feature is disabled by default, to save space. To enable it, add this to your `config.h`: #define AUDIO_CLICKY -Additionally, even when enabled, the feature is not enabled by default, so you would need to turn it on first. And since we don't use EEPROM to store the setting (yet), you can default this to on by adding this to your `config.h`: - - #define AUDIO_CLICKY_ON You can configure the default, min and max frequencies, the stepping and built in randomness by defining these values: -- cgit v1.2.3 From a0309db983150fd0197eb620a6ba552d90d29f93 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 1 Jun 2018 13:29:52 -0700 Subject: Add On/Off keycodes --- docs/feature_audio.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/feature_audio.md b/docs/feature_audio.md index fe210c09b9..82e0ed9503 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -119,14 +119,16 @@ You can completely disable Music Mode as well. This is useful, if you're pressed #define NO_MUSIC_MODE -## Faux Click +## Audio Click This adds a click sound each time you hit a button, to simulate click sounds from the keyboard. And the sounds are slightly different for each keypress, so it doesn't sound like a single long note, if you type rapidly. * `CK_TOGG` - Toggles the status (will play sound if enabled) -* `CK_RST` - Resets the frequency to the default state -* `CK_UP` - Increases the frequency of the clicks -* `CK_DOWN` - Decreases the frequency of the clicks +* `CK_ON` - Turns on Audio Click (plays sound) +* `CK_OFF` - Turns off Audio Click (doesn't play sound) +* `CK_RST` - Resets the frequency to the default state (plays sound at default frequency) +* `CK_UP` - Increases the frequency of the clicks (plays sound at new frequency) +* `CK_DOWN` - Decreases the frequency of the clicks (plays sound at new frequency) The feature is disabled by default, to save space. To enable it, add this to your `config.h`: @@ -142,7 +144,7 @@ You can configure the default, min and max frequencies, the stepping and built i | `AUDIO_CLICKY_FREQ_MIN` | 65.0f | Sets the lowest frequency (under 60f are a bit buggy). | | `AUDIO_CLICKY_FREQ_MAX` | 1500.0f | Sets the the highest frequency. Too high may result in coworkers attacking you. | | `AUDIO_CLICKY_FREQ_FACTOR` | 1.18921f| Sets the stepping of UP/DOWN key codes. | -| `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | Sets a factor of randomness for the clicks, Setting this to `0f` will make each click identical. | +| `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | Sets a factor of randomness for the clicks, Setting this to `0f` will make each click identical, and `1.0f` will make this sound much like the 90's computer screen scrolling/typing effect. | -- cgit v1.2.3 From baebbc096702c3ecc0ee89b4fbf5749e79f02375 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Fri, 28 Sep 2018 11:02:12 +0900 Subject: add 'mavrdude' target into tmk_core/avr.mk (#3986) * add 'mavrdude' target into tmk_core/avr.mk I made it a little convenient when writing the same binary to multiple Pro Micro. * rename target name 'mavrdude' to 'avrdude-loop' * modify docs/flashing.md about avrdude-loop * mdify docs/flashing.md again * modifi docs/flashing.md 3rd --- docs/flashing.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/flashing.md b/docs/flashing.md index e5fe59f8f0..66c08a3610 100644 --- a/docs/flashing.md +++ b/docs/flashing.md @@ -78,6 +78,12 @@ or make ::avrdude +or if you want to flash multiple boards, use the following command + + make ::avrdude-loop + +When you're done flashing boards, you'll need to hit Ctrl + C or whatever the correct keystroke is for your operating system to break the loop. + ## Halfkay Halfkay is a super-slim protocol developed by PJRC that uses HID, and come on all Teensys (namely the 2.0). -- cgit v1.2.3 From 8454fa5e9faab3a969168447d42369828f8ade91 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 09:04:30 -0700 Subject: Update Document Templates to reflect newer wording and URLs (#4006) * Add pragma once info to contributing guidelines * Fix links in readme template to match doc site * Revert changes to contributing doc as somebody already changed it --- docs/documentation_templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/documentation_templates.md b/docs/documentation_templates.md index 18829ed0f0..ba3830b64c 100644 --- a/docs/documentation_templates.md +++ b/docs/documentation_templates.md @@ -36,7 +36,7 @@ Make example for this keyboard (after setting up your build environment): make planck/rev4:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). ``` There needs to be two spaces at the end of the `Keyboard Maintainer` and `Hardware Supported` lines for it to render correctly with Markdown. -- cgit v1.2.3 From fa47f5fb15cca3bea9ab4de1001fcfecd43dac19 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 09:27:51 -0700 Subject: Update to the Userspace documentation (#4005) * Overhaul to Userspace Documentation * Formatting issues * Additionaly formatting fixes * Add Readme info * Additionaly Readme info * Formatting fixes --- docs/feature_userspace.md | 178 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 133 insertions(+), 45 deletions(-) (limited to 'docs') diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md index 5f7c05b83b..b7fc9d8099 100644 --- a/docs/feature_userspace.md +++ b/docs/feature_userspace.md @@ -5,15 +5,12 @@ If you use more than one keyboard with a similar keymap, you might see the benef * `/users//` (added to the path automatically) * `readme.md` (optional, recommended) * `rules.mk` (included automatically) + * `config.h` (included automatically) * `.h` (optional) * `.c` (optional) - * `config.h` (optional) + * `cool_rgb_stuff.c` (optional) + * `cool_rgb_stuff.h` (optional) -`.c` will need to be added to the SRC in `rules.mk` like this: - - SRC += .c - -Additional files may be added in the same way - it's recommended you have one named ``.c/.h though. All this only happens when you build a keymap named ``, like this: @@ -23,82 +20,179 @@ For example, make planck:jack -Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`. +Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`. -Additionally, `config.h` here will be processed like the same file in your keymap folder. This is handled separately from the `.h` file. +!> This `name` can be [overridden](#override-default-userspace), if needed. -The reason for this, is that `.h` won't be added in time to add settings (such as `#define TAPPING_TERM 100`), and including the `` file in any `config.h` files will result in compile issues. +## `Rules.mk` + +The `rules.mk` is one of the two files that gets processed automatically. This is how you add additional source files (such as `.c`) will be added when compiling. -So you should use the `config.h` for QMK settings, and the `.h` file for user or keymap specific settings. +It's highly recommended that you use `.c` as the default source file to be added. And to add it, you need to add it the SRC in `rules.mk` like this: -`/users//rules.mk` will be included in the build _after_ the `rules.mk` from your keymap. This allows you to have features in your userspace `rules.mk` that depend on individual QMK features that may or may not be available on a specific keyboard. For example, if you have RGB control features shared between all your keyboards that support RGB lighting, you can `define RGB_ENABLE` in your keymap `rules.mk` and then check for the variable in your userspace `rules.mk` like this: + SRC += .c + +Additional files may be added in the same way - it's recommended you have one named ``.c/.h to start off with, though. + +The `/users//rules.mk` file will be included in the build _after_ the `rules.mk` from your keymap. This allows you to have features in your userspace `rules.mk` that depend on individual QMK features that may or may not be available on a specific keyboard. + +For example, if you have RGB control features shared between all your keyboards that support RGB lighting, you can add support for that if the RGBLIGHT feature is enabled: ```make -ifdef RGB_ENABLE - # Include my fancy rgb functions source here +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + # Include my fancy rgb functions source here + SRC += cool_rgb_stuff.c endif ``` -Because of this, any time you turn on QMK features in your `users//rules.mk`, you should conditionally enable them only if the flag isn't already defined, like this: + +Alternatively, you can `define RGB_ENABLE` in your keymap's `rules.mk` and then check for the variable in your userspace's `rules.mk` like this: ```make -ifndef TAP_DANCE_ENABLE - TAP_DANCE_ENABLE = yes +ifdef RGB_ENABLE + # Include my fancy rgb functions source here + SRC += cool_rgb_stuff.c endif ``` -This will ensure that you can explicitly turn off features for an individual keymap. -## Readme +### Override default userspace + +By default the userspace used will be the same as the keymap name. In some situations this isn't desirable. For instance, if you use the [layout](feature_layouts.md) feature you can't use the same name for different keymaps (e.g. ANSI and ISO). You can name your layouts `mylayout-ansi` and `mylayout-iso` and add the following line to your layout's `rules.mk`: + +``` +USER_NAME := mylayout +``` + +This is also useful if you have multiple different keyboards with different features physically present on the board (such as one with RGB Lights, and one with Audio, or different number of LEDs, or connected to a different PIN on the controller). + +## Configuration Options (`config.h`) + +Additionally, `config.h` here will be processed like the same file in your keymap folder. This is handled separately from the `.h` file. + +The reason for this, is that `.h` won't be added in time to add settings (such as `#define TAPPING_TERM 100`), and including the `` file in any `config.h` files will result in compile issues. + +!>You should use the `config.h` for [configuration options](config_options.md), and the `.h` file for user or keymap specific settings (such as the enum for layer or keycodes) + + +## Readme (`readme.md`) Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses). -## `Config.h` +You can use this as a template: +``` +Copyright @ + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +``` + +You'd want to replace the year, name, email and github username with your info. + +Additionally, this is a good place to document your code, if you wish to share it with others. + +# Examples + +For a brief example, checkout [`/users/_example/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). +For a more complicaed example, checkout [`/users/drashna/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna)'s userspace. + + +## Customized Functions + +QMK has a bunch of [functions](custom_quantum_functions.md) that have [`_quantum`, `_kb`, and `_user` versions](custom_quantum_functions.md#a-word-on-core-vs-keyboards-vs-keymap) that you can use. You will pretty much always want to use the user version of these functions. But the problem is that if you use them in your userspace, then you don't have a version that you can use in your keymap. + +However, you can actually add support for keymap version, so that you can use it in both your userspace and your keymap! -If you do add a `config,h` file, you want to make sure that it only gets processed once. So you may want to start off with something like this: +For instance, lets looks at the `layer_state_set_user` function. Lets enable the [Tri Layer State](ref_functions.md#olkb-tri-layers) functionalitly to all of our boards, and then still have your `keymap.c` still able to use this functionality. + +In your `` file, you'd want to add this: ```c -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} + +uint32_t layer_state_set_user (uint32_t state) { + state = update_tri_layer_state(state, 2, 3, 5); + return layer_state_set_keymap (state); +} +``` +The `__attribute__ ((weak))` part tells the compiler that this is a placce holder function that can then be replaced by a version in your `keymap.c`. That way, you don't need to add it to your `keymap.c`, but if you do, you won't get any conflicts because the function is the same name. -// Put normal config.h settings here: +The `_keymap` part here doesn't matter, it just needs to be something other than `_quantum`, `_kb`, or `_user`, since those are already in use. So you could use `layer_state_set_mine`, `layer_state_set_fn`, or anything else. -#endif // !USERSPACE_CONFIG_H +You can see a list of this and other common functions in [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in [`users/drashna`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). + +## Custom Features + +Since the Userspace feature can support a staggering number of boards, you may have boards that you want to enable certain functionality for, but not for others. And you can actually create "features" that you can enable or disable in your own userspace. + +For instance, if you wanted to have a bunch of macros available, but only on certain boards (to save space), you could "hide" them being a `#ifdef MACROS_ENABLED`, and then enable it per board. To do this, add this to your rules.mk +```make +ifeq ($(strip $(MACROS_ENABLED)), yes) + OPT_DEFS += -DMACROS_ENABLED +endif ``` +The `OPT_DEFS` setting causee `MACROS_ENABLED` to be defined for your keyboards (note the `-D` in front of the name), and you could use `#ifdef MACROS_ENABLED` to check the status in your c/h files, and handle that code based on that. -You can use any option hre that you could use in your keymap's `config.h` file. You can find a list of vales [here](config_options.md). +Then you add `MACROS_ENABLED = yes` to the `rules.mk` for you keymap to enable this feature and the code in your userspace. -## Example +And in your `process_record_user` function, you'd do something like this: +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { +#ifdef MACROS_ENABLED + case MACRO1: + if (!record->event.pressed) { + SEND_STRING("This is macro 1!"); + } + break; + case MACRO2: + if (!record->event.pressed) { + SEND_STRING("This is macro 2!"); + } + break; +#endif + } + return true; +} +``` -For a brief example, checkout `/users/_example/` , or for a more detailed examples check out [`template.h`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.h) and [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in `/users/drashna/` . -### Consolidated Macros +## Consolidated Macros -If you wanted to consolidate macros and other functions into your userspace for all of your keymaps, you can do that. The issue is that you then cannot call any function defined in your userspace, or it gets complicated. To better handle this, you can call the functions here and create new functions to use in individual keymaps. +If you wanted to consolidate macros and other functions into your userspace for all of your keymaps, you can do that. This builds upon the [Customized Functions](#customized-functions) example above. This lets you maintain a bunch of macros that are shared between the different keyboards, and allow for keyboard specific macros, too. First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes Then add `#include ` to all of your keymap.c files. This allows you to use these new keycodes without having to redefine them in each keymap. Once you've done that, you'll want to set the keycode definitions that you need to the `.h` file. For instance: -``` -#ifndef USERSPACE -#define USERSPACE +```c +#pragma once #include "quantum.h" +#include "action.h" +#include "version.h" // Define all of enum custom_keycodes { KC_MAKE = SAFE_RANGE, NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes }; - -#endif ``` Now you want to create the `.c` file, and add this content to it: -``` +```c #include ".h" -#include "quantum.h" -#include "action.h" -#include "version.h" __attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { @@ -126,14 +220,8 @@ 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 :`, 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. +This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make :`, 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). -## Override default userspace -By default the userspace used will be the same as the keymap name. In some situations this isn't desirable. For instance, if you use the [layout](feature_layouts.md) feature you can't use the same name for different keymaps (e.g. ANSI and ISO). You can name your layouts `mylayout-ansi` and `mylayout-iso` and add the following line to your layout's `rules.mk`: - -``` -USER_NAME := mylayout -``` -- cgit v1.2.3 From 7fe03d085c2ecaa324779093eceb1a12313ca25d Mon Sep 17 00:00:00 2001 From: yiancar Date: Fri, 28 Sep 2018 17:33:11 +0100 Subject: Update quantum matrix to support both AVR and Chibios ARM (#3968) * Update quantum matrix to support both AVR and Chibios ARM - Addition of STM32 pin definitions - Created abstruction layer defines to control GPIO (This is a bit pointless for Chibios as we are creating a PAL ontop of a PAL but it is necessary for uniformity with AVR) - Modified matrix.c to use the above functions * minor ifdef fix * Rename of functions and docs - Added documentation. - Renamed functions according to Jack's spec. * Massdrop fix * Update matrix.c * Update quantum.h * Update quantum.h * Update quantum.h * Update internals_gpio_control.md --- docs/internals_gpio_control.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docs/internals_gpio_control.md (limited to 'docs') diff --git a/docs/internals_gpio_control.md b/docs/internals_gpio_control.md new file mode 100644 index 0000000000..21643d30c9 --- /dev/null +++ b/docs/internals_gpio_control.md @@ -0,0 +1,23 @@ +# GPIO Control + +QMK has a GPIO control abstraction layer which is micro-controller agnostic. This is done to allow easy access to pin control across different platforms. + +## Functions + +The following functions can provide basic control of GPIOs and are found in `quantum/quantum.h`. + +|Function |Description | +|----------------------|------------------------------------------------------------------| +|`setPinInput(pin)` |Set pin as input with high impedance (High-Z) | +|`setPinInputHigh(pin)`|Set pin as input with build in pull-up | +|`setPinInputLow(pin)` |Set pin as input with build in pull-down (Supported only on STM32)| +|`setPinOutput(pin)` |Set pin as output | +|`writePinHige(pin)` |Set pin level as high, assuming it is an output | +|`writePinLow(pin)` |Set pin level as low, assuming it is an output | +|`writePin(pin, level)`|Set pin level, assuming it is an output | +|`readPin(pin)` |Returns the level of the pin | + +## Advance settings + +Each micro-controller can have multiple advance settings regarding its GPIO. This abstraction layer does not limit the use of architecture specific functions. Advance users should consult the datasheet of there desired device and include any needed libraries. For AVR the standard avr/io.h library is used and for STM32 the Chibios [PAL library](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used. + -- cgit v1.2.3 From f1b2d46eafbec2b834dc4bcb5ba2dac9f913eed8 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Fri, 28 Sep 2018 11:34:40 -0700 Subject: Spell-check update for Userspace documentation Because leaving review comments on a PR that's already been merged doesn't make any sense. --- docs/feature_userspace.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md index b7fc9d8099..5a9fc287b3 100644 --- a/docs/feature_userspace.md +++ b/docs/feature_userspace.md @@ -100,7 +100,7 @@ Additionally, this is a good place to document your code, if you wish to share i # Examples For a brief example, checkout [`/users/_example/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). -For a more complicaed example, checkout [`/users/drashna/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna)'s userspace. +For a more complicated example, checkout [`/users/drashna/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna)'s userspace. ## Customized Functions @@ -124,7 +124,7 @@ uint32_t layer_state_set_user (uint32_t state) { return layer_state_set_keymap (state); } ``` -The `__attribute__ ((weak))` part tells the compiler that this is a placce holder function that can then be replaced by a version in your `keymap.c`. That way, you don't need to add it to your `keymap.c`, but if you do, you won't get any conflicts because the function is the same name. +The `__attribute__ ((weak))` part tells the compiler that this is a placeholder function that can then be replaced by a version in your `keymap.c`. That way, you don't need to add it to your `keymap.c`, but if you do, you won't get any conflicts because the function is the same name. The `_keymap` part here doesn't matter, it just needs to be something other than `_quantum`, `_kb`, or `_user`, since those are already in use. So you could use `layer_state_set_mine`, `layer_state_set_fn`, or anything else. @@ -140,7 +140,7 @@ ifeq ($(strip $(MACROS_ENABLED)), yes) OPT_DEFS += -DMACROS_ENABLED endif ``` -The `OPT_DEFS` setting causee `MACROS_ENABLED` to be defined for your keyboards (note the `-D` in front of the name), and you could use `#ifdef MACROS_ENABLED` to check the status in your c/h files, and handle that code based on that. +The `OPT_DEFS` setting causes `MACROS_ENABLED` to be defined for your keyboards (note the `-D` in front of the name), and you could use `#ifdef MACROS_ENABLED` to check the status in your c/h files, and handle that code based on that. Then you add `MACROS_ENABLED = yes` to the `rules.mk` for you keymap to enable this feature and the code in your userspace. @@ -220,7 +220,7 @@ 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 :`, 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. +This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make :`, 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). -- cgit v1.2.3 From b3f6aa9480a5ddb0b0ba0d611d988121c0ff848b Mon Sep 17 00:00:00 2001 From: Anthony Som Date: Mon, 1 Oct 2018 17:39:45 +0100 Subject: Correct small typo A small typo (it -> in) that I noticed while reading through the documentation --- docs/flashing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/flashing.md b/docs/flashing.md index 66c08a3610..1edbe22253 100644 --- a/docs/flashing.md +++ b/docs/flashing.md @@ -2,7 +2,7 @@ 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. -If you have a bootloader selected with the `BOOTLOADER` variable in your `rules.mk`, QMK will automatically calculate if your .hex file is the right size to be flashed to the device, and output the total size it bytes (along with the max). To run this process manually, compile with the target `check-size`, eg `make planck/rev4:default:check-size`. +If you have a bootloader selected with the `BOOTLOADER` variable in your `rules.mk`, QMK will automatically calculate if your .hex file is the right size to be flashed to the device, and output the total size in bytes (along with the max). To run this process manually, compile with the target `check-size`, eg `make planck/rev4:default:check-size`. ## DFU -- cgit v1.2.3 From da6c58175a74e4bb5a6c67f7e8b63567c14800d7 Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Fri, 28 Sep 2018 09:33:51 +0100 Subject: Make digital rain RGB matrix effect #define configurable. --- docs/feature_rgb_matrix.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 4f827f8dc9..809d034bdc 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -140,6 +140,7 @@ These are the effects that are currently available: RGB_MATRIX_RAINBOW_PINWHEELS, RGB_MATRIX_RAINBOW_MOVING_CHEVRON, RGB_MATRIX_JELLYBEAN_RAINDROPS, + RGB_MATRIX_DIGITAL_RAIN, #ifdef RGB_MATRIX_KEYPRESSES RGB_MATRIX_SOLID_REACTIVE, RGB_MATRIX_SPLASH, -- cgit v1.2.3 From e885c793bcffcba03e18e93e41120b21cdfb6b75 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Oct 2018 17:53:14 -0700 Subject: Add Function level EECONFIG code for EEPROM (#3084) * Add Function level EEPROM configuration Add kb and user functions for EEPROM, and example of how to use it. * Bug fixes and demo * Additional cleanup * Add EEPROM reset macro to example * Forgot init function in list * Move eeconfig_init_quantum function to quantum.c and actually set default layer * See if removing weak quantum function fixes issue * Fix travis compile error * Remove ifdef blocks from EECONFIG so settings are always set * Fix for ARM EEPROM updates * Fix merge issues * Fix potential STM32 EEPROM issues --- docs/custom_quantum_functions.md | 140 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) (limited to 'docs') diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index 10c5c75a2d..f8b84cd6b3 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -244,3 +244,143 @@ uint32_t layer_state_set_user(uint32_t state) { * Keymap: `uint32_t layer_state_set_user(uint32_t state)` The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status) + + +# Persistent Configuration (EEPROM) + +This allows you to configure persistent settings for your keyboard. These settings are stored in the EEPROM of your controller, and are retained even after power loss. The settings can be read with `eeconfig_read_kb` and `eeconfig_read_user`, and can be written to using `eeconfig_update_kb` and `eeconfig_update_user`. This is useful for features that you want to be able to toggle (like toggling rgb layer indication). Additionally, you can use `eeconfig_init_kb` and `eeconfig_init_user` to set the default values for the EEPROM. + +The complicated part here, is that there are a bunch of ways that you can store and access data via EEPROM, and there is no "correct" way to do this. However, you only have a DWORD (4 bytes) for each function. + +Keep in mind that EEPROM has a limited number of writes. While this is very high, it's not the only thing writing to the EEPROM, and if you write too often, you can potentially drastically shorten the life of your MCU. + +* If you don't understand the example, then you may want to avoid using this feature, as it is rather complicated. + +### Example Implementation + +This is an example of how to add settings, and read and write it. We're using the user keymap for the example here. This is a complex function, and has a lot going on. In fact, it uses a lot of the above functions to work! + + +In your keymap.c file, add this to the top: +``` +typedef union { + uint32_t raw; + struct { + bool rgb_layer_change :1; + }; +} user_config_t; + +user_config_t user_config; +``` + +This sets up a 32 bit structure that we can store settings with in memory, and write to the EEPROM. Using this removes the need to define variables, since they're defined in this structure. Remember that `bool` (boolean) values use 1 bit, `uint8_t` uses 8 bits, `uint16_t` uses up 16 bits. You can mix and match, but changing the order can cause issues, as it will change the values that are read and written. + +We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `matrix_init_user` and `process_record_user` to configure everything. + +Now, using the `matrix_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like: +``` +void matrix_init_user(void) { + // Call the keymap level matrix init. + + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); + + // Set default layer, if enabled + if (user_config.rgb_layer_change) { + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom_cyan(); + rgblight_mode_noeeprom(1); + } +} +``` +The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above. + +``` +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _RAISE: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); } + break; + case _LOWER: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); } + break; + case _PLOVER: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); } + break; + case _ADJUST: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); } + break; + default: // for any other layers, or the default layer + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); } + break; + } + return state; +} +``` +This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR` and `EPRM`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this: +``` + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case FOO: + if (record->event.pressed) { + // Do something when pressed + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + case KC_ENTER: + // Play a tone when enter is pressed + if (record->event.pressed) { + PLAY_NOTE_ARRAY(tone_qwerty); + } + return true; // Let QMK send the enter press/release events + case EPRM: + if (record->event.pressed) { + eeconfig_init(); // resets the EEPROM to default + } + return false; + case RGB_LYR: // This allows me to use underglow as layer indication, or as normal + if (record->event.pressed) { + user_config.rgb_layer_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + if (user_config.rgb_layer_change) { // if layer state indication is enabled, + layer_state_set(layer_state); // then immediately update the layer color + } + } + return false; break; + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference) + if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + if (user_config.rgb_layer_change) { // only if this is enabled + user_config.rgb_layer_change = false; // disable it, and + eeconfig_update_user(user_config.raw); // write the setings to EEPROM + } + } + return true; break; + default: + return true; // Process all other keycodes normally + } +} +``` +And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. For example, if you want to set rgb layer indication by default, and save the default valued. + +``` +void eeconfig_init_user(void) { // EEPROM is getting reset! + user_config.rgb_layer_change = true; // We want this enabled by default + eeconfig_update_user(user_config.raw); // Write default value to EEPROM now + + // use the non noeeprom versions, to write these values to EEPROM too + rgblight_enable(); // Enable RGB by default + rgblight_sethsv_cyan(); // Set it to CYAN by default + rgblight_mode(1); // set to solid by default +} +``` + +And you're done. The RGB layer indication will only work if you want it to. And it will be saved, even after unplugging the board. And if you use any of the RGB codes, it will disable the layer indication, so that it stays on the mode and color that you set it to. + +### 'EECONFIG' Function Documentation + +* Keyboard/Revision: `void eeconfig_init_kb(void)`, `uint32_t eeconfig_read_kb(void)` and `void eeconfig_update_kb(uint32_t val)` +* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)` + +The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM. -- cgit v1.2.3 From 26f4e7031a643ce2760ae7b6df3bd2c79710451a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Oct 2018 17:53:47 -0700 Subject: Add tap_code function (#3784) * Add tap_code * formatting * Doc clarification * Rename variable to make more consistent --- docs/feature_macros.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/feature_macros.md b/docs/feature_macros.md index 6731530812..ba5d91882f 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -228,6 +228,10 @@ This sends the `` keydown event to the computer. Some examples would be `KC_ Parallel to `register_code` function, this sends the `` keyup event to the computer. If you don't use this, the key will be held down until it's sent. +### `tap_code();` + +This will send `register_code()` and then `unregister_code()`. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it). + ### `clear_keyboard();` This will clear all mods and keys currently pressed. -- cgit v1.2.3 From f5ae3760c6be7e927fba74aca4a0cf21a44113af Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Oct 2018 17:56:04 -0700 Subject: Add send_unicode_hex_string function (#3828) * Add send_string_unicode function Co-authored-by: kdb424 Co-authored-by: Konstantin * Clean up code based on feedback * Fix includes --- docs/feature_unicode.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index ecad6c60c7..278b93ad79 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -19,7 +19,7 @@ table. TBD Unicode input in QMK works by inputing a sequence of characters to the OS, -sort of like macro. Unfortunately, each OS has different ideas on how Unicode is inputted. +sort of like macro. Unfortunately, each OS has different ideas on how Unicode is input. This is the current list of Unicode input method in QMK: @@ -29,6 +29,11 @@ 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. +To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values seperated by spaces. +For example, the table flip seen above would be `send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B")` + +There are many ways to get a hex code, but an easy one is [this site](https://r12a.github.io/app-conversion/). Just make sure to convert to hexadecimal, and that is your string. + # 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. -- cgit v1.2.3 From 713ec91147aa56849f9e2ff93ee98ef1eb6eebc0 Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Mon, 1 Oct 2018 19:50:14 -0700 Subject: Add C hint to inline code --- docs/custom_quantum_functions.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'docs') diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index f8b84cd6b3..b077e4b78d 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -27,7 +27,7 @@ The first step to creating your own custom keycode(s) is to enumerate them. This Here is an example of enumerating 2 keycodes. After adding this block to your `keymap.c` you will be able to use `FOO` and `BAR` inside your keymap. -``` +```c enum my_keycodes { FOO = SAFE_RANGE, BAR @@ -44,7 +44,7 @@ These function are called every time a key is pressed or released. 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. -``` +```c bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case FOO: @@ -75,16 +75,16 @@ The `keycode` argument is whatever is defined in your keymap, eg `MO(1)`, `KC_L` The `record` argument contains information about the actual press: -``` +```c keyrecord_t record { -+-keyevent_t event { -| +-keypos_t key { -| | +-uint8_t col -| | +-uint8_t row -| | } -| +-bool pressed -| +-uint16_t time -| } + keyevent_t event { + keypos_t key { + uint8_t col + uint8_t row + } + bool pressed + uint16_t time + } } ``` @@ -100,7 +100,7 @@ This allows you to control the 5 LED's defined as part of the USB Keyboard spec. ### Example `led_set_user()` Implementation -``` +```c void led_set_user(uint8_t usb_led) { if (usb_led & (1< Date: Thu, 4 Oct 2018 22:37:26 +0100 Subject: ARM SWD guide - Added a detailed (but saddly long) debugging guide. - Modified sidebar and summary to include the links. --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/arm_debugging.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 docs/arm_debugging.md (limited to 'docs') diff --git a/docs/_sidebar.md b/docs/_sidebar.md index a35014dd8c..973428c9e0 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -74,6 +74,7 @@ * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) * [ISP Flashing Guide](isp_flashing_guide.md) + * [ARM Debugging Guide](arm_debugging.md) * For a Deeper Understanding * [How Keyboards Work](how_keyboards_work.md) diff --git a/docs/_summary.md b/docs/_summary.md index a35014dd8c..973428c9e0 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -74,6 +74,7 @@ * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) * [ISP Flashing Guide](isp_flashing_guide.md) + * [ARM Debugging Guide](arm_debugging.md) * For a Deeper Understanding * [How Keyboards Work](how_keyboards_work.md) diff --git a/docs/arm_debugging.md b/docs/arm_debugging.md new file mode 100644 index 0000000000..491dfe8ad7 --- /dev/null +++ b/docs/arm_debugging.md @@ -0,0 +1,87 @@ +# ARM Debugging usign Eclipse + +This page describes how to setup debugging for ARM MCUs using an SWD adapter and open-source/free tools. In this guide we will install GNU MCU Eclipse IDE for C/C++ Developers and OpenOCD together with all the necessary dependencies. + +This guide is catered towards advance users and assumes you can compile an ARM compatible keyboard on your machine using the MAKE flow. + +## Installing the software + +The main objective here is to get the MCU Eclipse IDE correcly installed on our machine. The necesarry instructions are derived from [this](https://gnu-mcu-eclipse.github.io/install/) install guide. + +### The xPack Manager + +This tool is a software package manager and it is used to help us get the necesarry depencencies. + +XPM runs using Node.js so grab that form [here](https://nodejs.org/en/). After installation, open a terminal and type `npm -v`. A reply with the version number means that the instalation was successful. + +XPM instalation instructions can be found [here](https://www.npmjs.com/package/xpm) and are OS specific. Entering `xpm --version` to your terminal should return the software version. + +### The ARM Toolchain + +Using XPM it is very easy to install the ARM toolchain. Enter the command `xpm install --global @gnu-mcu-eclipse/arm-none-eabi-gcc`. + +### Windows build tools + +If you are using windows you need to install this! + +`xpm install --global @gnu-mcu-eclipse/windows-build-tools` + +### Programer/Debugger Drivers + +Now its the time to install your programer's drivers. This tutorial was made using an ST-Link v2 which you can get from almost anywhere. +If you have an ST-Link the drivers can be found [here](https://www.st.com/en/development-tools/stsw-link009.html) otherwise consult the manufuturer of your tool. + +### OpenOCD + +This dependency allows SWD access from GDB and it is essential for debugging. Run `xpm install --global @gnu-mcu-eclipse/openocd`. + +### Java + +Java is needed by Eclipse so please download it from [here](https://www.oracle.com/technetwork/java/javase/downloads/index.html). + +### GNU MCU Eclipse IDE + +Now its finally time to install the IDE. Use the Release page [here](https://github.com/gnu-mcu-eclipse/org.eclipse.epp.packages/releases/) to get the latest version. + +## Configuring Eclipse + +Open up the Eclipse IDE we just downloaded. To import our QMK directory select File -> Import -> C/C++ -> Existing code as Makefile Project. Select next and use Browse to select your QMK folder. In the tool-chain list select ARM Cross GCC and select Finish. + +Now you can see the QMK folder on the left hand side. Right click it and select Properties. On the left hand side, expand MCU and select ARM Toolchain Paths. Press xPack and OK. Repeat for OpenOCD Path and if you are on windows for Build Tool Path. Select Apply and Close. + +Now its time to install the necessary MCU packages. Go to Packs perspective by selecting Window -> Open Perspective -> Others -> Packs. Now select the yellow refresh symbol next to the Packs tab. This will take a long time as it is requesting the MCU definitions from various places. If some of the links fail you can probably select Ignore. + +When this finishes you must find the MCU which we will be building/debugging for. In this example I will be using the STM32F3 series MCUs. On the left, select STMicroelectonics -> STM32F3 Series. On the middle window we can see the pack. Right click and select Install. Once that is done we can go back to the default perspective, Window -> Open Perspective -> Others -> C/C++. + +We need to let eclipse know the device we intent to build QMK on. Right click on the QMK folder -> Properties -> C/C++ Build -> Settings. Select the Devices tab and under devices select the appropriate variant of your MCU. For my example it is STM32F303CC + +While we are here let's setup the build command as well. Select C/C++ Build and then the Behavior tab. On the build command, replace `all` with your necessary make command. For example for a rev6 Planck with the default keymap this would be `planck/rev6:default`. Select Apply and Close. + +## Building + +If you have setup everything correctly pressing the hammer button should build the firmware for you and a .bin file should appear. + +## Debugging + +### Connecting the Debugger + +ARM MCUs use the Single Wire Debug (SWD) protocol which comprises of the clock (SWCLK) signal and the data (SWDIO) signal. Connecting this two wires and ground should be enough to allow full manipulation of the MCU. Here we assume that the keyboard will be powered though USB. The RESET signal is not necessary as we can manually assert it using the reset button. For a more advance setup, the SWO signal can be used which pipes printf and scanf asynchronously to the host but for our setup we will ignore it. + +NOTE: Make sure the SWCLK and SWDIO pins are not used in the matrix of your keyboard. If they are you can temporarily switch them for some other pins. + +### Configuring the Debugger + +Right click on your QMK folder, select Debug As -> Debug Configuration. Here double click on GDB OpenOCD Debugging. Select the debugger tab and enter the configuration necessary for your MCU. This might take some fiddling and googleing to find out. The default script for the STM32F3 is called stm32f3discovery.cfg. To let OpenOCD know, in the Config options enter `-f board/stm32f3discovery.cfg`. + +NOTE: In my case this configuration script requires editing to disable the reset assertion. The locations of the scripts can be found in the actual executable field usually under the path `openocd/version/.content/scripts/board`. Here I edited `reset_config srst_only` to `reset_config none`. + +Select Apply and Close. + +### Running the Debugger. + +Reset your keyboard. + +Press the bug icon and if all goes well you should soon find yourself in the debug perspective. Here the program counter will pause at the beginning of the main function and way for you to press Play. Most of the features of all debuggers work on ARM MCUs but for exact details google is your friend! + + +Happy debugging! \ No newline at end of file -- cgit v1.2.3 From 7458ac94897afa7f67d98bc40aa1e090c11c235d Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 6 Oct 2018 17:43:37 -0700 Subject: Update Contrib doc (#4068) * Add link for style * ignore java * Add example and update link? * Minor fixes * Change 1TBS text * comments --- docs/contributing.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/contributing.md b/docs/contributing.md index 7ed7cd06a5..bcedcaf974 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -57,14 +57,14 @@ Never made an open source contribution before? Wondering how contributions work 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: * We indent using two spaces (soft tabs) -* We use One True Brace Style +* We use a modified One True Brace Style * Opening Brace: At the end of the same line as the statement that opens the block * Closing Brace: Lined up with the first character of the statement that opens the block * Else If: Place the closing brace at the beginning of the line and the next opening brace at the end of the same line. * Optional Braces: Always include optional braces. * Good: if (condition) { return false; } * Bad: if (condition) return false; -* We use C style comments: `/* */` +* We encourage use of 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 @@ -72,6 +72,25 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely * In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns. * We use `#pragma once` at the start of header files rather than old-style include guards (`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`) +Here is an example for easy reference: + +```c +/* Enums for foo */ +enum foo_state { + FOO_BAR, + FOO_BAZ, +}; + +/* Returns a value */ +int foo(void) { + if (some_condition) { + return FOO_BAR; + } else { + return -1; + } +} +``` + # General Guidelines We have a few different types of changes in QMK, each requiring a different level of rigor. We'd like you to keep the following guidelines in mind no matter what type of change you're making. -- cgit v1.2.3 From f86c0c2643a665dd09bc7a9a2beaaf37f97b9b61 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 6 Oct 2018 17:44:33 -0700 Subject: Update and clarify Unicode documentation (#4065) * Update and clarify Unicode documentation * Fixed UCIS info based on feedback from algernon * Further clarifications and cleanup * Formatting * Add an example for unicode map * fix AutoHotKey title --- docs/feature_unicode.md | 107 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 89 insertions(+), 18 deletions(-) (limited to 'docs') diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index 278b93ad79..f13eed05b8 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -4,45 +4,108 @@ There are three Unicode keymap definition method available in QMK: ## UNICODE_ENABLE -Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in -keymap file, where *n* is a 4 digit hexadecimal. +Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in keymap file, where *n* is a 4 digit hexadecimal. ## UNICODEMAP_ENABLE -Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping -table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. -The keycode function is `X(n)` where *n* is the array index of the mapping -table. +Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(n)` where *n* is the array index of the mapping table. + +And you may want to have an enum to make reference easier. So you'd want to add something like this to your keymap: + +```c +enum unicode_name { + BANG, // ‽ + IRONY, // ⸮ + SNEK // snke 🐍 +}; + +const uint32_t PROGMEM unicode_map[] = { + [BANG] = 0x0203D, // ‽ + [IRONY] = 0x02E2E, // ⸮ + [SNEK] = 0x1F40D // snke 🐍 +}: +``` + +Make sure that the order for both matches. ## UCIS_ENABLE -TBD +Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to main a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence. + +For instance, you would need to have a table like this in your keymap: + +```c +const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE +( + UCIS_SYM("poop", 0x1f4a9), + UCIS_SYM("rofl", 0x1f923), + UCIS_SYM("kiss", 0x1f619) +); +``` + +You run the function, and then type "rofl" and hit enter, it should backspace remove "rofl" and input the `0x1f923` unicode. + +### Customization + +There are several functions that you can add to your keymap to customize the functionality of this feature. + +* `void qk_ucis_start_user(void)` - This runs when you run the "start" function, and can be used to provide feedback. By default, it types out a keyboard emoji. +* `void qk_ucis_success(uint8_t symbol_index)` - This runs when the unicode input has matched something, and has completed. Default doesn't do anything. +* `void qk_ucis_symbol_fallback (void)` - This runs if the input text doesn't match anything. The default function falls back to trying that input as a unicode code. + +The default code for these are: -Unicode input in QMK works by inputing a sequence of characters to the OS, +```c +void qk_ucis_start_user(void) { // outputs keyboard emoji + unicode_input_start(); + register_hex(0x2328); + unicode_input_finish(); +} + +void qk_ucis_success(uint8_t symbol_index) { +} + +void qk_ucis_symbol_fallback (void) { // falls back to manual unicode entry + for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) { + uint8_t code = qk_ucis_state.codes[i]; + register_code(code); + unregister_code(code); + wait_ms(UNICODE_TYPE_DELAY); + } +} +``` + +## Unicode Input methods + +Unicode input in QMK works by inputting a sequence of characters to the OS, sort of like macro. Unfortunately, each OS has different ideas on how Unicode is input. This is the current list of Unicode input method in QMK: -* UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. -* UC_OSX_RALT: Same as UC_OSX, but sends the Right Alt key for unicode input -* UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. -* 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. +* _UC_OSX_: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. +* _UC_OSX_RALT_: Same as UC_OSX, but sends the Right Alt key for unicode input +* _UC_LNX_: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. +* _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. + +At some point, you need to call `set_unicode_input_mode(x)` to set the correct unicode method. This sets the method that is used to send the unicode, and stores it in EEPROM, so you only need to call this once. -To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values seperated by spaces. +## `send_unicode_hex_string` + +To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values separate by spaces. For example, the table flip seen above would be `send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B")` There are many ways to get a hex code, but an easy one is [this site](https://r12a.github.io/app-conversion/). Just make sure to convert to hexadecimal, and that is your string. -# 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. -# International Characters on Windows +## International Characters on Windows -[AutoHotkey](https://autohotkey.com) allows Windows users to create custom hotkeys among others. +### AutoHotkey allows Windows users to create custom hotkeys among others. -The method does not require Unicode support in the keyboard itself but depends instead of AutoHotkey running in the background. +The method does not require Unicode support in the keyboard itself but depends instead of [AutoHotkey](https://autohotkey.com) running in the background. First you need to select a modifier combination that is not in use by any of your programs. CtrlAltWin is not used very widely and should therefore be perfect for this. @@ -57,3 +120,11 @@ 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. + +### US International + +If you enable the US International layout on the system, it will use punctuation to accent the characters. + +For instance, typing "`a" will result in à. + +You can find details on how to enable this [here](https://support.microsoft.com/en-us/help/17424/windows-change-keyboard-layout). -- cgit v1.2.3 From 914d42acd01cae9fa03d9368f9316a1e1017fb17 Mon Sep 17 00:00:00 2001 From: chipperdoodles Date: Sun, 7 Oct 2018 11:23:41 -0700 Subject: Update Bluetooth docs (#4062) * syncing upstream * Bluetooth Doc update More Description in bluetooth section, Addition to Config options rules.mk section. * merge upstream chibios * lib/chibios checkout * Additional EZ key Section added back EZ-Key diy link, Cleaned up some errors --- docs/config_options.md | 4 +++- docs/feature_bluetooth.md | 32 +++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index 072857727b..4678a7146c 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -245,7 +245,9 @@ Use these to enable or disable building certain features. The more you have enab * `UNICODE_ENABLE` * Unicode * `BLUETOOTH_ENABLE` - * Enable Bluetooth with the Adafruit EZ-Key HID + * Legacy option to Enable Bluetooth with the Adafruit EZ-Key HID. See BLUETOOTH +* `BLUETOOTH` + * Current options are AdafruitEzKey, AdafruitBLE, RN42 * `SPLIT_KEYBOARD` * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common * `WAIT_FOR_USB` diff --git a/docs/feature_bluetooth.md b/docs/feature_bluetooth.md index f647adc727..3ffbfa0680 100644 --- a/docs/feature_bluetooth.md +++ b/docs/feature_bluetooth.md @@ -1,10 +1,40 @@ # Bluetooth -## Bluetooth Functionality +## Bluetooth Known Supported Hardware +Currently Bluetooth support is limited to AVR based chips. For Bluetooth 2.1 Qmk has support for RN-42 HID Firmware and Bluefruit EZ Key the later of which is not produced anymore. For more recent BLE protocols currently only the Adafruit Bluefruit SPI friend is directly supported. BLE is needed to connect to iOS devices. Note iOS does not support Mouse Input. + +|Board |Bluetooth Protocol |Connection Type |Rules.mk |Bluetooth Chip| +|----------------------------------------------------------------|----------------------------|----------------|---------------------------|--------------| +|[Adafruit EzKey HID]("https://www.adafruit.com/product/1535") |Bluetooth Classic | UART | BLUETOOTH = AdafruitEZKey | | +|Rover Networks RN-42 (Sparkfun Bluesmirf) |Bluetooth Classic | UART | BLUETOOTH = RN42 | RN-42 | +|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy | SPI | BLUETOOTH = AdafruitBLE | nRF5182 | + +Not Supported Yet but possible: +* [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479). [Possible tmk implementation found in](https://github.com/tmk/tmk_keyboard/issues/514) +* HC-05 boards flashed with RN-42 firmware. They apparently both use the CSR BC417 Chip. Flashing it with RN-42 firmware gives it HID capability. +* [Sparkfun Bluetooth mate](https://www.sparkfun.com/products/14839) +* HM-13 based boards + +### Adafruit BLE SPI Friend +Currently The only bluetooth chipset supported by QMK is the Adafruit Bluefruit SPI Friend. It's a Nordic nRF5182 based chip running Adafruit's custom firmware. Data is transmitted via Adafruit's SDEP over Hardware SPI. The [Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829) is supported as it's an AVR mcu connected via SPI to the Nordic BLE chip with Adafruit firmware. If Building a custom board with the SPI friend it would be easiest to just use the pin selection that the 32u4 feather uses but you can change the pins in the config.h options with the following defines: +* #define AdafruitBleResetPin D4 +* #define AdafruitBleCSPin B4 +* #define AdafruitBleIRQPin E6 + +A Bluefruit UART friend can be converted to an SPI friend, however this [requires](https://github.com/qmk/qmk_firmware/issues/2274) some reflashing and soldering directly to the MDBT40 chip. + +## Adafruit EZ-Key hid 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. + +## Bluetooth Rules.mk Options +Use only one of these +* BLUETOOTH_ENABLE = yes (Legacy Option) +* BLUETOOTH = RN42 +* BLUETOOTH = AdafruitEZKey +* BLUETOOTH = AdafruitBLE ## Bluetooth Keycodes -- cgit v1.2.3 From 04e28470bcf22b05ca2bd52746c2254cae281836 Mon Sep 17 00:00:00 2001 From: Brian Choromanski Date: Mon, 8 Oct 2018 09:48:44 -0400 Subject: Added OSL to list of layer toggles --- docs/feature_advanced_keycodes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 5f30359e0d..0f5b8618a8 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -27,6 +27,7 @@ These functions allow you to activate layers in various ways. Note that layers a * `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. * `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers. * `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. +* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. * `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa * `TO(layer)` - activates *layer* and de-activates all other layers (except your default layer). This function is special, because instead of just adding/removing one layer to your active layer stack, it will completely replace your current active layers, uniquely allowing you to replace higher layers with a lower one. This is activated on keydown (as soon as the key is pressed). * `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps. -- cgit v1.2.3 From 7f6bb82b9daf51fb79972871e9f85696f783aa7a Mon Sep 17 00:00:00 2001 From: Brian Choromanski Date: Tue, 9 Oct 2018 13:20:09 -0400 Subject: Added link to One Shot Keys --- docs/feature_advanced_keycodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 0f5b8618a8..2ca533a282 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -27,7 +27,7 @@ These functions allow you to activate layers in various ways. Note that layers a * `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. * `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers. * `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. -* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. +* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys.](#one-shot-keys) * `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa * `TO(layer)` - activates *layer* and de-activates all other layers (except your default layer). This function is special, because instead of just adding/removing one layer to your active layer stack, it will completely replace your current active layers, uniquely allowing you to replace higher layers with a lower one. This is activated on keydown (as soon as the key is pressed). * `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps. -- cgit v1.2.3 From 5a127293e7dfb348102afcb47d0e21b6fefad50a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 6 Oct 2018 18:02:02 -0700 Subject: Fix formatting in Unicode text --- docs/feature_unicode.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index f13eed05b8..b1527b848a 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -82,11 +82,11 @@ sort of like macro. Unfortunately, each OS has different ideas on how Unicode is This is the current list of Unicode input method in QMK: -* _UC_OSX_: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. -* _UC_OSX_RALT_: Same as UC_OSX, but sends the Right Alt key for unicode input -* _UC_LNX_: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. -* _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. +* __UC_OSX__: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. +* __UC_OSX_RALT__: Same as UC_OSX, but sends the Right Alt key for unicode input +* __UC_LNX__: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. +* __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. At some point, you need to call `set_unicode_input_mode(x)` to set the correct unicode method. This sets the method that is used to send the unicode, and stores it in EEPROM, so you only need to call this once. -- cgit v1.2.3 From f2965e1eeaf1769e106145a9d19f102fcd8fe4d4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 10 Oct 2018 08:00:41 -0700 Subject: Specify max layers supported in layer keycodes --- docs/feature_advanced_keycodes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 2ca533a282..15109e5459 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -26,8 +26,8 @@ These functions allow you to activate layers in various ways. Note that layers a * `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).) * `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. * `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers. -* `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. -* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys.](#one-shot-keys) +* `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. Only supports layers 0-15. +* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys](#one-shot-keys) for details and additional functionality. * `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa * `TO(layer)` - activates *layer* and de-activates all other layers (except your default layer). This function is special, because instead of just adding/removing one layer to your active layer stack, it will completely replace your current active layers, uniquely allowing you to replace higher layers with a lower one. This is activated on keydown (as soon as the key is pressed). * `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps. -- cgit v1.2.3 From 0e4374042c5aef32762637f6fefd4662106bd5af Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 10 Oct 2018 16:32:38 -0700 Subject: Update and cleanup AVR Hardware docs --- docs/hardware_avr.md | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'docs') diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md index be69324062..4d81a23d7d 100644 --- a/docs/hardware_avr.md +++ b/docs/hardware_avr.md @@ -8,7 +8,7 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_ QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script: -``` +```bash $ util/new_project.sh my_awesome_keyboard ###################################################### # /keyboards/my_awesome_keyboard project created. To start @@ -30,7 +30,7 @@ This is where all the custom logic for your keyboard goes. Many keyboards do not This is the file you define your [Layout Macro(s)](feature_layouts.md) in. At minimum you should have a `#define LAYOUT` for your keyboard that looks something like this: -``` +```c #define LAYOUT( \ k00, k01, k02, \ k10, k11 \ @@ -57,7 +57,7 @@ At the top of the `config.h` you'll find USB related settings. These control how Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately reflect your keyboard. -``` +```c #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0001 @@ -72,14 +72,14 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r The next section of the `config.h` file deals with your keyboard's matrix. The first thing you should set is the matrix's size. This is usually, but not always, the same number of rows and columns as the physical key arrangement. -``` +```c #define MATRIX_ROWS 2 #define MATRIX_COLS 3 ``` Once you've defined the size of your matrix you need to define which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins: -``` +```c #define MATRIX_ROW_PINS { D0, D5 } #define MATRIX_COL_PINS { F1, F0, B0 } #define UNUSED_PINS @@ -89,7 +89,7 @@ The number of `MATRIX_ROW_PINS` entries must be the same as the number you assig Finally, you can specify the direction your diodes point. This can be `COL2ROW`, `ROW2COL`, or `CUSTOM_MATRIX`. -``` +```c #define DIODE_DIRECTION COL2ROW ``` @@ -97,16 +97,14 @@ Finally, you can specify the direction your diodes point. This can be `COL2ROW`, By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md). -``` +```c #define BACKLIGHT_PIN B7 #define BACKLIGHT_LEVELS 3 #define BACKLIGHT_BREATHING #define BREATHING_PERIOD 6 ``` -{% hint style='info' %} -You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details. -{% endhint %} +?> You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details. ### Other Configuration Options @@ -120,7 +118,7 @@ You use the `rules.mk` file to tell QMK what files to build and what features to These options tell the build system what CPU to build for. Be very careful if you change any of these settings, you can render your keyboard inoperable. -``` +```make MCU = atmega32u4 F_CPU = 16000000 ARCH = AVR8 @@ -128,26 +126,26 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT ``` -### Bootloader Size +### Bootloaders -The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. If you are using a teensy 2.0, or a device like the Ergodox EZ that uses the teensy bootloader you should set this to `512`. Most other bootloaders should be set to `4096`, but `1024` and `2048` are other possible values you may encounter. +The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. -#### Teensy 2.0 Bootloader Example +#### Teensy Bootloader Example -``` -OPT_DEFS += -DBOOTLOADER_SIZE=512 +```make +BOOTLOADER = halfkay ``` -#### Teensy 2.0++ Bootloader Example +#### Atmel DFU Loader Example -``` -OPT_DEFS += -DBOOTLOADER_SIZE=1024 +```make +BOOTLOADER = atmel-dfu ``` -#### Atmel DFU Loader Example +#### Pro Micro Bootloader Example -``` -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +```make +BOOTLOADER = caterina ``` ### Build Options -- cgit v1.2.3 From 43757cd985153ba4f620336003c20b3554c03678 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 10 Oct 2018 16:10:30 -0700 Subject: Cleanup learning newb links --- docs/_sidebar.md | 1 + docs/newbs.md | 3 +-- docs/newbs_learn_more_resources.md | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 973428c9e0..32e3c7eca0 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -3,6 +3,7 @@ * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) + * [Learning Resources](newbs_learn_more_resources.md) * [QMK Basics](README.md) * [QMK Introduction](getting_started_introduction.md) diff --git a/docs/newbs.md b/docs/newbs.md index 87933b018c..38a9607d44 100644 --- a/docs/newbs.md +++ b/docs/newbs.md @@ -6,7 +6,7 @@ Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built y ## Overview -There are 4 main sections to this guide: +There are 5 main sections to this guide: * [Getting Started](newbs_getting_started.md) * [Building Your First Firmware](newbs_building_firmware.md) @@ -15,4 +15,3 @@ There are 4 main sections to this guide: * [Learn More with these Resources](newbs_learn_more_resources.md) This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md). - diff --git a/docs/newbs_learn_more_resources.md b/docs/newbs_learn_more_resources.md index 69d165c2bb..23b99f470f 100644 --- a/docs/newbs_learn_more_resources.md +++ b/docs/newbs_learn_more_resources.md @@ -2,12 +2,12 @@ These resources are aimed at giving new members in the qmk community more understanding to the information provided in the newbs docs. Git resources: -* -*[Great General Tutorial](https://www.codecademy.com/learn/learn-git) -*[Git Game To Learn From Examples](https://learngitbranching.js.org/) -*[Git Resources to Learn More About Github](getting_started_github.md) -*[Git Resources Aimed Specificly toward QMK](contributing.md) + +* [Great General Tutorial](https://www.codecademy.com/learn/learn-git) +* [Git Game To Learn From Examples](https://learngitbranching.js.org/) +* [Git Resources to Learn More About Github](getting_started_github.md) +* [Git Resources Aimed Specificly toward QMK](contributing.md) Command Line resources: -*[Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line) \ No newline at end of file +* [Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line) -- cgit v1.2.3 From a7d05820a6258178b7ea440ee2781edf074d8f41 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 10 Oct 2018 12:38:10 -0700 Subject: Add documentation for Combo feature --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/config_options.md | 6 ++++ docs/feature_combo.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 docs/feature_combo.md (limited to 'docs') diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 32e3c7eca0..56a6463918 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -48,6 +48,7 @@ * [Backlight](feature_backlight.md) * [Bluetooth](feature_bluetooth.md) * [Bootmagic](feature_bootmagic.md) + * [Combos](feature_combo) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) * [Grave Escape](feature_grave_esc.md) diff --git a/docs/_summary.md b/docs/_summary.md index 973428c9e0..11aeb7cd36 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -47,6 +47,7 @@ * [Backlight](feature_backlight.md) * [Bluetooth](feature_bluetooth.md) * [Bootmagic](feature_bootmagic.md) + * [Combos](feature_combo) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) * [Grave Escape](feature_grave_esc.md) diff --git a/docs/config_options.md b/docs/config_options.md index 4678a7146c..19861c9d23 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -155,6 +155,10 @@ If you define these options you will enable the associated feature, which may in going to produce the 500 keystrokes a second needed to actually get more than a few ms of delay from this. But if you're doing chording on something with 3-4ms scan times? You probably want this. +* `#define COMBO_COUNT 2` + * Set this to the number of combos that you're using in the [Combo](feature_combo.md) feature. +* `#define COMBO_TERM 200` + * how long for the Combo keys to be detected. Defaults to `TAPPING_TERM` if not defined. ## RGB Light Configuration @@ -234,6 +238,8 @@ Use these to enable or disable building certain features. The more you have enab * Console for debug(+400) * `COMMAND_ENABLE` * Commands for debug and configuration +* `COMBO_ENABLE` + * Key combo feature * `NKRO_ENABLE` * USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work * `AUDIO_ENABLE` diff --git a/docs/feature_combo.md b/docs/feature_combo.md new file mode 100644 index 0000000000..f509e9f33f --- /dev/null +++ b/docs/feature_combo.md @@ -0,0 +1,88 @@ +# Combos + +The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `S` within the tapping term would hit `ESC` instead, or have it perform even more complex tasks. + +To enable this feature, yu need to add `COMBO_ENABLE = yes` to your `rules.mk`. + +Additionally, in your `config.h`, you'll need to specify the number of combos that you'll be using, by adding `#define COMBO_COUNT 1` (replacing 1 with the number that you're using). + + +Also, by default, the tapping term for the Combos is set to the same value as `TAPPING_TERM` (200 by default on most boards). But you can specify a different value by defining it in your `config.h`. For instance: `#define COMBO_TERM 300` would set the time out period for combos to 300ms. + +Then, your `keymap.c` file, you'll need to define a sequence of keys, terminated with `COMBO_END`, and a structure to list the combination of keys, and it's resulting action. + +```c +const uint16_t PROGMEM test_combo[] = {KC_A, KC_B, COMBO_END}; +combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)}; +``` + +This will send "Escape" if you hit the A and B keys. + +!> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control. + +## Examples + +If you want to add a list, then you'd use something like this: + +```c +enum combos { + AB_ESC, + JK_TAB +} +const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END}; +const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + [AB_ESC] = COMBO(ab_combo, KC_ESC), + [JK_TAB] = COMBO(jk_combo, KC_TAB) +}; +``` + +For a more complicated implementation, you can use the `process_combo_event` function to add custom handling. + +```c +enum combo_events { + ZC_COPY, + ZV_PASTE + }; + +const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END}; +const uint16_t PROGMEM paste_combo[] = {KC_Z, KC_V, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + [ZC_COPY] = COMBO_ACTION(copy_combo), + [ZV_PASTE] = COMBO_ACTION(paste_combo), +}; + +void process_combo_event(uint8_t combo_index, bool pressed) { + switch(combo_index) { + case ZC_COPY: + if (pressed) { + register_code(KC_LCTL); + register_code(KC_C); + unregister_code(KC_C); + unregister_code(KC_LCTL); + } + break; + + case ZV_PASTE: + if (pressed) { + register_code(KC_LCTL); + register_code(KC_V); + unregister_code(KC_V); + unregister_code(KC_LCTL); + } + break; + } +} +``` + +This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit Z and V. But you could change this to do stuff like change layers, play sounds, or change settings. + +## Additional Configuration + +If you're using long combos, or even longer combos, you may run into issues with this, as the structure may not be large enough to accommodate what you're doing. + +In this case, you can add either `#define EXTRA_LONG_COMBOS` or `#define EXTRA_EXTRA_LONG_COMBOS` in your `config.h` file. + +You may also be able to enable action keys by defining `COMBO_ALLOW_ACTION_KEYS`. -- cgit v1.2.3 From ec59556cd7896e359340feb961f10f3f12a48b95 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Wed, 10 Oct 2018 06:50:11 +0900 Subject: add a notice into docs/feature_rgblight.md --- docs/feature_rgblight.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 925dca724b..a2820347de 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -96,9 +96,10 @@ if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a n |`RGBLIGHT_MODE_RGB_TEST` | *None* |RGB Test | |`RGBLIGHT_MODE_ALTERNATING` | *None* |Alternating | - Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstration. +Note: For versions older than 0.6.117, The mode numbers were written directly. In `quantum/rgblight.h` there is a contrast table between the old mode number and the current symbol. + The following options can be used to tweak the various animations: |Define |Default |Description | -- cgit v1.2.3 From d81d216d72fe4e50da22259558e86c70a4f14a8d Mon Sep 17 00:00:00 2001 From: asakuno Date: Sat, 13 Oct 2018 16:40:42 +0900 Subject: Fix Typo in Custom Quantum functions document (led_state) (#4129) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *_LOCK   ↓ DEL --- docs/custom_quantum_functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index b077e4b78d..5b95450f26 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -117,12 +117,12 @@ void led_set_user(uint8_t usb_led) { } else { PORTB &= ~(1<<2); } - if (usb_led & (1< Date: Tue, 16 Oct 2018 08:36:20 +0900 Subject: Fix doc typo --- docs/getting_started_github.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/getting_started_github.md b/docs/getting_started_github.md index 7a3531c75d..aeb8738b77 100644 --- a/docs/getting_started_github.md +++ b/docs/getting_started_github.md @@ -8,7 +8,7 @@ Start on the [QMK Github page](https://github.com/qmk/qmk_firmware), and you'll ![Fork on Github](http://i.imgur.com/8Toomz4.jpg) -If you're apart of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button: +If you're a part of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button: ![Download from Github](http://i.imgur.com/N1NYcSz.jpg) -- cgit v1.2.3 From d08f9cb6e4d5f14409d49ea5df93cb91777357da Mon Sep 17 00:00:00 2001 From: Christoffer Holmberg Date: Wed, 17 Oct 2018 21:54:37 +0300 Subject: Fix grammar, typos, and the link to HID specification --- docs/how_keyboards_work.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/how_keyboards_work.md b/docs/how_keyboards_work.md index fac2b5a489..cc54e566a1 100644 --- a/docs/how_keyboards_work.md +++ b/docs/how_keyboards_work.md @@ -27,17 +27,17 @@ This usually happens with a periodic scan of key presses. This speed often is li ## 2. What the Firmware Sends -The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard. +The [HID specification](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard. -The firmware does not send actually letters or characters, but only scancodes. -Thus, by modifying the firmware, you only can modify what scancode is sent over +The firmware does not send actual letters or characters, but only scancodes. +Thus, by modifying the firmware, you can only modify what scancode is sent over USB for a given key. ## 3. What the Operating System Does Once the keycode reaches the operating system, a piece of software has to have it match an actual character thanks to a keyboard layout. For example, if your -layout is set to QWERTY, a sample of the matching table is as follow: +layout is set to QWERTY, a sample of the matching table is as follows: | keycode | character | |---------|-----------| @@ -55,11 +55,11 @@ As the layout is generally fixed (unless you create your own), the firmware can ## List of Characters You Can Send -Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key only is the ones present in the layout**. +Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key are only the ones present in the layout**. -For example, this means that if you have a QWERTY US layout, and you want to assign 1 key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International. +For example, this means that if you have a QWERTY US layout, and you want to assign one key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International. -You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycode available through USB simply disallow such a thing. +You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycodes available through USB simply disallows such a thing. ## How to (Maybe) Enter Unicode Characters -- cgit v1.2.3 From dad79cafcd9b3401b68fb29aaa311e999c4c4e6e Mon Sep 17 00:00:00 2001 From: Christoffer Holmberg Date: Wed, 17 Oct 2018 23:27:16 +0300 Subject: Fix more broken links to the HID spec --- docs/keycodes_basic.md | 2 +- docs/reference_glossary.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 8445b05ef3..82e94aa5e9 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -1,6 +1,6 @@ # Basic Keycodes -The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details. +The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details. ## Letters and Numbers diff --git a/docs/reference_glossary.md b/docs/reference_glossary.md index 29d07f26d3..422abb2ece 100644 --- a/docs/reference_glossary.md +++ b/docs/reference_glossary.md @@ -128,7 +128,7 @@ The standard Deutsche (German) keyboard layout. Named for the first 6 letters on The term for pressing a key while a key is already held down. Variants include 2KRO, 6KRO, and NKRO. ## Scancode -A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/). +A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/). ## Space Cadet Shift A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times. -- cgit v1.2.3 From 480651cf9df5c0b7453f60dffe13ae5de665a120 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 18 Oct 2018 15:12:11 -0700 Subject: Docs: Adding QMK Git Conventions doc; formatting cleanup on Learning Resources doc (#3902) * Docs: newbs_learn_more_resources.md: formatting * Added QMK Git Conventions doc, initial version * Renamed contributing_qmk.md to newbs_best_practices.md * Updated per review by @drashna * Added navigation links * Updated to Best Practices doc * Minor updates to Learn More Resources doc Markdown formatting consistency because I'm particular about it. * Added Merge Conflict section to Best Practices doc --- docs/_sidebar.md | 1 + docs/_summary.md | 2 + docs/newbs.md | 1 + docs/newbs_best_practices.md | 163 +++++++++++++++++++++++++++++++++++++ docs/newbs_learn_more_resources.md | 6 +- 5 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 docs/newbs_best_practices.md (limited to 'docs') diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 56a6463918..465f4657cd 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -3,6 +3,7 @@ * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) + * [Best Practices](newbs_best_practices.md) * [Learning Resources](newbs_learn_more_resources.md) * [QMK Basics](README.md) diff --git a/docs/_summary.md b/docs/_summary.md index 11aeb7cd36..465f4657cd 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -3,6 +3,8 @@ * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) + * [Best Practices](newbs_best_practices.md) + * [Learning Resources](newbs_learn_more_resources.md) * [QMK Basics](README.md) * [QMK Introduction](getting_started_introduction.md) diff --git a/docs/newbs.md b/docs/newbs.md index 38a9607d44..e687fd2279 100644 --- a/docs/newbs.md +++ b/docs/newbs.md @@ -12,6 +12,7 @@ There are 5 main sections to this guide: * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) +* [Best Practices](newbs_best_practices.md) * [Learn More with these Resources](newbs_learn_more_resources.md) This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md). diff --git a/docs/newbs_best_practices.md b/docs/newbs_best_practices.md new file mode 100644 index 0000000000..61bcc0c6ad --- /dev/null +++ b/docs/newbs_best_practices.md @@ -0,0 +1,163 @@ +# Best Practices + +## Or, "How I Learned to Stop Worrying and Love Git." + +This document aims to instruct novices in the best ways to have a smooth experience in contributing to QMK. We will walk through the process of contributing to QMK, detailing some ways to make this task easier, and then later we'll break some things in order to teach you how to fix them. + +This document assumes a few things: + +1. You have a GitHub account, and have [forked the qmk_firmware repository](getting_started_github.md) to your account. +2. You've [set up your build environment](newbs_getting_started.md?id=environment-setup). + + +## Your fork's master: Update Often, Commit Never + +It is highly recommended for QMK development, regardless of what is being done or where, to keep your `master` branch updated, but ***never*** commit to it. Instead, do all your changes in a development branch and issue pull requests from your branches when you're developing. + +To reduce the chances of merge conflicts — instances where two or more users have edited the same part of a file concurrently — keep your `master` branch relatively up-to-date, and start any new developments by creating a new branch. + +### Updating your master branch + +To keep your `master` branch updated, it is recommended to add the QMK Firmware repository ("repo") as a remote repository in git. To do this, open your Git command line interface and enter: + +``` +git remote add upstream https://github.com/qmk/qmk_firmware.git +``` + +To verify that the repository has been added, run `git remote -v`, which should return the following: + +``` +$ git remote -v +origin https://github.com//qmk_firmware.git (fetch) +origin https://github.com//qmk_firmware.git (push) +upstream https://github.com/qmk/qmk_firmware.git (fetch) +upstream https://github.com/qmk/qmk_firmware.git (push) +``` + +Now that this is done, you can check for updates to the repo by running `git fetch upstream`. This retrieves the branches and tags — collectively referred to as "refs" — from the QMK repo, which now has the nickname `upstream`. We can now compare the data on our fork `origin` to that held by QMK. + +To update your fork's master, run the following, hitting the Enter key after each line: + +``` +git checkout master +git fetch upstream +git pull upstream master +git push origin master +``` + +This switches you to your `master` branch, retrieves the refs from the QMK repo, downloads the current QMK `master` branch to your computer, and then uploads it to your fork. + +### Making Changes + +To make changes, create a new branch by entering: + +``` +git checkout -b dev_branch +git push --set-upstream origin dev_branch +``` + +This creates a new branch named `dev_branch`, checks it out, and then saves the new branch to your fork. The `--set-upstream` argument tells git to use your fork and the `dev_branch` branch every time you use `git push` or `git pull` from this branch. It only needs to be used on the first push; after that, you can safely use `git push` or `git pull`, without the rest of the arguments. + +!> With `git push`, you can use `-u` in place of `--set-upstream` — `-u` is an alias for `--set-upstream`. + +You can name your branch nearly anything you want, though it is recommended to name it something related to the changes you are going to make. + +By default `git checkout -b` will base your new branch on the branch that is checked out. You can base your new branch on an existing branch that is not checked out by adding the name of the existing branch to the command: + +``` +git checkout -b dev_branch master +``` + +Now that you have a development branch, open your text editor and make whatever changes you need to make. It is recommended to make many small commits to your branch; that way, any change that causes issues can be more easily traced and undone if needed. To make your changes, edit and save any files that need to be updated, add them to Git's *staging area*, and then commit them to your branch: + +``` +git add path/to/updated_file +git commit -m "My commit message." +``` + +`git add` adds files that have been changed to Git's *staging area*, which is Git's "loading zone." This contains the changes that are going to be *committed* by `git commit`, which saves the changes to the repo. Use descriptive commit messages so you can know what was changed at a glance. + +!> If you've changed a lot of files, but all the files are part of the same change, you can use `git add .` to add all the changed files that are in your current directory, rather than having to add each file individually. + +### Publishing Your Changes + +The last step is to push your changes to your fork. To do this, enter `git push`. Git now publishes the current state of `dev_branch` to your fork. + + +## Resolving Merge Conflicts + +Sometimes when your work in a branch takes a long time to complete, changes that have been made by others conflict with changes you have made to your branch when you open a pull request. This is called a *merge conflict*, and is what happens when multiple people edit the same parts of the same files. + +### Rebasing Your Changes + +A *rebase* is Git's way of taking changes that were applied at one point, reversing them, and then applying the same changes to another point. In the case of a merge conflict, you can rebase your branch to grab the changes that were made between when you created your branch and the present time. + +To start, run the following: + +``` +git fetch upstream +git rev-list --left-right --count HEAD...upstream/master +``` + +The `git rev-list` command entered here returns the number of commits that differ between the current branch and QMK's master branch. We run `git fetch` first to make sure we have the refs that represent the current state of the upstream repo. The output of the `git rev-list` command entered returns two numbers: + +``` +$ git rev-list --left-right --count HEAD...upstream/master +7 35 +``` + +The first number represents the number of commits on the current branch since it was created, and the second number is the number of commits made to `upstream/master` since the current branch was created, and thus, the changes that are not recorded in the current branch. + +Now that the current states of both the current branch and the upstream repo are known, we can start a rebase operation: + +``` +git rebase upstream/master +``` + +This tells Git to undo the commits on the current branch, and then reapply them against QMK's master branch. + +``` +$ git rebase upstream/master +First, rewinding head to replay your work on top of it... +Applying: Commit #1 +Using index info to reconstruct a base tree... +M conflicting_file_1.txt +Falling back to patching base and 3-way merge... +Auto-merging conflicting_file_1.txt +CONFLICT (content): Merge conflict in conflicting_file_1.txt +error: Failed to merge in the changes. +hint: Use 'git am --show-current-patch' to see the failed patch +Patch failed at 0001 Commit #1 + +Resolve all conflicts manually, mark them as resolved with +"git add/rm ", then run "git rebase --continue". +You can instead skip this commit: run "git rebase --skip". +To abort and get back to the state before "git rebase", run "git rebase --abort". +``` + +This tells us that we have a merge conflict, and gives the name of the file with the conflict. Open the conflicting file in your text editor, and somewhere in the file, you'll find something like this: + +``` +<<<<<<< HEAD +

For help with any issues, email us at support@webhost.us.

+======= +

Need help? Email support@webhost.us.

+>>>>>>> Commit #1 +``` + +The line `<<<<<<< HEAD` marks the beginning of a merge conflict, and the `>>>>>>> Commit #1` line marks the end, with the conflicting sections separated by `=======`. The part on the `HEAD` side is from the QMK master version of the file, and the part marked with the commit message is from the current branch and commit. + +Because Git tracks *changes to files* rather than the contents of the files directly, if Git can't find the text that was in the file previous to the commit that was made, it won't know how to edit the file. Re-editing the file will solve the conflict. Make your changes, and then save the file. + +``` +

Need help? Email support@webhost.us.

+``` + +Now run: + +``` +git add conflicting_file_1.txt +git rebase --continue +``` + +Git logs the changes to the conflicting file, and continues applying the commits from our branch until it reaches the end. diff --git a/docs/newbs_learn_more_resources.md b/docs/newbs_learn_more_resources.md index 23b99f470f..9b77db8fd4 100644 --- a/docs/newbs_learn_more_resources.md +++ b/docs/newbs_learn_more_resources.md @@ -1,13 +1,15 @@ # Learning Resources -These resources are aimed at giving new members in the qmk community more understanding to the information provided in the newbs docs. + +These resources are aimed at giving new members in the QMK community more understanding to the information provided in the Newbs docs. Git resources: * [Great General Tutorial](https://www.codecademy.com/learn/learn-git) * [Git Game To Learn From Examples](https://learngitbranching.js.org/) * [Git Resources to Learn More About Github](getting_started_github.md) -* [Git Resources Aimed Specificly toward QMK](contributing.md) +* [Git Resources Aimed Specifically toward QMK](contributing.md) Command Line resources: + * [Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line) -- cgit v1.2.3 From 7e1b57add42dcc3330d9d99e28c9b7f96eb2eee8 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 18 Oct 2018 21:34:40 -0700 Subject: Some cleanup of the Useful Functions docs (#4064) * Add examples for tri layers * Clean up and spelling fixes --- docs/ref_functions.md | 78 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 14 deletions(-) (limited to 'docs') diff --git a/docs/ref_functions.md b/docs/ref_functions.md index 7d0cda3227..9b5be7a883 100644 --- a/docs/ref_functions.md +++ b/docs/ref_functions.md @@ -1,28 +1,79 @@ # List of Useful Core Functions To Make Your Keyboard Better -There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page. +There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page. ## (OLKB) Tri Layers -There are actually separate functions that you can use there, depending on what you're after. +There are actually separate functions that you can use there, depending on what you're after. -The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`. +### `update_tri_layer(x, y, z)` -This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this. +The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`. -The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check. +This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this. -The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it. +#### Example + +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} +``` + +### `update_tri_layer_state(state, x, y, z)` +The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check. + +The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it. + +#### Example + +```c +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} +``` + +Alternatively, you don't have to immediately "return" the value. This is useful if you want to add multiple tri layers, or if you want to add additional effects. + +```c +uint32_t layer_state_set_user(uint32_t state) { + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + state = update_tri_layer_state(state, _RAISE, _SYMB, _SPECIAL); + return state; +} +``` ## Setting the Persistent Default Layer -Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you. +Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you. -To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK). +To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK). -This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set. +This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set. -To configure the default layer sounds, you would want to define this in your `config.h` file, like this: +To configure the default layer sounds, you would want to define this in your `config.h` file, like this: ```c #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ @@ -36,13 +87,12 @@ To configure the default layer sounds, you would want to define this in your `co ## Reseting the keyboard -There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that. +There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that. And to do so, add `reset_keyboard()` to your function or macro, and this will reset to bootloader. ## Wiping the EEPROM (Persistent Storage) -If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so. - -To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. +If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so. +To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. -- cgit v1.2.3 From ea17e363a61b925c1c6da0146fe383630a7848c0 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 20 Oct 2018 08:40:32 -0700 Subject: Add instructions for zadig when bootloader device is unknown --- docs/faq_build.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/faq_build.md b/docs/faq_build.md index 7d17df0745..00a0d386b9 100644 --- a/docs/faq_build.md +++ b/docs/faq_build.md @@ -17,7 +17,7 @@ or just: Note that running `make` with `sudo` is generally *not* a good idea, and you should use one of the former methods, if possible. -## Linux `udev` Rules +### Linux `udev` Rules On Linux, you'll need proper privileges to access the MCU. You can either use `sudo` when flashing firmware, or place these files in `/etc/udev/rules.d/`. @@ -37,6 +37,14 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", MODE:="066 SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666" ``` +## Unknown Device for DFU Bootloader + +If you're using Windows to flash your keyboard, and you are running into issues, check the Device Manager. If you see an "Unknown Device" when the keyboard is in "bootloader mode", then you may have a driver issue. + +Re-running the installation script for MSYS2 may help (eg run `./util/qmk_install.sh` from MSYS2/WSL) or reinstalling the QMK Toolbox may fix the issue. + +If that doesn't work, then you may need to grab the [Zadig Utility](https://zadig.akeo.ie/). Download this, find the device in question, and select the `WinUS(libusb-1.0)` option, and hit "Reinstall driver". Once you've done that, try flashing your board, again. + ## 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). -- cgit v1.2.3 From 91bfbb62560cc237066de2392eefbb271eff9d6b Mon Sep 17 00:00:00 2001 From: "Colin T.A. Gray" Date: Mon, 22 Oct 2018 14:19:51 -0400 Subject: Updates docs - planck 6 and macos instructions (#4201) * add note about how to install rev6 (dfu-util) * include instructions on installing dfu-util on macOS --- docs/faq_build.md | 2 ++ docs/getting_started_build_tools.md | 1 + 2 files changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/faq_build.md b/docs/faq_build.md index 00a0d386b9..465a283aef 100644 --- a/docs/faq_build.md +++ b/docs/faq_build.md @@ -105,10 +105,12 @@ The solution is to remove and reinstall all affected modules. ``` brew rm avr-gcc brew rm dfu-programmer +brew rm dfu-util brew rm gcc-arm-none-eabi brew rm avrdude brew install avr-gcc brew install dfu-programmer +brew install dfu-util brew install gcc-arm-none-eabi brew install avrdude ``` diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index c1e02d4e07..dd3e7805a9 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -58,6 +58,7 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands: brew update brew install avr-gcc@7 brew install dfu-programmer + brew install dfu-util brew install gcc-arm-none-eabi brew install avrdude -- cgit v1.2.3 From fbc6bd82664f7286e358e14da6c7945aa061ee3b Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Mon, 22 Oct 2018 14:29:04 -0400 Subject: Minor updates to build tools docs revised (#4195) * add initial khord iris keymap * correct path of windows qmk install script --- docs/getting_started_build_tools.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index dd3e7805a9..88f3642b28 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -62,7 +62,7 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands: brew install gcc-arm-none-eabi brew install avrdude -This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of avr-libc can take over 20 minutes and exhibit high CPU usage. +This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of `avr-gcc@7` can take over 20 minutes and exhibit high CPU usage. ## Windows with msys2 (recommended) @@ -70,9 +70,9 @@ The best environment to use, for Windows Vista through any later version (tested * Install msys2 by downloading it and following the instructions here: http://www.msys2.org * Open the ``MSYS2 MingGW 64-bit`` shortcut -* Navigate to your qmk checkout. For example, if it's in the root of your c drive: +* Navigate to your QMK repository. For example, if it's in the root of your c drive: * `$ cd /c/qmk_firmware` -* Run `util/msys2_install.sh` and follow the prompts +* Run `util/qmk_install.sh` and follow the prompts ## Windows 10 (deprecated) These are the old instructions for Windows 10. We recommend you use [MSYS2 as outlined above](#windows-with-msys2-recommended). -- cgit v1.2.3 From ab3fbfdb3b36533125f520b540212a88349ceae6 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 10:13:08 -0700 Subject: Update hardware config warnings to be more accurate Closes #3565 --- docs/hardware_avr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md index 4d81a23d7d..2c3652a02d 100644 --- a/docs/hardware_avr.md +++ b/docs/hardware_avr.md @@ -66,7 +66,7 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r #define DESCRIPTION A custom keyboard ``` -?> Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. On Linux these values will not be visible in `lsusb`, since Linux takes that information from the list published by the USB-IF. +?> Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. ?> On Linux these values will not be visible in lsusb by default, since Linux takes the information from the list maintained by [USB ID Repository](http://www.linux-usb.org/usb-ids.html) by default. lsusb will show the information reported by the device when executed with -v option. It is also present in kernel logs after plugging in the device. ### Keyboard Matrix Configuration -- cgit v1.2.3 From 9374c0c9db317932d78356b2f92a7993145ea9a2 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 11:57:15 -0700 Subject: Add caveats for shifted characters (#4192) * Add caveats for shifted characters And some formatting and grammar corrections. Closes #1037 * Fix spelling of remote * Fix spelling error * Remote not Remove * Remote not Remove --- docs/feature_advanced_keycodes.md | 20 ++++++++++++++------ docs/keycodes_us_ansi_shifted.md | 4 ++++ 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 15109e5459..85f4fa1bfc 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -2,7 +2,7 @@ Your keymap can include keycodes that are more advanced than normal, for example keys that switch layers or send modifiers when held, but send regular keycodes when tapped. This page documents the functions that are available to you. -### Assigning Custom Names +## Assigning Custom Names People often define custom names using `#define`. For example: @@ -13,7 +13,7 @@ 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. -### Caveats +## Caveats Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored. @@ -36,7 +36,7 @@ These functions allow you to activate layers in various ways. Note that layers a 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. -### Beginners +## Beginners If you are just getting started with QMK you will want to keep everything simple. Follow these guidelines when setting up your layers: @@ -44,11 +44,11 @@ If you are just getting started with QMK you will want to keep everything simple * Arrange your layers in a "tree" layout, with layer 0 as the root. Do not try to enter the same layer from more than one other layer. * In a layer's keymap, only reference higher-numbered layers. Because layers are processed from the highest-numbered (topmost) active layer down, modifying the state of lower layers can be tricky and error-prone. -### Intermediate Users +## Intermediate Users Sometimes you need more than one base layer. For example, if you want to switch between QWERTY and Dvorak, switch between layouts for different countries, or switch your layout for different videogames. Your base layers should always be the lowest numbered layers. When you have multiple base layers you should always treat them as mutually exclusive. When one base layer is on the others are off. -### Advanced Users +## Advanced Users Once you have a good feel for how layers work and what you can do, you can get more creative. The rules listed in the beginner section will help you be successful by avoiding some of the tricker details but they can be constraining, especially for ultra-compact keyboard users. Understanding how layers work will allow you to use them in more advanced ways. @@ -126,6 +126,14 @@ For convenience, QMK includes some Mod-Tap shortcuts to make common combinations |`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | +## Caveats + +Unfortunately, these keycodes cannot be used in Mod-Taps or Layer-Taps, since any modifiers specified in the keycode are ignored. + +Additionally, you may run into issues when using Remote Desktop Connection on Windows. Because these codes send shift very fast, Remote Desktop may miss the codes. + +To fix this, open Remote Desktop Connection, click on "Show Options", open the the "Local Resources" tab. In the keyboard section, change the drop down to "On this Computer". This will fix the issue, and allow the characters to work correctly. + # One Shot Keys One shot keys are keys that remain active until the next key is pressed, and then are released. This allows you to type keyboard combinations without pressing more than one key at a time. These keys are usually called "Sticky keys" or "Dead keys". @@ -146,7 +154,7 @@ You can control the behavior of one shot keys by defining these in `config.h`: Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L429). -If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. +If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by clicking on "Show Options", going to the "Local Resources" tab, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. # Permissive Hold diff --git a/docs/keycodes_us_ansi_shifted.md b/docs/keycodes_us_ansi_shifted.md index e7abaa7099..41d6035929 100644 --- a/docs/keycodes_us_ansi_shifted.md +++ b/docs/keycodes_us_ansi_shifted.md @@ -6,6 +6,10 @@ These keycodes correspond to characters that are "shifted" on a standard US ANSI Unfortunately, these keycodes cannot be used in Mod-Taps or Layer-Taps, since any modifiers specified in the keycode are ignored. +Additionally, you may run into issues when using Remote Desktop Connection on Windows. Because these codes send shift very fast, Remote Desktop may miss the codes. + +To fix this, open Remote Desktop Connection, click on "Show Options", open the the "Local Resources" tab. In the keyboard section, change the drop down to "On this Computer". This will fix the issue, and allow the characters to work correctly. + ## Keycodes |Key |Aliases |Description | -- cgit v1.2.3 From 552b1cccec12f2685f594df5b58afc11ca1fbc74 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 18 Oct 2018 21:33:50 -0700 Subject: Update the installation script PR (#4167) * Update docs to use qmk_install * Update Vagrantfile to use qmk_install --- docs/getting_started_build_tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index 88f3642b28..587dece4a1 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -8,7 +8,7 @@ Note: If it is your first time here, Check out the "Complete Newbs guide" instea ## Linux -To ensure you are always up to date, you can just run `sudo util/install_dependencies.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.** +To ensure you are always up to date, you can just run `sudo util/qmk_install.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.** You can also install things manually, but this documentation might not be always up to date with all requirements. -- cgit v1.2.3 From a5b10e5da24cb52c04dddc9168d5e7590fb749d2 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 24 Oct 2018 12:13:40 -0700 Subject: Fix syntax for windows --- docs/newbs_building_firmware.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/newbs_building_firmware.md b/docs/newbs_building_firmware.md index ac6bff2bc7..fabfefb190 100644 --- a/docs/newbs_building_firmware.md +++ b/docs/newbs_building_firmware.md @@ -16,7 +16,7 @@ Start by navigating to the `keymaps` folder for your keyboard. ?> Windows: - start keyboards//keymaps + start .\\keyboards\\\\keymaps ## Create a Copy Of The `default` Keymap -- cgit v1.2.3 From fa1ac4d7242a0f3944d71b58926ff2a1ce73c96b Mon Sep 17 00:00:00 2001 From: Phillip Tennen Date: Fri, 26 Oct 2018 15:59:41 +0200 Subject: Fix incorrect doctoring in feature.backlight.md (#4244) I'm guessing someone deleted a row at some point in the past, but I didn't blame it. --- docs/feature_backlight.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 8f883e08fb..7bb7e03a89 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -61,7 +61,7 @@ In this handler, the value of an incrementing counter is mapped onto a precomput |`backlight_increase()` |Increase the backlight level | |`backlight_decrease()` |Decrease the backlight level | |`backlight_level(x)` |Sets the backlight level to specified level | -|`get_backlight_level()`|Toggle backlight breathing | +|`get_backlight_level()`|Return the current backlight level | ### Backlight Breathing Functions -- cgit v1.2.3 From 85688e5b52112c86895171d3dc8b26610480e932 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 26 Oct 2018 16:19:23 -0400 Subject: add support for encoders to core --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/feature_encoders.md | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 docs/feature_encoders.md (limited to 'docs') diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 465f4657cd..2c57380122 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -52,6 +52,7 @@ * [Combos](feature_combo) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) + * [Encoders](feature_encoders.md) * [Grave Escape](feature_grave_esc.md) * [Key Lock](feature_key_lock.md) * [Layouts](feature_layouts.md) diff --git a/docs/_summary.md b/docs/_summary.md index 465f4657cd..2c57380122 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -52,6 +52,7 @@ * [Combos](feature_combo) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) + * [Encoders](feature_encoders.md) * [Grave Escape](feature_grave_esc.md) * [Key Lock](feature_key_lock.md) * [Layouts](feature_layouts.md) diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md new file mode 100644 index 0000000000..f482eefec8 --- /dev/null +++ b/docs/feature_encoders.md @@ -0,0 +1,41 @@ +# Encoders + +Basic encoders are supported by adding this to your `rules.mk`: + + ENCODER_ENABLE = yes + +and this to your `config.h`: + + #define NUMBER_OF_ENCODERS 1 + #define ENCODERS_PAD_A { B12 } + #define ENCODERS_PAD_B { B13 } + +Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.: + + #define ENCODERS_PAD_A { encoder1a, encoder2a } + #define ENCODERS_PAD_B { encoder1a, encoder2b } + +If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions. + +Additionally, the resolution can be specified in the same file (the default & suggested is 4): + + #define ENCODER_RESOLUTION 4 + +## Callbacks + +The callback functions can be inserted into your `.c`: + + void encoder_update_kb(uint8_t index, bool clockwise) { + encoder_update_user(index, clockwise); + } + +or `keymap.c`: + + void encoder_update_user(uint8_t index, bool clockwise) { + + } + + +## Hardware + +The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground. -- cgit v1.2.3 From 24b3556e844ec76813a42ce4c5b7a77a6f874d5a Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 26 Oct 2018 16:47:00 -0400 Subject: add better example --- docs/feature_encoders.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index f482eefec8..036c6a1d89 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md @@ -32,10 +32,17 @@ The callback functions can be inserted into your `.c`: or `keymap.c`: void encoder_update_user(uint8_t index, bool clockwise) { - + if (index == 0) { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } } - ## Hardware The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground. -- cgit v1.2.3 From d3a6296199c6f6564e0fffd6d7c1355496d9feac Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 14:46:50 -0700 Subject: Add key caveat to combos doc --- docs/feature_combo.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/feature_combo.md b/docs/feature_combo.md index f509e9f33f..5bb73ef106 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -19,6 +19,7 @@ combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)}; This will send "Escape" if you hit the A and B keys. !> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control. +!> You cannot reuse (share) keys in combos. Each key should only belong to a single combo. ## Examples -- cgit v1.2.3 From d210ac7a3ea9a6049f2c344d3a44fdc1bccd1f1b Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 25 Oct 2018 09:01:31 -0700 Subject: Add caveat for basic keycodes in Tap Dance docs --- docs/feature_tap_dance.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/feature_tap_dance.md b/docs/feature_tap_dance.md index 93d1908831..b2b567f1d0 100644 --- a/docs/feature_tap_dance.md +++ b/docs/feature_tap_dance.md @@ -26,6 +26,8 @@ This array specifies what actions shall be taken when a tap-dance key is in acti The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise. +!> Keep in mind that only [basic keycodes](keycodes_basic.md) are supported here. Custom keycodes are not supported. + And that's the bulk of it! And now, on to the explanation of how it works! -- cgit v1.2.3 From 73e92ef0c06de389d39d3ca0a8c98da2196ebec7 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 26 Oct 2018 21:22:47 -0700 Subject: Docs: Add references to One Shot functions, and clean up formatting (#4189) * Docs: Add references to One Shot functions, and clean up formatting * Update PR based on @mechmerlin's recommendations --- docs/feature_advanced_keycodes.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 85f4fa1bfc..f2e4909d86 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -142,6 +142,8 @@ For example, if you define a key as `OSM(MOD_LSFT)`, you can type a capital A ch One shot keys also work as normal modifiers. If you hold down a one shot key and type other keys, your one shot will be released immediately after you let go of the key. +Additionally, hitting keys five times in a short period will lock that key. This applies for both One Shot Modifiers and One Shot Layers, and is controlled by the `ONESHOT_TAP_TOGGLE` define. + You can control the behavior of one shot keys by defining these in `config.h`: ```c @@ -152,15 +154,20 @@ You can control the behavior of one shot keys by defining these in `config.h`: * `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes. * `OSL(layer)` - momentary switch to *layer*. -Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L429). +Sometimes, you want to activate a one-shot key as part of a macro or tap dance routine. + +For one shot layers, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. + +For one shot mods, you need to call `set_oneshot_mods(MOD)` to set it, or `clear_oneshot_mods()` to cancel it. + +!> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. -If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by clicking on "Show Options", going to the "Local Resources" tab, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. # Permissive Hold As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option: -``` +```c #define PERMISSIVE_HOLD ``` @@ -205,6 +212,6 @@ With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allo # Retro Tapping -When you hold a dual function key, and haven't pressed anything when you release the key, normally nothing happens. However, if you enable this, if you release the key without pressing another key, it will send the original key, even if it is outside of the tapping term. +Holding and releasing a dual function key without pressing another key will result in nothing happening. With retro tapping enabled, releasing the key without pressing another will send the original keycode even if it is outside the tapping term. -For instance, if you're using `LT(2, KC_SPACE)`, if you hold the key, don't hit anything else and then release it, normally, nothing happens. But with `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`. +For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`. -- cgit v1.2.3 From 4ffcacd92086870eb7a3102d54178a7af64edb0c Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 27 Oct 2018 11:53:50 -0700 Subject: Add Bootmagic Lite to QMK (#4215) * Preliminary additon of bootmagic lite functionality * Cleanup code * Clean up bootmagic code * Add documentation and clean up code * Make 'lite' an option for BOOTMAGIC_ENABLE * Update Templates with note about Bootmagic Lite option * Detect Debounce variable * Make sure debounce is a non-zero number * Capitalize Bootmagic * Capitalize bootmagic * Update wording * Re-add EEPROM reset, by popular demand And add eeprom-less version to drashna userspace for his sanity * Fix spacing * Set BOOTMAGIC_ENABLE to use full/lite/off And default yes to "full" for compatibility * Add Bootmagic lite info to templates * Remove text from makefiles * Cleanup of makefile * mention yes in bootmagic docs * Wordsmitthing the docs * Fix white spaces * Readd default bootmagic setting, because it's necessary --- docs/feature_bootmagic.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index 586b5d8370..20c76d9b74 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md @@ -11,7 +11,15 @@ There are three separate but related features that allow you to change the behav On some keyboards Bootmagic is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk` with: ```make -BOOTMAGIC_ENABLE = yes +BOOTMAGIC_ENABLE = full +``` + +?> You may see `yes` being used in place of `full`, and this is okay. However, `yes` is deprecated, and ideally `full` (or `lite`) ideally should be used instead. + +Additionally, you can use [Bootmagic Lite](#bootmagic-lite) (a scaled down, very basic version of Bootmagic) by adding the following to your `rules.mk` file: + +```make +BOOTMAGIC_ENABLE = lite ``` ## Hotkeys @@ -99,3 +107,45 @@ If you would like to change the hotkey assignments for Bootmagic, `#define` thes |`BOOTMAGIC_KEY_DEFAULT_LAYER_5` |`KC_5` |Make layer 5 the default layer | |`BOOTMAGIC_KEY_DEFAULT_LAYER_6` |`KC_6` |Make layer 6 the default layer | |`BOOTMAGIC_KEY_DEFAULT_LAYER_7` |`KC_7` |Make layer 7 the default layer | + +# Bootmagic Lite + +In addition to the full blown Bootmagic feature, is the Bootmagic Lite feature that only handles jumping into the bootloader. This is great for boards that don't have a physical reset button but you need a way to jump into the bootloader, and don't want to deal with the headache that Bootmagic can cause. + +To enable this version of Bootmagic, you need to enable it in your `rules.mk` with: + +```make +BOOTMAGIC_ENABLE = lite +``` + +Additionally, you may want to specify which key to use. This is especially useful for keyboards that have unusual matrices. To do so, you need to specify the row and column of the key that you want to use. Add these entries to your `config.h` file: + +```c +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 1 +``` + +By default, these are set to 0 and 0, which is usually the "ESC" key on a majority of keyboards. + +And to trigger the bootloader, you hold this key down when plugging the keyboard in. Just the single key. + +## Advanced Bootmagic Lite + +The `bootmagic_lite` function is defined weakly, so that you can replace this in your code, if you need. A great example of this is the Zeal60 boards that have some additional handling needed. + +To replace the function, all you need to do is add something like this to your code: + +```c +void bootmagic_lite(void) { + matrix_scan(); + wait_ms(DEBOUNCING_DELAY * 2); + matrix_scan(); + + if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + // Jump to bootloader. + bootloader_jump(); + } +} +``` + +You can additional feature here. For instance, resetting the eeprom or requiring additional keys to be pressed to trigger bootmagic. Keep in mind that `bootmagic_lite` is called before a majority of features are initialized in the firmware. -- cgit v1.2.3 From 7373d5b394d9c75cd2b91d77984145606bf31a04 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 30 Oct 2018 16:37:08 +0100 Subject: Update feature_bootmagic.md (#4290) Fix typo --- docs/feature_bootmagic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index 20c76d9b74..504fb90f45 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md @@ -14,7 +14,7 @@ On some keyboards Bootmagic is disabled by default. If this is the case, it must BOOTMAGIC_ENABLE = full ``` -?> You may see `yes` being used in place of `full`, and this is okay. However, `yes` is deprecated, and ideally `full` (or `lite`) ideally should be used instead. +?> You may see `yes` being used in place of `full`, and this is okay. However, `yes` is deprecated, and ideally `full` (or `lite`) should be used instead. Additionally, you can use [Bootmagic Lite](#bootmagic-lite) (a scaled down, very basic version of Bootmagic) by adding the following to your `rules.mk` file: -- cgit v1.2.3 From 15f6278aa623ceda4c220daee1cbedb9e38e6a97 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 2 Nov 2018 12:31:40 -0400 Subject: Add support for Atmega32A to pin declarations and universal matrix (#4015) * add computed pins from mcu type * update for atmega32a * doc typo * add atmega16 chips, link to references * remove avr include from config * exclude assembler in config.h includes * consolodate options, add 646 * fix typo in pindef --- docs/internals_gpio_control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/internals_gpio_control.md b/docs/internals_gpio_control.md index 21643d30c9..083e696648 100644 --- a/docs/internals_gpio_control.md +++ b/docs/internals_gpio_control.md @@ -12,7 +12,7 @@ The following functions can provide basic control of GPIOs and are found in `qua |`setPinInputHigh(pin)`|Set pin as input with build in pull-up | |`setPinInputLow(pin)` |Set pin as input with build in pull-down (Supported only on STM32)| |`setPinOutput(pin)` |Set pin as output | -|`writePinHige(pin)` |Set pin level as high, assuming it is an output | +|`writePinHigh(pin)` |Set pin level as high, assuming it is an output | |`writePinLow(pin)` |Set pin level as low, assuming it is an output | |`writePin(pin, level)`|Set pin level, assuming it is an output | |`readPin(pin)` |Returns the level of the pin | -- cgit v1.2.3 From 292a87ad0442293aadfe6910c9e5f19a53e54a81 Mon Sep 17 00:00:00 2001 From: Michael Pio Date: Sun, 4 Nov 2018 01:08:05 +0800 Subject: Instructions on how to flash via STM32 bootloader (#4316) * Add instructions on flashing ARM keyboards with default STM32 bootloader * fixed typo; added note suggestion to step 4 --- docs/flashing.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/flashing.md b/docs/flashing.md index 1edbe22253..bc418c4150 100644 --- a/docs/flashing.md +++ b/docs/flashing.md @@ -71,8 +71,8 @@ Flashing sequence: 1. Press the `RESET` keycode, or short RST to GND quickly (you only have 7 seconds to flash once it enters) 2. Wait for the OS to detect the device -4. Flash a .hex file -5. Wait for the device to reset automatically +3. Flash a .hex file +4. Wait for the device to reset automatically or @@ -106,5 +106,28 @@ Flashing sequence: 1. Press the `RESET` keycode, or short RST to GND quickly (you only have 7 seconds to flash once it enters) 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) +3. Flash a .hex file +4. Reset the device into application mode (may be done automatically) + +## STM32 + +All STM32 chips come preloaded with a factory bootloader that cannot be modified nor deleted. Some STM32 chips have bootloaders that do not come with USB programming (e.g. STM32F103) but the process is still the same. + +At the moment, no `BOOTLOADER` variable is needed on `rules.mk` for STM32. + +Compatible flashers: + +* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI) +* [dfu-util](https://github.com/Stefan-Schmidt/dfu-util) / `:dfu-util` (recommended command line) + +Flashing sequence: + +1. Enter the bootloader using any of the following methods: + * Tap the `RESET` keycode (may not work on STM32F042 devices) + * If a reset circuit is present, tap the RESET button + * Otherwise, you need to bridge BOOT0 to VCC (via BOOT0 button or bridge), short RESET to GND (via RESET button or bridge), and then let go of the BOOT0 bridge +2. Wait for the OS to detect the device +3. Flash a .bin file + * You will receive a warning about the DFU signature; Just ignore it +4. Reset the device into application mode (may be done automatically) + * If you are building from command line (e.g. `make planck/rev6:default:dfu-util`), make sure that `:leave` is passed to the `DFU_ARGS` variable inside your `rules.mk` (e.g. `DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave`) so that your device resets after flashing -- cgit v1.2.3 From 4636f0f623c71f1eda8628cbae4784fe08a8faf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 6 Nov 2018 06:34:54 +0100 Subject: Remove ALTG(kc) as it's misleading and is not actually AltGr (#4338) * Remove ALTG(kc) as it's misleading and is not actually AltGr * Add temporary alias for ALGR in keyboards/planck/keymaps/pevecyan/keymap.c --- docs/feature_advanced_keycodes.md | 1 - docs/keycodes.md | 1 - 2 files changed, 2 deletions(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index f2e4909d86..f9a5c39806 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -73,7 +73,6 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | |`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | -|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` | |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | |`LCA(kc)` | |Hold Left Control and Alt and press `kc` | diff --git a/docs/keycodes.md b/docs/keycodes.md index 6676bb53c9..e5d35b2b4a 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -333,7 +333,6 @@ This is a reference only. Each group of keys links to the page documenting their |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | |`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | -|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` | |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | |`LCA(kc)` | |Hold Left Control and Alt and press `kc` | -- cgit v1.2.3 From 672926562519c1ee7370b3ef188c11525de326e5 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 5 Nov 2018 21:35:16 -0800 Subject: Clarify the Mod Tap defines in documentation (#4352) * Fix up Mod Tap settings keys * Change link names * permissive hold wordsmith Co-Authored-By: drashna * ignore mod tap wordsmithing Co-Authored-By: drashna * grammar fix Co-Authored-By: drashna * wordsmithing Co-Authored-By: drashna * word smithing Co-Authored-By: drashna --- docs/config_options.md | 9 +++--- docs/feature_advanced_keycodes.md | 62 +++++++++++++++++++++++++++++---------- 2 files changed, 52 insertions(+), 19 deletions(-) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index 19861c9d23..c4921c21d7 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -132,14 +132,15 @@ If you define these options you will enable the associated feature, which may in * `#define TAPPING_TOGGLE 2` * how many taps before triggering the toggle * `#define PERMISSIVE_HOLD` - * makes tap and hold keys work better for fast typers who don't want tapping term set above 500 + * makes tap and hold keys trigger the hold if another key is pressed before releasing, even if it hasn't hit the `TAPPING_TERM` * See [Permissive Hold](feature_advanced_keycodes.md#permissive-hold) for details * `#define IGNORE_MOD_TAP_INTERRUPT` - * makes it possible to do rolling combos (zx) with keys that convert to other keys on hold - * See [Mod tap interrupt](feature_advanced_keycodes.md#mod-tap-interrupt) for details + * makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the `TAPPING_TERM` for both keys. + * See [Mod tap interrupt](feature_advanced_keycodes.md#ignore-mod-tap-interrupt) for details * `#define TAPPING_FORCE_HOLD` * makes it possible to use a dual role key as modifier shortly after having been tapped - * See [Hold after tap](feature_advanced_keycodes.md#hold-after-tap) + * See [Hold after tap](feature_advanced_keycodes.md#tapping-force-hold) + * Breaks any Tap Toggle functionality (`TT` or the One Shot Tap Toggle) * `#define LEADER_TIMEOUT 300` * how long before the leader key times out * `#define ONESHOT_TIMEOUT 300` diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index f9a5c39806..bb5cb7419b 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -170,30 +170,56 @@ As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new #define PERMISSIVE_HOLD ``` -This makes it easier for fast typists to use dual-function keys. Without this, if you let go of a held key inside the tapping term, it won't register. +This makes tap and hold keys (like Mod Tap) work better for fast typist, or for high `TAPPING_TERM` settings. -Example: (Tapping Term = 200ms) +If you press a Mod Tap key, tap another key (press and release) and then release the Mod Tap key, all within the tapping term, it will output the "tapping" function for both keys. -- SHFT_T(KC_A) Down -- KC_X Down -- KC_X Up -- SHFT_T(KC_A) Up +For Instance: + +- `SHFT_T(KC_A)` Down +- `KC_X` Down +- `KC_X` Up +- `SHFT_T(KC_A)` Up + +Normally, if you do all this within the `TAPPING_TERM` (default: 200ms) this will be registered as `ax` by the firmware and host system. With permissive hold enabled, this modifies how this is handled by considering the Mod Tap keys as a Mod if another key is tapped, and would registered as `X` (`SHIFT`+`x`). + +?> If you have `Ignore Mod Tap Interrupt` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. + +# Ignore Mod Tap Interrupt + +To enable this setting, add this to your `config.h`: + +```c +#define IGNORE_MOD_TAP_INTERRUPT +``` -With defaults, if above is typed within tapping term, this will emit `ax`. With permissive hold, if above is typed within tapping term, this will emit `X` (so, Shift+X). +Similar to Permissive Hold, this alters how the firmware processes input for fast typist. If you press a Mod Tap key, press another key, release the Mod Tap key, and then release the normal key, it would normally output the "tapping" function for both keys. This may not be desirable for rolling combo keys. -# Mod tap interrupt +Setting `Ignore Mod Tap Interrupt` requires holding both keys for the `TAPPING_TERM` to trigger the hold function (the mod). -When a dual role key used for a modifier is quickly followed by another keys, it is interpreted as held even before the tapping term elapsed. This is a problem if a key is used for example inside a rolling combo because the second key will be pressed before the first key is released. +For Instance: -For example, when trying to type the rolling combo "zx" and z being configured to send Ctrl when hold, z rapidly followed by x actually sends Ctrl-x. That's bad. +- `SHFT_T(KC_A)` Down +- `KC_X` Down +- `SHFT_T(KC_A)` Up +- `KC_X` Up -You can disable this behavior by defining `IGNORE_MOD_TAP_INTERRUPT` in `config.h`. +Normally, this would send `X` (`SHIFT`+`x`). With `Ignore Mod Tap Interrupt` enabled, holding both keys are required for the `TAPPING_TERM` to register the hold action. A quick tap will output `ax` in this case, while a hold on both will still output `X` (`SHIFT`+`x`). -Note that this only concerns modifiers and not layer switching keys. -# Hold after tap +?> __Note__: This only concerns modifiers and not layer switching keys. -When the user holds a key after tap, this repeats the tapped key rather to hold a modifier key. This allows to use auto repeat for the tapped key. If you prefer to hold a modifier instead, define `TAPPING_FORCE_HOLD` in `config.h`. +?> If you have `Permissive Hold` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. + +# Tapping Force Hold + +To enable `tapping force hold`, add the following to your `config.h`: + +```c +#define TAPPING_FORCE_HOLD +``` + +When the user holds a key after tap, this repeats the tapped key rather to hold a modifier key. This allows to use auto repeat for the tapped key. Example: @@ -211,6 +237,12 @@ With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allo # Retro Tapping +To enable `retro tapping`, add the following to your `config.h`: + +```c +#define RETRO_TAPPING +``` + Holding and releasing a dual function key without pressing another key will result in nothing happening. With retro tapping enabled, releasing the key without pressing another will send the original keycode even if it is outside the tapping term. -For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`. +For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With this enabled, it will send `KC_SPACE` instead. -- cgit v1.2.3 From 6e44f94f21ef45865eb8820923d4c9c696f08133 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 5 Nov 2018 21:38:18 -0800 Subject: Add EEPROM_RESET keycode to core code (#4234) * Add EEPROM Reset keycode * Add keycode to docs * Move EEPROM Reset code to the end of the enum * Cleanup and naming change --- docs/quantum_keycodes.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md index 1d7fc0e127..90192e6324 100644 --- a/docs/quantum_keycodes.md +++ b/docs/quantum_keycodes.md @@ -8,15 +8,16 @@ On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are ## QMK Keycodes -|Key |Aliases |Description | -|-------------|-----------|---------------------------------------------------------------------| -|`RESET` | |Put the keyboard into DFU mode for flashing | -|`DEBUG` | |Toggle debug mode | -|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| -|`KC_LSPO` | |Left Shift when held, `(` when tapped | -|`KC_RSPC` | |Right Shift when held, `)` when tapped | -|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | -|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | -|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | -|`M(n)` | |Call macro `n` | -|`MACROTAP(n)`| |Macro-tap `n` idk FIXME | +|Key |Aliases |Description | +|---------------|-----------|---------------------------------------------------------------------| +|`RESET` | |Put the keyboard into DFU mode for flashing | +|`DEBUG` | |Toggle debug mode | +|`EEPROM_RESET` |`EEP_RST` |Resets EEPROM state by reinitializing it | +|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| +|`KC_LSPO` | |Left Shift when held, `(` when tapped | +|`KC_RSPC` | |Right Shift when held, `)` when tapped | +|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | +|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | +|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | +|`M(n)` | |Call macro `n` | +|`MACROTAP(n)` | |Macro-tap `n` idk FIXME | -- cgit v1.2.3 From 26a201e6875e82c623c136eccf937b511199c701 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 28 Oct 2018 09:18:41 -0700 Subject: fix example to reflect caveat --- docs/feature_combo.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/feature_combo.md b/docs/feature_combo.md index 5bb73ef106..05ffc0d725 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -44,15 +44,15 @@ For a more complicated implementation, you can use the `process_combo_event` fun ```c enum combo_events { ZC_COPY, - ZV_PASTE + XV_PASTE }; const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END}; -const uint16_t PROGMEM paste_combo[] = {KC_Z, KC_V, COMBO_END}; +const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END}; combo_t key_combos[COMBO_COUNT] = { [ZC_COPY] = COMBO_ACTION(copy_combo), - [ZV_PASTE] = COMBO_ACTION(paste_combo), + [XV_PASTE] = COMBO_ACTION(paste_combo), }; void process_combo_event(uint8_t combo_index, bool pressed) { @@ -66,7 +66,7 @@ void process_combo_event(uint8_t combo_index, bool pressed) { } break; - case ZV_PASTE: + case XV_PASTE: if (pressed) { register_code(KC_LCTL); register_code(KC_V); @@ -78,7 +78,7 @@ void process_combo_event(uint8_t combo_index, bool pressed) { } ``` -This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit Z and V. But you could change this to do stuff like change layers, play sounds, or change settings. +This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit X and V. But you could change this to do stuff like change layers, play sounds, or change settings. ## Additional Configuration -- cgit v1.2.3 From 4a033641dff0cbf430a5005d6d6c1e5b8c4b540c Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 28 Oct 2018 09:29:18 -0700 Subject: Update Features page to reflect all of the features linked in the sidebar/summary --- docs/features.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/features.md b/docs/features.md index 537e1061cd..43d972e689 100644 --- a/docs/features.md +++ b/docs/features.md @@ -8,13 +8,17 @@ QMK has a staggering number of features for building your keyboard. It can take * [Auto Shift](feature_auto_shift.md) - Tap for the normal key, hold slightly longer for its shifted state. * [Backlight](feature_backlight.md) - LED lighting support for your keyboard. * [Bootmagic](feature_bootmagic.md) - Adjust the behavior of your keyboard using hotkeys. +* [Combos](feature_combos.md) - Custom actions for multiple key holds. +* [Command](feature_command.md) - Runtime version of bootmagic (Formerly known as "Magic"). * [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself. +* [Grave Escape](feature_grave_esc.md) - Lets you use a single key for Esc and Grave. * [HD44780 LCD Display](feature_hd44780.md) - Support for LCD character displays using the HD44780 standard. * [Key Lock](feature_key_lock.md) - Lock a key in the "down" state. * [Layouts](feature_layouts.md) - Use one keymap with any keyboard that supports your layout. * [Leader Key](feature_leader_key.md) - Tap the leader key followed by a sequence to trigger custom behavior. * [Macros](feature_macros.md) - Send multiple key presses when pressing only one physical key. * [Mouse keys](feature_mouse_keys.md) - Control your mouse pointer from your keyboard. +* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) - Sticky Keys, lets hit a key rather than holding it. * [Pointing Device](feature_pointing_device.md) - Framework for connecting your custom pointing device to your keyboard. * [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard. * [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard. -- cgit v1.2.3 From 3dec80b7746ee61e4c9e67da817635828dd86b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 6 Nov 2018 21:21:44 +0100 Subject: Improve wording, punctuation and capitalization in newbs_getting_started guide (#4342) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improve wording, punctuation and capitalization in newbs_getting_started guide Also add some links * Update example build command output Co-Authored-By: vomindoraan * Replace occurrences of "layout" with "keymap" Co-Authored-By: MechMerlin <30334081+mechmerlin@users.noreply.github.com> * Explicitly instruct users to open an MSYS2 MinGW 64-bit terminal * MSYS2 Console → MSYS2 MinGW * Replace thin spaces with regular spaces --- docs/newbs_getting_started.md | 78 +++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 40 deletions(-) (limited to 'docs') diff --git a/docs/newbs_getting_started.md b/docs/newbs_getting_started.md index 2181542856..276c7fec32 100644 --- a/docs/newbs_getting_started.md +++ b/docs/newbs_getting_started.md @@ -1,99 +1,97 @@ # Introduction -Your computer keyboard has a processor inside of it, not unlike the one inside your computer. This processor runs software that is responsible for detecting button presses and sending reports about the state of the keyboard when they are pressed or released. QMK fills the role of that software, detecting button presses and passing that information on to the host computer. When you build your custom layout you are creating the equivalent of an .exe for your keyboard. +Your computer keyboard has a processor inside of it, not unlike the one inside your computer. This processor runs software that is responsible for detecting button presses and sending reports about the state of the keyboard when buttons are pressed or released. QMK fills the role of that software, detecting button presses and passing that information on to the host computer. When you build your custom keymap, you are creating the equivalent of an executable program for your keyboard. -QMK tries to put a lot of power into your hands by making easy things easy, and hard things possible. You don't have to know how to program to create powerful layouts, you only have to follow a few simple syntax rules. +QMK tries to put a lot of power into your hands by making easy things easy, and hard things possible. You don't have to know how to program to create powerful keymaps — you only have to follow a few simple syntax rules. # Getting Started -Before you can build keymaps you need to install some software and setup your build environment. This only has to be done one time no matter how many keyboards you want to compile firmware for. +Before you can build keymaps, you need to install some software and set up your build environment. This only has to be done once no matter how many keyboards you plan to compile firmware for. ## Download Software ### Text Editor -You'll need a program that can edit and save **plain text** files. If you are on Windows you can make due with Notepad, and on Linux you can use Gedit, both of which are simple but functional text editors. On macOS be careful with TextEdit.app, it will not save plain text files unless you make sure to select "Make Plain text" from the "Format" menu, or you can use another program such as Sublime Text. +You'll need a program that can edit and save **plain text** files. If you're on Windows you can make do with Notepad, and on Linux you can use gedit. Both of these are simple but functional text editors. On macOS, be careful with the default TextEdit app: it will not save plain text files unless you explicitly select _Make Plain Text_ from the _Format_ menu. + +You can also download and install a dedicated text editor like [Sublime Text](https://www.sublimetext.com/) or [VS Code](https://code.visualstudio.com/). This is probably the best way to go regardless of platform, as these programs are specifically made for editing code. ?> Not sure which text editor to use? Laurence Bradford wrote [a great introduction](https://learntocodewith.me/programming/basics/text-editors/) to the subject. ### QMK Toolbox -QMK Toolbox is an optional graphical Windows and macOS program that allows you to both program and debug your custom keyboard. You will likely prefer it to easily flash your keyboard and receive the debugging messages that your keyboard will print. - -Download the files from the links below: - -For Windows: "qmk_toolbox.exe" or "qmk_toolbox_install.exe" (with installer) +QMK Toolbox is an optional graphical program for Windows and macOS that allows you to both program and debug your custom keyboard. You will likely find it invaluable for easily flashing your keyboard and viewing debug messages that it prints. -For Mac: "QMK.Toolbox.app.zip" or "QMK.Toolbox.pkg" (with installer) +[Download the latest release here.](https://github.com/qmk/qmk_toolbox/releases/latest) -* [Newest Release](https://github.com/qmk/qmk_toolbox/releases/latest) -* [Source Code](https://github.com/qmk/qmk_toolbox/) +* For Windows: `qmk_toolbox.exe` (portable) or `qmk_toolbox_install.exe` (installer) +* For macOS: `QMK.Toolbox.app.zip` (portable) or `QMK.Toolbox.pkg` (installer) -## Environment Setup +## Set Up Your Environment -We've tried to make QMK as easy to setup as possible. You only have to prepare your Linux or Unix environment and let QMK install the rest. +We've tried to make QMK as easy to set up as possible. You only have to prepare your Linux or Unix environment, then let QMK install the rest. -?> If you haven't worked with the Linux/Unix command line before there are a few basic concepts and commands you should learn. These resources will teach you enough to work with QMK:
+?> If you haven't worked with the Linux/Unix command line before, there are a few basic concepts and commands you should learn. These resources will teach you enough to be able to work with QMK:
[Must Know Linux Commands](https://www.guru99.com/must-know-linux-commands.html)
[Some Basic Unix Commands](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html) ### Windows -You will need to install msys2 and git. +You will need to install MSYS2 and Git. -* Follow the installation instructions on the msys2 homepage: http://www.msys2.org -* Close any open msys2 terminals, and open a new terminal -* Install git by running this command: `pacman -S git` +* Follow the installation instructions on the [MSYS2 homepage](http://www.msys2.org). +* Close any open MSYS2 terminals and open a new MSYS2 MinGW 64-bit terminal. +* Install Git by running this command: `pacman -S git`. ### macOS -You will need to install homebrew. Follow the instructions on the homebrew homepage: https://brew.sh +You will need to install Homebrew. Follow the instructions on the [Homebrew homepage](https://brew.sh). -After homebrew is installed continue with "Download QMK", following step "Setup QMK" runs a script that will install other packages. +After Homebrew is installed, continue with _Set Up QMK_. In that step you will run a script that will install other packages. ### Linux -You will need to install git. It's extremely likely you already have it, but if not one of the following commands should install it: +You will need to install Git. It's very likely that you already have it, but if not, one of the following commands should install it: -* Debian/Ubuntu/Devuan: `apt-get install git` -* Fedora/Redhat/Centos: `yum install git` +* Debian / Ubuntu / Devuan: `apt-get install git` +* Fedora / Red Hat / CentOS: `yum install git` * Arch: `pacman -S git` -## Download QMK +?> Docker is also an option on all platforms. [Click here for details.](getting_started_build_tools.md#docker) -Once you have setup your Linux/Unix environment you are ready to download QMK. We will do this by using git to "clone" the QMK repository. Open a Terminal or MSYS2 Console window and leave it open for the remainder of this guide. Inside that window run these two commands: +## Set Up QMK + +Once you have set up your Linux/Unix environment, you are ready to download QMK. We will do this by using Git to "clone" the QMK repository. Open a Terminal or MSYS2 MinGW window and leave it open for the remainder of this guide. Inside that window run these two commands: git clone https://github.com/qmk/qmk_firmware.git cd qmk_firmware -?> If you already know [how to use GitHub](getting_started_github.md) we recommend you create and clone your own fork instead. If you don't know what that means you can safely ignore this message. - -## Setup QMK +?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create and clone your own fork instead. If you don't know what that means, you can safely ignore this message. -QMK comes with a script to help you setup the rest of what you'll need. You should run it now by typing in this command: +QMK comes with a script to help you set up the rest of what you'll need. You should run it now by typing in this command: - ./util/qmk_install.sh + util/qmk_install.sh ## Test Your Build Environment -Now that your QMK build environment is setup you can build a firmware for your keyboard. Start by trying to build the default layout for your keyboard. You should be able to do that with a command in this format: +Now that your QMK build environment is set up, you can build a firmware for your keyboard. Start by trying to build the keyboard's default keymap. You should be able to do that with a command in this format: make :default -For example, to build a firmware for a Clueboard 66% use: +For example, to build a firmware for a Clueboard 66% you would use: make clueboard/66/rev3:default When it is done you should have a lot of output that ends similar to this: ``` -Linking: .build/clueboard_66_rev2_default.elf [OK] -Creating load file for flashing: .build/clueboard_66_rev2_default.hex [OK] -Copying clueboard_66_rev2_default.hex to qmk_firmware folder [OK] -Checking file size of clueboard_66_rev2_default.hex [OK] - * File size is fine - 25174/28672 +Linking: .build/clueboard_66_rev3_default.elf [OK] +Creating load file for flashing: .build/clueboard_66_rev3_default.hex [OK] +Copying clueboard_66_rev3_default.hex to qmk_firmware folder [OK] +Checking file size of clueboard_66_rev3_default.hex [OK] + * The firmware size is fine - 26356/28672 (2316 bytes free) ``` -## Creating Your Layout +# Creating Your Keymap -Now you are ready to create your own personal layout. Move on to [Building Your First Firmware](newbs_building_firmware.md) for that. +You are now ready to create your own personal keymap! Move on to [Building Your First Firmware](newbs_building_firmware.md) for that. -- cgit v1.2.3 From 94f58322ac3dde1a4694733c51a44c4d24ec3fc0 Mon Sep 17 00:00:00 2001 From: Frank Tackitt Date: Wed, 7 Nov 2018 09:25:18 -0700 Subject: Configurable Rainbow Swirl range (#4376) * Configurable Rainbow Swirl range This allows tweaking of the rainbow effect to get different effects on keyboards with varied LED layouts. We found the value 1950 works on the RGBKB.net Sol to get a cool striped effect across the keyboard. * Document RGBLIGHT_RAINBOW_SWIRL_RANGE * Better wording for the documentation --- docs/feature_rgblight.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index a2820347de..0205ebe91a 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -122,6 +122,7 @@ The following options can be used to tweak the various animations: |`RGBLIGHT_EFFECT_KNIGHT_LED_NUM` |`RGBLED_NUM` |The number of LEDs to have the "Knight" animation travel | |`RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL`|`1000` |How long to wait between light changes for the "Christmas" animation, in milliseconds| |`RGBLIGHT_EFFECT_CHRISTMAS_STEP` |`2` |The number of LEDs to group the red/green colors by for the "Christmas" animation | +|`RGBLIGHT_RAINBOW_SWIRL_RANGE` |`360` |Range adjustment for the rainbow swirl effect to get different swirls | You can also modify the speeds that the different modes animate at: -- cgit v1.2.3 From 408361402385ea938575956e9368b5f373edc629 Mon Sep 17 00:00:00 2001 From: yiancar Date: Sat, 10 Nov 2018 12:26:39 -0800 Subject: I2C driver docs (#4298) * I2C driver docs - Added I2C driver docs. - Changed arm master i2c driver to have a weak i2c_init as it is impossible to account for all possible port configuration in the STM32 world. * Update docs/i2c_driver.md Co-Authored-By: yiancar * Update docs/i2c_driver.md Co-Authored-By: yiancar * Update docs/i2c_driver.md Co-Authored-By: yiancar * Update docs/i2c_driver.md Co-Authored-By: yiancar * GPIO release fix --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/i2c_driver.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 docs/i2c_driver.md (limited to 'docs') diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 2c57380122..67e81422a1 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -79,6 +79,7 @@ * [Hand Wiring Guide](hand_wire.md) * [ISP Flashing Guide](isp_flashing_guide.md) * [ARM Debugging Guide](arm_debugging.md) + * [I2C Driver](i2c_driver.md) * For a Deeper Understanding * [How Keyboards Work](how_keyboards_work.md) diff --git a/docs/_summary.md b/docs/_summary.md index 2c57380122..67e81422a1 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -79,6 +79,7 @@ * [Hand Wiring Guide](hand_wire.md) * [ISP Flashing Guide](isp_flashing_guide.md) * [ARM Debugging Guide](arm_debugging.md) + * [I2C Driver](i2c_driver.md) * For a Deeper Understanding * [How Keyboards Work](how_keyboards_work.md) diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md new file mode 100644 index 0000000000..f69eb5a9da --- /dev/null +++ b/docs/i2c_driver.md @@ -0,0 +1,83 @@ +# I2C Master Driver + +The I2C Master drivers used in QMK have a set of common functions to allow portability between MCUs. + +## Available functions + +|Function |Description | +|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +|`void i2c_init(void);` |Initializes the I2C driver. This function should be called once before any transaction is initiated. | +|`uint8_t i2c_start(uint8_t address);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. | +|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. | +|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. | +|`uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. | +|`uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. | +|`uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_receive` function but `regaddr` sets from where in the slave the data will be read. | +|`uint8_t i2c_stop(uint16_t timeout);` |Stops the I2C driver. | + +### Function Return + +All the above functions, except `void i2c_init(void);` return the following truth table: + +|Return Value |Description | +|---------------|---------------------------------------------------| +|0 |Operation executed successfully. | +|-1 |Operation failed. | +|-2 |Operation timed out. | + + +## AVR + +### Configuration + +The following defines can be used to configure the I2C master driver. + +|Variable |Description |Default| +|------------------|---------------------------------------------------|-------| +|`#F_SCL` |Clock frequency in Hz |400KHz | +|`#Prescaler` |Divides master clock to aid in I2C clock selection |1 | + +AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required. + +## ARM + +For ARM the Chibios I2C HAL driver is under the hood. +This section assumes an STM32 MCU. + +### Configuration + +The configuration for ARM MCUs can be quite complex as often there are multiple I2C drivers which can be assigned to a variety of ports. + +Firstly the `mcuconf.h` file must be setup to enable the necessary hardware drivers. + +|Variable |Description |Default| +|------------------------------|------------------------------------------------------------------------------------|-------| +|`#STM32_I2C_USE_XXX` |Enable/Disable the hardware driver XXX (each driver should be explicitly listed) |FALSE | +|`#STM32_I2C_BUSY_TIMEOUT` |Time in ms until the I2C command is aborted if no response is received |50 | +|`#STM32_I2C_XXX_IRQ_PRIORITY` |Interrupt priority for hardware driver XXX (THIS IS AN EXPERT SETTING) |10 | +|`#STM32_I2C_USE_DMA` |Enable/Disable the ability of the MCU to offload the data transfer to the DMA unit |TRUE | +|`#STM32_I2C_XXX_DMA_PRIORITY` |Priority of DMA unit for hardware driver XXX (THIS IS AN EXPERT SETTING) |1 | + +Secondly, in the `halconf.h` file, `#define HAL_USE_I2C` must be set to `TRUE`. This allows ChibiOS to load its I2C driver. + +Lastly, we need to assign the correct GPIO pins depending on the I2C hardware driver we want to use. + +By default the I2C1 hardware driver is assumed to be used. If another hardware driver is used, `#define I2C_DRIVER I2CDX` should be added to the `config.h` file with X being the number of hardware driver used. For example is I2C3 is enabled, the `config.h` file should contain `#define I2C_DRIVER I2CD3`. This aligns the QMK I2C driver with the Chibios I2C driver. + +STM32 MCUs allows a variety of pins to be configured as I2C pins depending on the hardware driver used. By default B6 and B7 are set to I2C. + +This can be changed by declaring the `i2c_init` function which intentionally has a weak attribute. Please consult the datasheet of your MCU for the available GPIO configurations. The following is an example initialization function: + +```C +void i2c_init(void) +{ + setPinInput(B6); // Try releasing special pins for a short time + setPinInput(B7); + chThdSleepMilliseconds(10); // Wait for the release to happen + + palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); // Set B6 to I2C function + palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); // Set B7 to I2C function +} +``` + + -- cgit v1.2.3 From b1e74aee43596e2601248b0a78b2c54c897ce78b Mon Sep 17 00:00:00 2001 From: Michael Kaylan <1063516+kaylanm@users.noreply.github.com> Date: Mon, 12 Nov 2018 11:20:56 -0500 Subject: Make sure that avr-gcc@7 gets linked into the path on MacOS. --- docs/faq_build.md | 2 +- docs/getting_started_build_tools.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/faq_build.md b/docs/faq_build.md index 465a283aef..14c61a1e99 100644 --- a/docs/faq_build.md +++ b/docs/faq_build.md @@ -126,5 +126,5 @@ For now, you need to rollback avr-gcc to 7 in brew. ``` brew uninstall --force avr-gcc brew install avr-gcc@7 -brew link avr-gcc@7 +brew link --force avr-gcc@7 ``` diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index 587dece4a1..67bbe54344 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -57,6 +57,7 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands: brew tap PX4/homebrew-px4 brew update brew install avr-gcc@7 + brew link --force avr-gcc@7 brew install dfu-programmer brew install dfu-util brew install gcc-arm-none-eabi -- cgit v1.2.3 From 2dc14d1cb3755f01f36b35beeee3e31957189f76 Mon Sep 17 00:00:00 2001 From: TheOneTrueTrench <38593283+TheOneTrueTrench@users.noreply.github.com> Date: Tue, 13 Nov 2018 00:46:01 +0000 Subject: Fixed incorrect link to feature_combo.md in features.md docs file. Was linked to feature_combos.md, but _sidebar.md, _summary.md, and config_options.md all link to feature_combo.md. Assuming that it should not be pluralized. (#4411) --- docs/features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/features.md b/docs/features.md index 43d972e689..85f4cf6e00 100644 --- a/docs/features.md +++ b/docs/features.md @@ -8,7 +8,7 @@ QMK has a staggering number of features for building your keyboard. It can take * [Auto Shift](feature_auto_shift.md) - Tap for the normal key, hold slightly longer for its shifted state. * [Backlight](feature_backlight.md) - LED lighting support for your keyboard. * [Bootmagic](feature_bootmagic.md) - Adjust the behavior of your keyboard using hotkeys. -* [Combos](feature_combos.md) - Custom actions for multiple key holds. +* [Combos](feature_combo.md) - Custom actions for multiple key holds. * [Command](feature_command.md) - Runtime version of bootmagic (Formerly known as "Magic"). * [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself. * [Grave Escape](feature_grave_esc.md) - Lets you use a single key for Esc and Grave. -- cgit v1.2.3 From caa293a8f77447891b02d5f8c91b209f9a082cc9 Mon Sep 17 00:00:00 2001 From: Junya Ogura <5352+juno@users.noreply.github.com> Date: Wed, 14 Nov 2018 01:27:46 +0900 Subject: Remove duplicate row from Available functions table in i2c_driver doc (#4416) --- docs/i2c_driver.md | 1 - 1 file changed, 1 deletion(-) (limited to 'docs') diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md index f69eb5a9da..ea24dc64f3 100644 --- a/docs/i2c_driver.md +++ b/docs/i2c_driver.md @@ -8,7 +8,6 @@ The I2C Master drivers used in QMK have a set of common functions to allow porta |------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |`void i2c_init(void);` |Initializes the I2C driver. This function should be called once before any transaction is initiated. | |`uint8_t i2c_start(uint8_t address);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. | -|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. | |`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. | |`uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. | |`uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. | -- cgit v1.2.3 From 911b2d07565fa0c6edb49a198f4420391f7f33f3 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Daisuke Date: Wed, 22 Aug 2018 23:56:24 +0900 Subject: Docs: Fix descriptions of KC_INT1 and KC_INT3 --- docs/keycodes.md | 4 ++-- docs/keycodes_basic.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/keycodes.md b/docs/keycodes.md index e5d35b2b4a..592b52ec7b 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -141,9 +141,9 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_LOCKING_SCROLL` |`KC_LSCR` |Locking Scroll Lock | |`KC_KP_COMMA` |`KC_PCMM` |Keypad `,` | |`KC_KP_EQUAL_AS400` | |Keypad `=` on AS/400 keyboards | -|`KC_INT1` |`KC_RO` |JIS `\` and | | +|`KC_INT1` |`KC_RO` |JIS `\` and `_` | |`KC_INT2` |`KC_KANA` |JIS Katakana/Hiragana | -|`KC_INT3` |`KC_JYEN` |JIS `¥` | +|`KC_INT3` |`KC_JYEN` |JIS `¥` and | | |`KC_INT4` |`KC_HENK` |JIS Henkan | |`KC_INT5` |`KC_MHEN` |JIS Muhenkan | |`KC_INT6` | |JIS Numpad `,` | diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 82e94aa5e9..ada9cc0e5a 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -123,9 +123,9 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07 |Key |Aliases |Description | |----------|---------|-------------------------------| -|`KC_INT1` |`KC_RO` |JIS `\` and || +|`KC_INT1` |`KC_RO` |JIS `\` and `_` | |`KC_INT2` |`KC_KANA`|JIS Katakana/Hiragana | -|`KC_INT3` |`KC_JYEN`|JIS `¥` | +|`KC_INT3` |`KC_JYEN`|JIS `¥` and || |`KC_INT4` |`KC_HENK`|JIS Henkan | |`KC_INT5` |`KC_MHEN`|JIS Muhenkan | |`KC_INT6` | |JIS Numpad `,` | -- cgit v1.2.3 From f7fcba329dbd659a4bb37acdf7e2dc24204a81c8 Mon Sep 17 00:00:00 2001 From: James Osborn Date: Wed, 14 Nov 2018 15:33:46 +0000 Subject: Fixed Unicode Support heading (#4425) Previously, Unicode Support heading appeared as the last row in the Swap Hands table. --- docs/keycodes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/keycodes.md b/docs/keycodes.md index 592b52ec7b..30fe60278f 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -459,6 +459,7 @@ This is a reference only. Each group of keys links to the page documenting their |`SH_MOFF` |Momentarily turns off swap. | |`SH_TG` |Toggles swap on and off with every key press. | |`SH_TT` |Toggles with a tap; momentary when held. | + ## [Unicode Support](feature_unicode.md) |Key |Aliases| | -- cgit v1.2.3 From 0cda2f43e2c95fe5dd440e6391ae807f508b040b Mon Sep 17 00:00:00 2001 From: Phillip Tennen Date: Wed, 14 Nov 2018 16:45:46 +0100 Subject: Backlight status functions (#4259) * add functions to set specific backlight state * add function to query backlight state * update documentation with new backlight functions * Update tmk_core/common/backlight.c Co-Authored-By: codyd51 * Update tmk_core/common/backlight.h Co-Authored-By: codyd51 * update docs for is_backlight_enabled() name change --- docs/feature_backlight.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 7bb7e03a89..f7a35406c7 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -54,14 +54,17 @@ In this handler, the value of an incrementing counter is mapped onto a precomput ## Backlight Functions -|Function |Description | -|----------|----------------------------------------------------------| -|`backlight_toggle()` |Turn the backlight on or off | -|`backlight_step()` |Cycle through backlight levels | -|`backlight_increase()` |Increase the backlight level | -|`backlight_decrease()` |Decrease the backlight level | -|`backlight_level(x)` |Sets the backlight level to specified level | -|`get_backlight_level()`|Return the current backlight level | +|Function |Description | +|----------|-----------------------------------------------------------| +|`backlight_toggle()` |Turn the backlight on or off | +|`backlight_enable()` |Turn the backlight on | +|`backlight_disable()` |Turn the backlight off | +|`backlight_step()` |Cycle through backlight levels | +|`backlight_increase()` |Increase the backlight level | +|`backlight_decrease()` |Decrease the backlight level | +|`backlight_level(x)` |Sets the backlight level to specified level | +|`get_backlight_level()` |Return the current backlight level | +|`is_backlight_enabled()`|Return whether the backlight is currently on | ### Backlight Breathing Functions -- cgit v1.2.3 From d8f090e5592fd5b6fde35ae36e36f2473c716312 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 14 Nov 2018 18:32:28 -0800 Subject: Docs: Supporting a keyboard in the QMK Configurator (#4396) * Docs: Configurator Support * Minor updates * Updated keyboard.h example to use #pragma once per @drashna https://github.com/qmk/qmk_firmware/pull/4396#discussion_r232140934 * Add link to doc under Reference section Added to _sidebar.md and _summary.md * Changed doc title; minor tweaks Re-titled the doc as "Supporting Your Keyboard in QMK Configurator". Made some minor changes to the keyboard.h examples. * Added tags object to JSON example --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/reference_configurator_support.md | 195 +++++++++++++++++++++++++++++++++ 3 files changed, 197 insertions(+) create mode 100644 docs/reference_configurator_support.md (limited to 'docs') diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 67e81422a1..1fb5398d93 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -39,6 +39,7 @@ * [Glossary](reference_glossary.md) * [Unit Testing](unit_testing.md) * [Useful Functions](ref_functions.md) + * [Configurator Support](reference_configurator_support.md) * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) diff --git a/docs/_summary.md b/docs/_summary.md index 67e81422a1..1fb5398d93 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -39,6 +39,7 @@ * [Glossary](reference_glossary.md) * [Unit Testing](unit_testing.md) * [Useful Functions](ref_functions.md) + * [Configurator Support](reference_configurator_support.md) * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) diff --git a/docs/reference_configurator_support.md b/docs/reference_configurator_support.md new file mode 100644 index 0000000000..a20a6c9adb --- /dev/null +++ b/docs/reference_configurator_support.md @@ -0,0 +1,195 @@ +# Supporting Your Keyboard in QMK Configurator + +This page covers how to properly support keyboards in the [QMK Configurator](https://config.qmk.fm/). + + +## How the Configurator Understands Keyboards + +To understand how the Configurator understands keyboards, first one must understand layout macros. For this exercise, we're going to imagine a 17-key numpad PCB, which we're going to call `numpad`. + +``` +┌───┬───┬───┬───┐ +│NLk│ / │ * │ - │ +├───┼───┼───┼───┤ +│7 │8 │9 │ + │ +├───┼───┼───┤ │ +│4 │5 │6 │ │ +├───┼───┼───┼───┤ +│1 │2 │3 │Ent│ +├───┴───┼───┤ │ +│0 │ . │ │ +└───────┴───┴───┘ +``` + +?> For more on layout macros, see [Understanding QMK: Matrix Scanning](understanding_qmk.md?id=matrix-scanning) and [Understanding QMK: Matrix to Physical Layout Map](understanding_qmk.md?id=matrix-to-physical-layout-map). + +The Configurator's API reads the keyboard's `.h` file from `qmk_firmware/keyboards//.h`. For our numpad, this file would be `qmk_firmware/keyboards/numpad/numpad.h`: + +```c +#pragma once + +#define LAYOUT( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k33, \ + k40, k42 \ + ) { \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, KC_NO }, \ + { k30, k31, k32, k33 }, \ + { k40, KC_NO, k42, KC_NO } \ +} +``` + +QMK uses `KC_NO` to designate places in the switch matrix where there is no switch. Sometimes, `XXX`, `___` or `____` are used as shorthand to make this section easier to read if it needs to be debugged. This is usually defined near the beginning of the `.h` file: + +```c +#pragma once + +#define XXX KC_NO + +#define LAYOUT( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k33, \ + k40, k42 \ + ) { \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, XXX }, \ + { k30, k31, k32, k33 }, \ + { k40, XXX, k42, XXX } \ +} +``` + +!> This usage differs from that of keymap macros, which almost always use `XXXXXXX` (seven capital X's) for `KC_NO` and `_______` (seven underscores) for `KC_TRNS`. + +!> To prevent user confusion, using `KC_NO` is preferred. + +The layout macro tells the Configurator that our keyboard has 17 keys, arranged in five rows of four columns each. Our switch positions are named `k`, counting from 0. The names themselves actually don't matter, as long as they match between the top section, which receives the keycodes from the keymap, and the bottom half which designates where each key is in the matrix. + +To display our keyboard in a way that resembles the physical keyboard, we need to build a JSON file that tells the Configurator how to tie the physical locations and sizes of our keys to our switch matrix. + +## Building the JSON file + +To build the JSON file, the easiest way is to build the layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/) ("KLE"), from which we'll feed the Raw Data into a QMK tool that converts this data into a JSON the Configurator will read and use. Since KLE opens by default with a numpad layout, we're just going to remove the Getting Started instructions, and use what's left. + +Once the layout is as desired, move to the Raw Data tab in KLE, and copy the contents: + +``` +["Num Lock","/","*","-"], +["7\nHome","8\n↑","9\nPgUp",{h:2},"+"], +["4\n←","5","6\n→"], +["1\nEnd","2\n↓","3\nPgDn",{h:2},"Enter"], +[{w:2},"0\nIns",".\nDel"] +``` + +To convert this data into our JSON, go to the [QMK KLE-JSON Converter](https://qmk.fm/converter/), paste the Raw Data into the Input field, and click the Convert button. After a moment, our JSON data will appear in the Output field. Copy the contents to a new text document, and name the document `info.json`, saving it in the same folder that contains `numpad.h`. + +Use the `keyboard_name` object to set the name of the keyboard. The `bootloader` object is deprecated, so it can be deleted. For instruction purposes, we will put each key's object on its own line. This is only to make the file more human-readable, and does not affect the Configurator's functionality. + +```json +{ + "keyboard_name": "Numpad", + "url": "", + "maintainer": "qmk", + "tags": { + "form_factor": "numpad" + }, + "width": 4, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Num Lock", "x":0, "y":0}, + {"label":"/", "x":1, "y":0}, + {"label":"*", "x":2, "y":0}, + {"label":"-", "x":3, "y":0}, + {"label":"7", "x":0, "y":1}, + {"label":"8", "x":1, "y":1}, + {"label":"9", "x":2, "y":1}, + {"label":"+", "x":3, "y":1, "h":2}, + {"label":"4", "x":0, "y":2}, + {"label":"5", "x":1, "y":2}, + {"label":"6", "x":2, "y":2}, + {"label":"1", "x":0, "y":3}, + {"label":"2", "x":1, "y":3}, + {"label":"3", "x":2, "y":3}, + {"label":"Enter", "x":3, "y":3, "h":2}, + {"label":"0", "x":0, "y":4, "w":2}, + {"label":".", "x":2, "y":4} + ] + } + } +} +``` + +The `layouts` object contains the data that represents the physical layout of the keyboard. It has an object `LAYOUT`, which needs to match the name of our layout macro from `numpad.h`. The `LAYOUT` object itself has an object named `layout`, which contains one JSON object for each physical key on our keyboard, formatted as follows: + +``` + ┌ The name of the key. Not displayed in the Configurator. + │ ┌ The key's X-axis location, in key units from the + │ │ keyboard's left edge. + │ │ ┌ The key's Y-axis location, in key units from + │ │ │ the keyboard's top (rear-facing) edge. + ↓ ↓ ↓ +{"label":"Num Lock", "x":0, "y":0}, +``` + +Some objects will also have `"w"` and `"h"` keys, which represent a key's width and height, respectively. + +?> For more on the `info.json` files, see [QMK Keyboard Guidelines: Keyboard Metadata](hardware_keyboard_guidelines.md?id=keyboard-metadata) + + +## How the Configurator Programs Keys + +The Configurator's API uses the layout macro and the JSON file we've given it to create a visual representation of the keyboard that has each visual object tied to a specific key, in sequence: + +key in layout macro | JSON object used +:---: | :---- +k00 | {"label":"Num Lock", "x":0, "y":0} +k01 | {"label":"/", "x":1, "y":0} +k02 | {"label":"*", "x":2, "y":0} +k03 | {"label":"-", "x":3, "y":0} +k10 | {"label":"7", "x":0, "y":1} +k11 | {"label":"8", "x":1, "y":1} +k12 | {"label":"9", "x":2, "y":1} +k13 | {"label":"+", "x":3, "y":1, "h":2} +k20 | {"label":"4", "x":0, "y":2} +k21 | {"label":"5", "x":1, "y":2} +k22 | {"label":"6", "x":2, "y":2} +k30 | {"label":"1", "x":0, "y":3} +k31 | {"label":"2", "x":1, "y":3} +k32 | {"label":"3", "x":2, "y":3} +k33 | {"label":"Enter", "x":3, "y":3, "h":2} +k40 | {"label":"0", "x":0, "y":4, "w":2} +k42 | {"label":".", "x":2, "y":4} + +When a user selects the top-left key in the Configurator, and assigns Num Lock to it, the Configurator builds a keymap file with `KC_NLCK` as the first key, and so on as the keymap is built. The `label` keys are not used; they are only for the user's reference in identifying specific keys when debugging the `info.json` file. + + +## Issues and Hazards + +Currently, the Configurator does not support key rotation or non-rectangular key shapes like ISO Enter. Additionally, keys that are vertically-offset from their "row" — the arrow keys on 1800-layouts like the [TKC1800](https://github.com/qmk/qmk_firmware/tree/4ac48a61a66206beaf2fdd5f2939d8bbedd0004c/keyboards/tkc1800/) being a prominent example — confuse the KLE-to-JSON Converter, if not adjusted for by the contributor of the `info.json` file. + +### Workarounds + +#### Non-rectangular keys + +For ISO Enter keys, QMK custom is to display it as a rectangular key, 1.25u wide and 2u high, aligned so its right edge is aligned with the right edge of the alphanumeric key block. + +![](https://i.imgur.com/JKngtTw.png) +*A 60% keyboard in standard ISO layout, as rendered by QMK Configurator.* + +#### Vertically-offset keys + +For vertically-offset keys, place them in KLE as if they were not offset, then edit the Y-values as needed in the converted JSON file + +![](https://i.imgur.com/fmDvDzR.png) +*An 1800-layout keyboard as rendered in Keyboard Layout Editor, without the vertical offset applied to the arrow keys.* + +![](https://i.imgur.com/8beYMBR.png) +*A Unix diff file, showing the changes needed to vertically-offset the arrow keys in our keyboard's JSON file.* -- cgit v1.2.3 From 39bd760faf2666e91d6dc5b199f02fa3206c6acd Mon Sep 17 00:00:00 2001 From: James Laird-Wah Date: Fri, 16 Nov 2018 17:22:05 +1100 Subject: Use a single endpoint for HID reports (#3951) * Unify multiple HID interfaces into one This reduces the number of USB endpoints required, which frees them up for other things. NKRO and EXTRAKEY always use the shared endpoint. By default, MOUSEKEY also uses it. This means it won't work as a Boot Procotol mouse in some BIOSes, etc. If you really think your keyboard needs to work as a mouse in your BIOS, set MOUSE_SHARED_EP = no in your rules.mk. By default, the core keyboard does not use the shared endpoint, as not all BIOSes are standards compliant and that's one place you don't want to find out your keyboard doesn't work.. If you are really confident, you can set KEYBOARD_SHARED_EP = yes to use the shared endpoint here too. * unify endpoints: ChibiOS protocol implementation * fixup: missing #ifdef EXTRAKEY_ENABLEs broke build on AVR with EXTRAKEY disabled * endpoints: restore error when too many endpoints required * lufa: wait up to 10ms to send keyboard input This avoids packets being dropped when two reports are sent in quick succession (eg. releasing a dual role key). * endpoints: fix compile on ARM_ATSAM * endpoint: ARM_ATSAM fixes No longer use wrong or unexpected endpoint IDs * endpoints: accommodate VUSB protocol V-USB has its own, understandably simple ideas about the report formats. It already blasts the mouse and extrakeys through one endpoint with report IDs. We just stay out of its way. * endpoints: document new endpoint configuration options * endpoints: respect keyboard_report->mods in NKRO The caller(s) of host_keyboard_send expect to be able to just drop modifiers in the mods field and not worry about whether NKRO is in use. This is a good thing. So we just shift it over if needs be. * endpoints: report.c: update for new keyboard_report format --- docs/config_options.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index c4921c21d7..b811fa877d 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -261,3 +261,32 @@ Use these to enable or disable building certain features. The more you have enab * Forces the keyboard to wait for a USB connection to be established before it starts up * `NO_USB_STARTUP_CHECK` * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master. + +## USB Endpoint Limitations + +In order to provide services over USB, QMK has to use USB endpoints. +These are a finite resource: each microcontroller has only a certain number. +This limits what features can be enabled together. +If the available endpoints are exceeded, a build error is thrown. + +The following features can require separate endpoints: + +* `MOUSEKEY_ENABLE` +* `EXTRAKEY_ENABLE` +* `CONSOLE_ENABLE` +* `NKRO_ENABLE` +* `MIDI_ENABLE` +* `RAW_ENABLE` +* `VIRTSER_ENABLE` + +In order to improve utilisation of the endpoints, the HID features can be combined to use a single endpoint. +By default, `MOUSEKEY`, `EXTRAKEY`, and `NKRO` are combined into a single endpoint. + +The base keyboard functionality can also be combined into the endpoint, +by setting `KEYBOARD_SHARED_EP = yes`. +This frees up one more endpoint, +but it can prevent the keyboard working in some BIOSes, +as they do not implement Boot Keyboard protocol switching. + +Combining the mouse also breaks Boot Mouse compatibility. +The mouse can be uncombined by setting `MOUSE_SHARED_EP = no` if this functionality is required. -- cgit v1.2.3 From 504bf11769f1340711d749e8dc818f39a56a4dfb Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Mon, 19 Nov 2018 01:24:41 +0900 Subject: Allows disabling rgb effects in userspace (#4422) * Allows disabling animations in user space * Describe disabling effects in the docs * Allows disabling individual reactive modes * Adds the list ode defines --- docs/feature_rgb_matrix.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'docs') diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 809d034bdc..0af1e49479 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -150,6 +150,30 @@ These are the effects that are currently available: #endif RGB_MATRIX_EFFECT_MAX }; + +You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`: + + +|Define |Description | +|---------------------------------------------------|--------------------------------------------| +|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` | +|`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` | +|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` | +|`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | +|`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` | +|`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` | +|`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON`|Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON`| +|`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | +|`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | +|`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` | +|`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` | +|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` | +|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` | + ## Custom layer effects -- cgit v1.2.3 From ee8627e078dccab722f05fbf9bb152eca1b2ee7b Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 23 Nov 2018 20:07:53 -0800 Subject: Add EEPROM_RESET keycode to keycodes.md doc (#4473) --- docs/keycodes.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/keycodes.md b/docs/keycodes.md index 30fe60278f..1c5f46d6ec 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -206,18 +206,19 @@ This is a reference only. Each group of keys links to the page documenting their ## [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes) -|Key |Aliases |Description | -|-------------|-----------|---------------------------------------------------------------------| -|`RESET` | |Put the keyboard into DFU mode for flashing | -|`DEBUG` | |Toggle debug mode | -|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| -|`KC_LSPO` | |Left Shift when held, `(` when tapped | -|`KC_RSPC` | |Right Shift when held, `)` when tapped | -|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | -|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | -|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | -|`M(n)` | |Call macro `n` | -|`MACROTAP(n)`| |Macro-tap `n` idk FIXME | +|Key |Aliases |Description | +|---------------|-----------|---------------------------------------------------------------------| +|`RESET` | |Put the keyboard into DFU mode for flashing | +|`DEBUG` | |Toggle debug mode | +|`EEPROM_RESET` |`EEP_RST` |Resets EEPROM state by reinitializing it | +|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| +|`KC_LSPO` | |Left Shift when held, `(` when tapped | +|`KC_RSPC` | |Right Shift when held, `)` when tapped | +|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | +|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | +|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | +|`M(n)` | |Call macro `n` | +|`MACROTAP(n)` | |Macro-tap `n` idk FIXME | ## [Audio Keys](feature_audio.md) -- cgit v1.2.3 From 834b555eca47392ec0bf367b7f20694919d79a00 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 25 Nov 2018 18:40:48 -0800 Subject: Keymap FAQ: fix positions of KC_HENK and KC_MHEN for JIS layout (#4482) These keys were previously in each other's positions. --- docs/faq_keymap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index 07d74d6cf3..4e842d363c 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md @@ -11,8 +11,8 @@ Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_f 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: - -![Keyboard Layout Image](https://i.imgur.com/gvlNUpQ.png) + +![Keyboard Layout Image](https://i.imgur.com/5wsh5wM.png) ## Some Of My Keys Are Swapped Or Not Working -- cgit v1.2.3 From b91dfa04e3bad560fb6fe2360dd51fb95d95fcbf Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 26 Nov 2018 14:35:01 -0800 Subject: Add support for PR and Issue templates to QMK_firmware GitHub (#4491) * Add support document * Add Bug Report * Add GitHub Pull Request Template * Feature request issue template * Touch up feature request template * Add 'other issues' template * move support doc --- docs/support.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 docs/support.md (limited to 'docs') diff --git a/docs/support.md b/docs/support.md new file mode 100644 index 0000000000..28894c2c31 --- /dev/null +++ b/docs/support.md @@ -0,0 +1,43 @@ +# Support + +If you need help with something, the best place to get quick support is going to be on our [Discord Server](https://discord.gg/Uq7gcHh). There is usually somebody online, and there are a bunch of very helpful people there. + +Don't forget to read our [Code of Conduct](https://qmk.fm/coc/). + +## Help! I don't know where to start! + +If this is the case, then you should start with our [Newbs Guide](https://docs.qmk.fm/#/newbs). There is a lot of great info there, and that should cover everything you need to get started. + +If that's an issue, hop onto the [QMK Configurator](https://config.qmk.fm), as that will handle a majority of what you need there. + +## Help! I'm having issues flashing! + +First, head to the [Compiling/Flashing FAQ Page](https://docs.qmk.fm/#/faq_build). There is a good deal of info there, and you'll find a bunch of solutions to common issues there. + +## Help, I have an issue that isn't covered by the links above + +Okay, that's fine. Then please check the [open issues in our GitHub](https://github.com/qmk/qmk_firmware/issues) to see if somebody is experiencing the same thing (make sure it's not just similar, but actually the same). + +If you can't find anything, then please open a [new issue](https://github.com/qmk/qmk_firmware/issues)! + +## What if I found a bug? + +Then please open an issue, and if you know how to fix it, open up a Pull Request on GitHub with the fix. + +## But `git` and `GitHub` are intimidating! + +Don't worry, we have some pretty nice [Guidelines](https://docs.qmk.fm/#/newbs_best_practices) on how to start using `git` and GitHub to make things easier to develop. + +Additionally, you can find additional `git` and GitHub related links [here](https://docs.qmk.fm/#/newbs_learn_more_resources). + +## I have a Keyboard that I want to add support for + +Awesome! Open up a Pull Request for it. We'll review the code, and merge it! + +### What if I want to do brand it with `QMK`? + +That's amazing! We would love to assist you with that! + +In fact, we have a [whol page](https://qmk.fm/powered/) dedicated to adding QMK Branding to your page and keyboard. This covers pretty much everything you need (knowledge and images) to officially support QMK. + +If you have any questions about this, open an issue or head to [Discord](https://discord.gg/Uq7gcHh). -- cgit v1.2.3 From b7b20cd9dfc8928b3c31560a410c75e9a9ec232a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 26 Nov 2018 14:35:48 -0800 Subject: Revert "Add support for PR and Issue templates to QMK_firmware GitHub (#4491)" (#4492) This reverts commit b91dfa04e3bad560fb6fe2360dd51fb95d95fcbf. --- docs/support.md | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 docs/support.md (limited to 'docs') diff --git a/docs/support.md b/docs/support.md deleted file mode 100644 index 28894c2c31..0000000000 --- a/docs/support.md +++ /dev/null @@ -1,43 +0,0 @@ -# Support - -If you need help with something, the best place to get quick support is going to be on our [Discord Server](https://discord.gg/Uq7gcHh). There is usually somebody online, and there are a bunch of very helpful people there. - -Don't forget to read our [Code of Conduct](https://qmk.fm/coc/). - -## Help! I don't know where to start! - -If this is the case, then you should start with our [Newbs Guide](https://docs.qmk.fm/#/newbs). There is a lot of great info there, and that should cover everything you need to get started. - -If that's an issue, hop onto the [QMK Configurator](https://config.qmk.fm), as that will handle a majority of what you need there. - -## Help! I'm having issues flashing! - -First, head to the [Compiling/Flashing FAQ Page](https://docs.qmk.fm/#/faq_build). There is a good deal of info there, and you'll find a bunch of solutions to common issues there. - -## Help, I have an issue that isn't covered by the links above - -Okay, that's fine. Then please check the [open issues in our GitHub](https://github.com/qmk/qmk_firmware/issues) to see if somebody is experiencing the same thing (make sure it's not just similar, but actually the same). - -If you can't find anything, then please open a [new issue](https://github.com/qmk/qmk_firmware/issues)! - -## What if I found a bug? - -Then please open an issue, and if you know how to fix it, open up a Pull Request on GitHub with the fix. - -## But `git` and `GitHub` are intimidating! - -Don't worry, we have some pretty nice [Guidelines](https://docs.qmk.fm/#/newbs_best_practices) on how to start using `git` and GitHub to make things easier to develop. - -Additionally, you can find additional `git` and GitHub related links [here](https://docs.qmk.fm/#/newbs_learn_more_resources). - -## I have a Keyboard that I want to add support for - -Awesome! Open up a Pull Request for it. We'll review the code, and merge it! - -### What if I want to do brand it with `QMK`? - -That's amazing! We would love to assist you with that! - -In fact, we have a [whol page](https://qmk.fm/powered/) dedicated to adding QMK Branding to your page and keyboard. This covers pretty much everything you need (knowledge and images) to officially support QMK. - -If you have any questions about this, open an issue or head to [Discord](https://discord.gg/Uq7gcHh). -- cgit v1.2.3 From 90f9fb4eee0da25e5408e54ed872c6da2a40c5f3 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Fri, 5 Oct 2018 14:54:22 +0900 Subject: Fixed docs/newbs_testing_debugging.md and tmk_core/common/print.h --- docs/newbs_testing_debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/newbs_testing_debugging.md b/docs/newbs_testing_debugging.md index 1d8021dec8..45509110a5 100644 --- a/docs/newbs_testing_debugging.md +++ b/docs/newbs_testing_debugging.md @@ -28,6 +28,6 @@ Sometimes it's useful to print debug messages from within your [custom code](cus After that you can use a few different print functions: * `print("string")`: Print a simple string. -* `sprintf("%s string", var)`: Print a formatted string +* `uprintf("%s string", var)`: Print a formatted string * `dprint("string")` Print a simple string, but only when debug mode is enabled * `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled -- cgit v1.2.3 From 19043197459c5c8ed4a7039f1a4c1da180da45e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Wed, 28 Nov 2018 00:34:06 +0100 Subject: Remove RGB_SMOD alias and replace uses with RGB_MOD (#4319) --- docs/feature_rgblight.md | 2 -- 1 file changed, 2 deletions(-) (limited to 'docs') diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 0205ebe91a..4610467b02 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -63,8 +63,6 @@ Changing the **Value** sets the overall brightness. |`RGB_MODE_GRADIENT`|`RGB_M_G` |Static gradient animation mode | |`RGB_MODE_RGBTEST` |`RGB_M_T` |Red, Green, Blue test animation mode | -?> For backwards compatibility, `RGB_SMOD` is another alias of `RGB_MOD`. - ## Configuration Your RGB lighting can be configured by placing these `#define`s in your `config.h`: -- cgit v1.2.3 From 8b85ec2a987d378fb95eea1468eadea70aec2cbf Mon Sep 17 00:00:00 2001 From: Giuseppe Rota Date: Wed, 28 Nov 2018 17:19:07 +0100 Subject: Add Extrakey support for Brightness up/down (#4477) --- docs/keycode.txt | 2 ++ docs/keycodes.md | 2 ++ docs/keycodes_basic.md | 2 ++ 3 files changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/keycode.txt b/docs/keycode.txt index b2070f7117..bd93b0a941 100644 --- a/docs/keycode.txt +++ b/docs/keycode.txt @@ -209,6 +209,8 @@ KC_WWW_FORWARD KC_WFWD KC_WWW_STOP KC_WSTP KC_WWW_REFRESH KC_WREF KC_WWW_FAVORITES KC_WFAV +KC_BRIGHTNESS_UP KC_BRIU +KC_BRIGHTNESS_DOWN KC_BRID /* Mousekey */ KC_MS_UP KC_MS_U Mouse Cursor Up KC_MS_DOWN KC_MS_D Mouse Cursor Down diff --git a/docs/keycodes.md b/docs/keycodes.md index 1c5f46d6ec..75b01389c5 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -203,6 +203,8 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_WWW_FAVORITES` |`KC_WFAV` |Browser Favorites (Windows) | |`KC_MEDIA_FAST_FORWARD`|`KC_MFFD` |Next Track (macOS) | |`KC_MEDIA_REWIND` |`KC_MRWD` |Previous Track (macOS) | +|`KC_BRIGHTNESS_UP` |`KC_BRIU` |Brightness Up | +|`KC_BRIGHTNESS_DOWN` |`KC_BRID` |Brightness Down | ## [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes) diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index ada9cc0e5a..9cc00f0325 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -219,6 +219,8 @@ Windows and macOS use different keycodes for "next track" and "previous track". |`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites (Windows) | |`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS) | |`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track (macOS) | +|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up | +|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down | ## Number Pad -- cgit v1.2.3 From fbf59ba2e5a4ccd8842d044f7ffa75e91e1894cb Mon Sep 17 00:00:00 2001 From: Paul Massendari Date: Thu, 29 Nov 2018 16:33:45 +0100 Subject: Typo fix (#4515) --- docs/feature_unicode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index b1527b848a..c98a402287 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -30,7 +30,7 @@ Make sure that the order for both matches. ## UCIS_ENABLE -Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to main a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence. +Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to maintain a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence. For instance, you would need to have a table like this in your keymap: -- cgit v1.2.3 From b10aad45b60326c7e9f2d1fc67e45bd201341552 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 30 Nov 2018 00:14:55 -0500 Subject: Test out i18n of the docs (#4519) * add zh-cn readme * edit readme * Round 1 of edits - Mandarin translation of QMK products is off, best to use the English name. - Fix some terminology and grammar. * trying re-translating the first paragraph --- docs/zh-cn/README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/zh-cn/README.md (limited to 'docs') diff --git a/docs/zh-cn/README.md b/docs/zh-cn/README.md new file mode 100644 index 0000000000..bb9d1371f1 --- /dev/null +++ b/docs/zh-cn/README.md @@ -0,0 +1,32 @@ +# QMK鍵盤固件 + +[![當前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) +[![築邦](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) +[![不和諧](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh) +[![文檔狀態](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm) +[![GitHub的貢獻者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) +[![GitHub的叉](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) + +## 什麼是QMK固件? + +QMK是一個由社群維護的開源鍵盤韌體,其中包含了QMK Toolbox、qmk.fm和其它文件。QMK韌體是以[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)為基礎,讓一些有用的功能在Atmel AVR控制器實現,使用於[OLKB](https://olkb.com)、[ergodox EZ](http://www.ergodox-ez.com),和[Clueboard](http://clueboard.co/)的產品中。它也被移植到使用ChibiOS的ARM晶片上。你也可以用它來讓你徒手佈線,或是客製的鍵盤PCB發揮功能。 + +## 如何得到QMK + +如果你打算貢獻鍵盤佈局,鍵盤或功能QMK,最容易做的事情是[叉通過Github上爬行](https://github.com/qmk/qmk_firmware#fork-destination-box),和克隆你爬在本地進行更改,推動他們,然後打開從你的叉子[拉請求](https://github.com/qmk/qmk_firmware/pulls)。 + +否則,您可以直接下載([拉鍊](https://github.com/qmk/qmk_firmware/zipball/master) [焦油](https://github.com/qmk/qmk_firmware/tarball/master)),或者通過GIT中克隆它(`git@github.com:qmk/qmk_firmware.git`)或HTTP(`https://github.com/qmk/qmk_firmware.git`)。 + +## 如何編譯 + +你可以編譯之前,你需要[安裝環境](getting_started_build_tools.md)用於AVR或/和ARM開發。一旦完成,你會使用`make`命令建立一個鍵盤並用以下符號鍵盤佈局 + + make planck/rev4:default + +這將建立`rev4` `planck`的修訂與`default`鍵盤映射。並非所有鍵盤有一個修訂版(也稱為子項目或文件夾),在這種情況下,它可以被省略: + + make preonic:default + +## 如何赶近 + +QMK有很多[特點](features.md)探索和很好的協議[參考文獻](http://docs.qmk.fm)挖通的。大部分功能通過修改[鍵盤映射(keymap.md),並改變[鍵碼](keycodes.md)冤大頭。 -- cgit v1.2.3 From 75a51659abfbc68874f2e9326f0adf1258fc5458 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 1 Dec 2018 08:21:06 -0800 Subject: Add tap_random_base64 and software timer info to Useful Functions doc (#4360) * Update docs * Add security caveat Co-Authored-By: drashna * Wordsmithing Co-Authored-By: drashna * Update docs/ref_functions.md Co-Authored-By: drashna --- docs/faq_keymap.md | 17 ----------------- docs/ref_functions.md | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 17 deletions(-) (limited to 'docs') diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index 4e842d363c..ae01e93878 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md @@ -211,20 +211,3 @@ 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 - -It's possible to start timers and read values for time-specific events - here's an example: - -```c -static uint16_t key_timer; -key_timer = timer_read(); - -if (timer_elapsed(key_timer) < 100) { - // do something if less than 100ms have passed -} else { - // do something if 100ms or more have passed -} -``` - -It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in. diff --git a/docs/ref_functions.md b/docs/ref_functions.md index 9b5be7a883..174d9a95a6 100644 --- a/docs/ref_functions.md +++ b/docs/ref_functions.md @@ -96,3 +96,24 @@ And to do so, add `reset_keyboard()` to your function or macro, and this will re If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so. To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. + +## Tap random key + +If you want to send a random character to the host computer, you can use the `tap_random_base64()` function. This [pseudorandomly](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) selects a number between 0 and 63, and then sends a key press based on that selection. (0–25 is `A`–`Z`, 26–51 is `a`–`z`, 52–61 is `0`–`9`, 62 is `+` and 63 is `/`). + +?> Needless to say, but this is _not_ a cryptographically secure method of generating random Base64 keys or passwords. + +## Software Timers + +It's possible to start timers and read values for time-specific events. Here's an example: + +```c +static uint16_t key_timer; +key_timer = timer_read(); + +if (timer_elapsed(key_timer) < 100) { + // do something if less than 100ms have passed +} else { + // do something if 100ms or more have passed +} +``` -- cgit v1.2.3 From d5a06aec8386ef16e0751572c5182410b8d348f7 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 2 Dec 2018 15:12:54 -0500 Subject: Second try at configuring i18n for docsify and gitbook (#4531) * add zh-cn readme * edit readme * Round 1 of edits - Mandarin translation of QMK products is off, best to use the English name. - Fix some terminology and grammar. * trying re-translating the first paragraph * add fallback langurages * Create LANGS.md * Rename docs/zh-cn/README.md to docs/zh/README.md * Update LANGS.md * Update index.html --- docs/LANGS.md | 4 ++++ docs/index.html | 3 ++- docs/zh/README.md | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 docs/LANGS.md create mode 100644 docs/zh/README.md (limited to 'docs') diff --git a/docs/LANGS.md b/docs/LANGS.md new file mode 100644 index 0000000000..4b48f2d3d8 --- /dev/null +++ b/docs/LANGS.md @@ -0,0 +1,4 @@ +# Languages + +* [English](/) +* [Chinese](zh/) diff --git a/docs/index.html b/docs/index.html index f0b1fae07e..f5aa92b531 100644 --- a/docs/index.html +++ b/docs/index.html @@ -25,7 +25,8 @@ placeholder: 'Search Documentation...', noData: 'We could not find any documents matching your search.', depth: 6 - } + }, + fallbackLanguages: ['zh'] } diff --git a/docs/zh/README.md b/docs/zh/README.md new file mode 100644 index 0000000000..bb9d1371f1 --- /dev/null +++ b/docs/zh/README.md @@ -0,0 +1,32 @@ +# QMK鍵盤固件 + +[![當前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) +[![築邦](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) +[![不和諧](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh) +[![文檔狀態](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm) +[![GitHub的貢獻者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) +[![GitHub的叉](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) + +## 什麼是QMK固件? + +QMK是一個由社群維護的開源鍵盤韌體,其中包含了QMK Toolbox、qmk.fm和其它文件。QMK韌體是以[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)為基礎,讓一些有用的功能在Atmel AVR控制器實現,使用於[OLKB](https://olkb.com)、[ergodox EZ](http://www.ergodox-ez.com),和[Clueboard](http://clueboard.co/)的產品中。它也被移植到使用ChibiOS的ARM晶片上。你也可以用它來讓你徒手佈線,或是客製的鍵盤PCB發揮功能。 + +## 如何得到QMK + +如果你打算貢獻鍵盤佈局,鍵盤或功能QMK,最容易做的事情是[叉通過Github上爬行](https://github.com/qmk/qmk_firmware#fork-destination-box),和克隆你爬在本地進行更改,推動他們,然後打開從你的叉子[拉請求](https://github.com/qmk/qmk_firmware/pulls)。 + +否則,您可以直接下載([拉鍊](https://github.com/qmk/qmk_firmware/zipball/master) [焦油](https://github.com/qmk/qmk_firmware/tarball/master)),或者通過GIT中克隆它(`git@github.com:qmk/qmk_firmware.git`)或HTTP(`https://github.com/qmk/qmk_firmware.git`)。 + +## 如何編譯 + +你可以編譯之前,你需要[安裝環境](getting_started_build_tools.md)用於AVR或/和ARM開發。一旦完成,你會使用`make`命令建立一個鍵盤並用以下符號鍵盤佈局 + + make planck/rev4:default + +這將建立`rev4` `planck`的修訂與`default`鍵盤映射。並非所有鍵盤有一個修訂版(也稱為子項目或文件夾),在這種情況下,它可以被省略: + + make preonic:default + +## 如何赶近 + +QMK有很多[特點](features.md)探索和很好的協議[參考文獻](http://docs.qmk.fm)挖通的。大部分功能通過修改[鍵盤映射(keymap.md),並改變[鍵碼](keycodes.md)冤大頭。 -- cgit v1.2.3 From 5d47231f2a9353645aab07e14c1de21f00b7fc2f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 2 Dec 2018 15:35:53 -0500 Subject: Add sidebar for ZH (#4533) * add zh-cn readme * edit readme * Round 1 of edits - Mandarin translation of QMK products is off, best to use the English name. - Fix some terminology and grammar. * trying re-translating the first paragraph * add fallback langurages * Create LANGS.md * Rename docs/zh-cn/README.md to docs/zh/README.md * Update LANGS.md * Update index.html * Delete README.md * add sidebar for zh --- docs/zh-cn/README.md | 32 ----------------- docs/zh/_sidebar.md | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 32 deletions(-) delete mode 100644 docs/zh-cn/README.md create mode 100644 docs/zh/_sidebar.md (limited to 'docs') diff --git a/docs/zh-cn/README.md b/docs/zh-cn/README.md deleted file mode 100644 index bb9d1371f1..0000000000 --- a/docs/zh-cn/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# QMK鍵盤固件 - -[![當前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) -[![築邦](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) -[![不和諧](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh) -[![文檔狀態](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm) -[![GitHub的貢獻者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) -[![GitHub的叉](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) - -## 什麼是QMK固件? - -QMK是一個由社群維護的開源鍵盤韌體,其中包含了QMK Toolbox、qmk.fm和其它文件。QMK韌體是以[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)為基礎,讓一些有用的功能在Atmel AVR控制器實現,使用於[OLKB](https://olkb.com)、[ergodox EZ](http://www.ergodox-ez.com),和[Clueboard](http://clueboard.co/)的產品中。它也被移植到使用ChibiOS的ARM晶片上。你也可以用它來讓你徒手佈線,或是客製的鍵盤PCB發揮功能。 - -## 如何得到QMK - -如果你打算貢獻鍵盤佈局,鍵盤或功能QMK,最容易做的事情是[叉通過Github上爬行](https://github.com/qmk/qmk_firmware#fork-destination-box),和克隆你爬在本地進行更改,推動他們,然後打開從你的叉子[拉請求](https://github.com/qmk/qmk_firmware/pulls)。 - -否則,您可以直接下載([拉鍊](https://github.com/qmk/qmk_firmware/zipball/master) [焦油](https://github.com/qmk/qmk_firmware/tarball/master)),或者通過GIT中克隆它(`git@github.com:qmk/qmk_firmware.git`)或HTTP(`https://github.com/qmk/qmk_firmware.git`)。 - -## 如何編譯 - -你可以編譯之前,你需要[安裝環境](getting_started_build_tools.md)用於AVR或/和ARM開發。一旦完成,你會使用`make`命令建立一個鍵盤並用以下符號鍵盤佈局 - - make planck/rev4:default - -這將建立`rev4` `planck`的修訂與`default`鍵盤映射。並非所有鍵盤有一個修訂版(也稱為子項目或文件夾),在這種情況下,它可以被省略: - - make preonic:default - -## 如何赶近 - -QMK有很多[特點](features.md)探索和很好的協議[參考文獻](http://docs.qmk.fm)挖通的。大部分功能通過修改[鍵盤映射(keymap.md),並改變[鍵碼](keycodes.md)冤大頭。 diff --git a/docs/zh/_sidebar.md b/docs/zh/_sidebar.md new file mode 100644 index 0000000000..c167612929 --- /dev/null +++ b/docs/zh/_sidebar.md @@ -0,0 +1,99 @@ +* [完全指南菜鳥](zh/newbs.md) + * [入門](zh/newbs_getting_started.md) + * [構建第一個固件](zh/newbs_building_firmware.md) + * [刷新固件](zh/newbs_flashing.md) + * [測試和調試](zh/newbs_testing_debugging.md) + * [最佳實踐](zh/newbs_best_practices.md) + * [學習資源](zh/newbs_learn_more_resources.md) + +* [QMK基礎](zh/README.md) + * [QMK簡介](zh/getting_started_introduction.md) + * [特約QMK](zh/contributing.md) + * [如何使用Github上](zh/getting_started_github.md) + * [獲得幫助](zh/getting_started_getting_help.md) + +* [常問問題](zh/faq.md) + * [常問問題](zh/faq_general.md) + * [構建/編譯QMK](zh/faq_build.md) + * [調試/故障排除QMK](zh/faq_debug.md) + * [鍵盤佈局](zh/faq_keymap.md) + +* 詳細指南 + * [安裝編譯工具](zh/getting_started_build_tools.md) + * [流浪漢指南](zh/getting_started_vagrant.md) + * [構建/編譯器指令](zh/getting_started_make_guide.md) + * [刷新固件](zh/flashing.md) + * [定制功能](zh/custom_quantum_functions.md) + * [鍵盤映射概述](zh/keymap.md) + +* [硬件](zh/hardware.md) + * [AVR處理器](zh/hardware_avr.md) + * [司機](zh/hardware_drivers.md) + +* 參考 + * [Keyboard Guidelines](zh/hardware_keyboard_guidelines.md) + * [Config Options](zh/config_options.md) + * [Keycodes](zh/keycodes.md) + * [Documentation Best Practices](zh/documentation_best_practices.md) + * [Documentation Templates](zh/documentation_templates.md) + * [Glossary](zh/reference_glossary.md) + * [Unit Testing](zh/unit_testing.md) + * [Useful Functions](zh/ref_functions.md) + * [Configurator Support](zh/reference_configurator_support.md) + +* [特點](zh/features.md) + * [Basic Keycodes](zh/keycodes_basic.md) + * [Quantum Keycodes](zh/quantum_keycodes.md) + * [Advanced Keycodes](zh/feature_advanced_keycodes.md) + * [Audio](zh/feature_audio.md) + * [Auto Shift](zh/feature_auto_shift.md) + * [Backlight](zh/feature_backlight.md) + * [Bluetooth](zh/feature_bluetooth.md) + * [Bootmagic](zh/feature_bootmagic.md) + * [Combos](zh/feature_combo) + * [Command](zh/feature_command.md) + * [Dynamic Macros](zh/feature_dynamic_macros.md) + * [Encoders](zh/feature_encoders.md) + * [Grave Escape](zh/feature_grave_esc.md) + * [Key Lock](zh/feature_key_lock.md) + * [Layouts](zh/feature_layouts.md) + * [Leader Key](zh/feature_leader_key.md) + * [Macros](zh/feature_macros.md) + * [Mouse Keys](zh/feature_mouse_keys.md) + * [One Shot Keys](zh/feature_advanced_keycodes.md#one-shot-keys) + * [Pointing Device](zh/feature_pointing_device.md) + * [PS/2 Mouse](zh/feature_ps2_mouse.md) + * [RGB Lighting](zh/feature_rgblight.md) + * [RGB Matrix](zh/feature_rgb_matrix.md) + * [Space Cadet Shift](zh/feature_space_cadet_shift.md) + * [Space Cadet Shift Enter](zh/feature_space_cadet_shift_enter.md) + * [Stenography](zh/feature_stenography.md) + * [Swap Hands](zh/feature_swap_hands.md) + * [Tap Dance](zh/feature_tap_dance.md) + * [Terminal](zh/feature_terminal.md) + * [Thermal Printer](zh/feature_thermal_printer.md) + * [Unicode](zh/feature_unicode.md) + * [Userspace](zh/feature_userspace.md) + * [US ANSI Shifted Keys](zh/keycodes_us_ansi_shifted.md) + +* 對於製造商和遊戲模組 + * [Hand Wiring Guide](zh/hand_wire.md) + * [ISP Flashing Guide](zh/isp_flashing_guide.md) + * [ARM Debugging Guide](zh/arm_debugging.md) + * [I2C Driver](zh/i2c_driver.md) + +* 為了更深入的了解 + * [How Keyboards Work](zh/how_keyboards_work.md) + * [Understanding QMK](zh/understanding_qmk.md) + +* 其它主題 + * [Using Eclipse with QMK](zh/eclipse.md) + +* QMK內部(進行中) + * [Defines](zh/internals_defines.md) + * [Input Callback Reg](zh/internals_input_callback_reg.md) + * [Midi Device](zh/internals_midi_device.md) + * [Midi Device Setup Process](zh/internals_midi_device_setup_process.md) + * [Midi Util](zh/internals_midi_util.md) + * [Send Functions](zh/internals_send_functions.md) + * [Sysex Tools](zh/internals_sysex_tools.md) -- cgit v1.2.3 From 3a0f3a5bd0aff18934431ad471b1db390c3b33d1 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 3 Dec 2018 16:42:57 -0800 Subject: Make ARM Audio max volume configurable (#4540) * Make ARM Audio max volume configurable * Update docs/feature_audio.md Co-Authored-By: drashna * Update docs/feature_audio.md Co-Authored-By: drashna --- docs/feature_audio.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs') diff --git a/docs/feature_audio.md b/docs/feature_audio.md index 82e0ed9503..a39c456873 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -65,6 +65,13 @@ The available keycodes for audio are: * `AU_OFF` - Turn audio mode off * `AU_TOG` - Toggle audio mode +## ARM Audio Volume + +For ARM devices, you can adjust the DAC sample values. If your board is too loud for you or your coworkers, you can set the max using `DAC_SAMPLE_MAX` in your `config.h`: + +```c +#define DAC_SAMPLE_MAX 65535U +``` ## Music Mode -- cgit v1.2.3 From 59b2be6200e13166cf69ae04aa7a05ec5e837d79 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 5 Dec 2018 10:28:06 -0800 Subject: Re-order feature list in sidebar (#4555) Specifically, moved the shifted keycodes to the top of the 'Feature' list, so it's more visible. This way, all of the keycodes are at the top of the list, rather than having the shifted keys at the bottom, so they should be easier to find since they're all in one place. --- docs/_sidebar.md | 2 +- docs/_summary.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 1fb5398d93..6338d69121 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -43,6 +43,7 @@ * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) + * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * [Quantum Keycodes](quantum_keycodes.md) * [Advanced Keycodes](feature_advanced_keycodes.md) * [Audio](feature_audio.md) @@ -74,7 +75,6 @@ * [Thermal Printer](feature_thermal_printer.md) * [Unicode](feature_unicode.md) * [Userspace](feature_userspace.md) - * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) diff --git a/docs/_summary.md b/docs/_summary.md index 1fb5398d93..6338d69121 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -43,6 +43,7 @@ * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) + * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * [Quantum Keycodes](quantum_keycodes.md) * [Advanced Keycodes](feature_advanced_keycodes.md) * [Audio](feature_audio.md) @@ -74,7 +75,6 @@ * [Thermal Printer](feature_thermal_printer.md) * [Unicode](feature_unicode.md) * [Userspace](feature_userspace.md) - * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) -- cgit v1.2.3 From 42c9fd262585c9ba46a726604d60eb6c42b3cda7 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 7 Dec 2018 03:31:17 +1100 Subject: Delete docs/keycode.txt (#4505) --- docs/keycode.txt | 263 ------------------------------------------------------- 1 file changed, 263 deletions(-) delete mode 100644 docs/keycode.txt (limited to 'docs') diff --git a/docs/keycode.txt b/docs/keycode.txt deleted file mode 100644 index bd93b0a941..0000000000 --- a/docs/keycode.txt +++ /dev/null @@ -1,263 +0,0 @@ -Keycode Symbol Table -==================== -Keycodes are defined in `common/keycode.h`. -Range of 00-A4 and E0-E7 are identical with HID Usage: - -Virtual keycodes are defined out of above range to support special actions. - - -Keycode Symbol Short name Description --------------------------------------------------------------------------------- -KC_NO 00 Reserved (no event indicated) -KC_ROLL_OVER 01 Keyboard ErrorRollOver -KC_POST_FAIL 02 Keyboard POSTFail -KC_UNDEFINED 03 Keyboard ErrorUndefined -KC_A 04 Keyboard a and A -KC_B 05 Keyboard b and B -KC_C 06 Keyboard c and C -KC_D 07 Keyboard d and D -KC_E 08 Keyboard e and E -KC_F 09 Keyboard f and F -KC_G 0A Keyboard g and G -KC_H 0B Keyboard h and H -KC_I 0C Keyboard i and I -KC_J 0D Keyboard j and J -KC_K 0E Keyboard k and K -KC_L 0F Keyboard l and L -KC_M 10 Keyboard m and M -KC_N 11 Keyboard n and N -KC_O 12 Keyboard o and O -KC_P 13 Keyboard p and P -KC_Q 14 Keyboard q and Q -KC_R 15 Keyboard r and R -KC_S 16 Keyboard s and S -KC_T 17 Keyboard t and T -KC_U 18 Keyboard u and U -KC_V 19 Keyboard v and V -KC_W 1A Keyboard w and W -KC_X 1B Keyboard x and X -KC_Y 1C Keyboard y and Y -KC_Z 1D Keyboard z and Z -KC_1 1E Keyboard 1 and ! -KC_2 1F Keyboard 2 and @ -KC_3 20 Keyboard 3 and # -KC_4 21 Keyboard 4 and $ -KC_5 22 Keyboard 5 and % -KC_6 23 Keyboard 6 and ^ -KC_7 24 Keyboard 7 and & -KC_8 25 Keyboard 8 and * -KC_9 26 Keyboard 9 and ( -KC_0 27 Keyboard 0 and ) -KC_ENTER KC_ENT 28 Keyboard Return (ENTER) -KC_ESCAPE KC_ESC 29 Keyboard ESCAPE -KC_BSPACE KC_BSPC 2A Keyboard DELETE (Backspace) -KC_TAB 2B Keyboard Tab -KC_SPACE KC_SPC 2C Keyboard Spacebar -KC_MINUS KC_MINS 2D Keyboard - and (underscore) -KC_EQUAL KC_EQL 2E Keyboard = and + -KC_LBRACKET KC_LBRC 2F Keyboard [ and { -KC_RBRACKET KC_RBRC 30 Keyboard ] and } -KC_BSLASH KC_BSLS 31 Keyboard \ and | -KC_NONUS_HASH KC_NUHS 32 Keyboard Non-US # and ~ -KC_SCOLON KC_SCLN 33 Keyboard ; and : -KC_QUOTE KC_QUOT 34 Keyboard ‘ and “ -KC_GRAVE KC_GRV 35 Keyboard Grave Accent and Tilde -KC_COMMA KC_COMM 36 Keyboard , and < -KC_DOT 37 Keyboard . and > -KC_SLASH KC_SLSH 38 Keyboard / and ? -KC_CAPSLOCK KC_CAPS 39 Keyboard Caps Lock -KC_F1 3A Keyboard F1 -KC_F2 3B Keyboard F2 -KC_F3 3C Keyboard F3 -KC_F4 3D Keyboard F4 -KC_F5 3E Keyboard F5 -KC_F6 3F Keyboard F6 -KC_F7 40 Keyboard F7 -KC_F8 41 Keyboard F8 -KC_F9 42 Keyboard F9 -KC_F10 43 Keyboard F10 -KC_F11 44 Keyboard F11 -KC_F12 45 Keyboard F12 -KC_PSCREEN KC_PSCR 46 Keyboard PrintScreen -KC_SCROLLLOCK KC_SLCK 47 Keyboard Scroll Lock -KC_PAUSE KC_PAUS 48 Keyboard Pause -KC_INSERT KC_INS 49 Keyboard Insert -KC_HOME 4A Keyboard Home -KC_PGUP 4B Keyboard PageUp -KC_DELETE KC_DEL 4C Keyboard Delete Forward -KC_END 4D Keyboard End -KC_PGDOWN KC_PGDN 4E Keyboard PageDown -KC_RIGHT KC_RGHT 4F Keyboard RightArrow -KC_LEFT 50 Keyboard LeftArrow -KC_DOWN 51 Keyboard DownArrow -KC_UP 52 Keyboard UpArrow -KC_NUMLOCK KC_NLCK 53 Keypad Num Lock and Clear -KC_KP_SLASH KC_PSLS 54 Keypad / -KC_KP_ASTERISK KC_PAST 55 Keypad * -KC_KP_MINUS KC_PMNS 56 Keypad - -KC_KP_PLUS KC_PPLS 57 Keypad + -KC_KP_ENTER KC_PENT 58 Keypad ENTER -KC_KP_1 KC_P1 59 Keypad 1 and End -KC_KP_2 KC_P2 5A Keypad 2 and Down Arrow -KC_KP_3 KC_P3 5B Keypad 3 and PageDn -KC_KP_4 KC_P4 5C Keypad 4 and Left Arrow -KC_KP_5 KC_P5 5D Keypad 5 -KC_KP_6 KC_P6 5E Keypad 6 and Right Arrow -KC_KP_7 KC_P7 5F Keypad 7 and Home -KC_KP_8 KC_P8 60 Keypad 8 and Up Arrow -KC_KP_9 KC_P9 61 Keypad 9 and PageUp -KC_KP_0 KC_P0 62 Keypad 0 and Insert -KC_KP_DOT KC_PDOT 63 Keypad . and Delete -KC_NONUS_BSLASH KC_NUBS 64 Keyboard Non-US \ and | -KC_APPLICATION KC_APP 65 Keyboard Application -KC_POWER 66 Keyboard Power -KC_KP_EQUAL KC_PEQL 67 Keypad = -KC_F13 68 Keyboard F13 -KC_F14 69 Keyboard F14 -KC_F15 6A Keyboard F15 -KC_F16 6B Keyboard F16 -KC_F17 6C Keyboard F17 -KC_F18 6D Keyboard F18 -KC_F19 6E Keyboard F19 -KC_F20 6F Keyboard F20 -KC_F21 70 Keyboard F21 -KC_F22 71 Keyboard F22 -KC_F23 72 Keyboard F23 -KC_F24 73 Keyboard F24 -KC_EXECUTE 74 Keyboard Execute -KC_HELP 75 Keyboard Help -KC_MENU 76 Keyboard Menu -KC_SELECT 77 Keyboard Select -KC_STOP 78 Keyboard Stop -KC_AGAIN 79 Keyboard Again -KC_UNDO 7A Keyboard Undo -KC_CUT 7B Keyboard Cut -KC_COPY 7C Keyboard Copy -KC_PASTE 7D Keyboard Paste -KC_FIND 7E Keyboard Find -KC__MUTE 7F Keyboard Mute -KC__VOLUP 80 Keyboard Volume Up -KC__VOLDOWN 81 Keyboard Volume Down -KC_LOCKING_CAPS 82 Keyboard Locking Caps Lock -KC_LOCKING_NUM 83 Keyboard Locking Num Lock -KC_LOCKING_SCROLL 84 Keyboard Locking Scroll Lock -KC_KP_COMMA KC_PCMM 85 Keypad Comma -KC_KP_EQUAL_AS400 86 Keypad Equal Sign -KC_INT1 KC_RO 87 Keyboard International115 -KC_INT2 KC_KANA 88 Keyboard International216 -KC_INT3 KC_JYEN 89 Keyboard International317 -KC_INT4 KC_HENK 8A Keyboard International418 -KC_INT5 KC_MHEN 8B Keyboard International519 -KC_INT6 8C Keyboard International620 -KC_INT7 8D Keyboard International721 -KC_INT8 8E Keyboard International822 -KC_INT9 8F Keyboard International922 -KC_LANG1 90 Keyboard LANG125 -KC_LANG2 91 Keyboard LANG226 -KC_LANG3 92 Keyboard LANG330 -KC_LANG4 93 Keyboard LANG431 -KC_LANG5 94 Keyboard LANG532 -KC_LANG6 95 Keyboard LANG68 -KC_LANG7 96 Keyboard LANG78 -KC_LANG8 97 Keyboard LANG88 -KC_LANG9 98 Keyboard LANG98 -KC_ALT_ERASE 99 Keyboard Alternate Erase -KC_SYSREQ 9A Keyboard SysReq/Attention -KC_CANCEL 9B Keyboard Cancel -KC_CLEAR 9C Keyboard Clear -KC_PRIOR 9D Keyboard Prior -KC_RETURN 9E Keyboard Return -KC_SEPARATOR 9F Keyboard Separator -KC_OUT A0 Keyboard Out -KC_OPER A1 Keyboard Oper -KC_CLEAR_AGAIN A2 Keyboard Clear/Again -KC_CRSEL A3 Keyboard CrSel/Props -KC_EXSEL A4 Keyboard ExSel -/* Modifiers */ -KC_LCTRL KC_LCTL E0 Keyboard LeftControl -KC_LSHIFT KC_LSFT E1 Keyboard LeftShift -KC_LALT E2 Keyboard LeftAlt -KC_LGUI E3 Keyboard Left GUI(Windows/Apple/Meta key) -KC_RCTRL KC_RCTL E4 Keyboard RightControl -KC_RSHIFT KC_RSFT E5 Keyboard RightShift -KC_RALT E6 Keyboard RightAlt -KC_RGUI E7 Keyboard Right GUI(Windows/Apple/Meta key) - -/* - * Virtual keycodes - */ -/* System Control */ -KC_SYSTEM_POWER KC_PWR System Power Down -KC_SYSTEM_SLEEP KC_SLEP System Sleep -KC_SYSTEM_WAKE KC_WAKE System Wake -/* Consumer Page */ -KC_AUDIO_MUTE KC_MUTE -KC_AUDIO_VOL_UP KC_VOLU -KC_AUDIO_VOL_DOWN KC_VOLD -KC_MEDIA_NEXT_TRACK KC_MNXT -KC_MEDIA_PREV_TRACK KC_MPRV -KC_MEDIA_STOP KC_MSTP -KC_MEDIA_PLAY_PAUSE KC_MPLY -KC_MEDIA_SELECT KC_MSEL -KC_MAIL KC_MAIL -KC_CALCULATOR KC_CALC -KC_MY_COMPUTER KC_MYCM -KC_WWW_SEARCH KC_WSCH -KC_WWW_HOME KC_WHOM -KC_WWW_BACK KC_WBAK -KC_WWW_FORWARD KC_WFWD -KC_WWW_STOP KC_WSTP -KC_WWW_REFRESH KC_WREF -KC_WWW_FAVORITES KC_WFAV -KC_BRIGHTNESS_UP KC_BRIU -KC_BRIGHTNESS_DOWN KC_BRID -/* Mousekey */ -KC_MS_UP KC_MS_U Mouse Cursor Up -KC_MS_DOWN KC_MS_D Mouse Cursor Down -KC_MS_LEFT KC_MS_L Mouse Cursor Left -KC_MS_RIGHT KC_MS_R Mouse Cursor Right -KC_MS_BTN1 KC_BTN1 Mouse Button 1 -KC_MS_BTN2 KC_BTN2 Mouse Button 2 -KC_MS_BTN3 KC_BTN3 Mouse Button 3 -KC_MS_BTN4 KC_BTN4 Mouse Button 4 -KC_MS_BTN5 KC_BTN5 Mouse Button 5 -KC_MS_WH_UP KC_WH_U Mouse Wheel Up -KC_MS_WH_DOWN KC_WH_D Mouse Wheel Down -KC_MS_WH_LEFT KC_WH_L Mouse Wheel Left -KC_MS_WH_RIGHT KC_WH_R Mouse Wheel Right -KC_MS_ACCEL0 KC_ACL0 Mouse Acceleration 0 -KC_MS_ACCEL1 KC_ACL1 Mouse Acceleration 1 -KC_MS_ACCEL2 KC_ACL2 Mouse Acceleration 2 -/* Fn key */ -KC_FN0 -KC_FN1 -KC_FN2 -KC_FN3 -KC_FN4 -KC_FN5 -KC_FN6 -KC_FN7 -KC_FN8 -KC_FN9 -KC_FN10 -KC_FN11 -KC_FN12 -KC_FN13 -KC_FN14 -KC_FN15 -KC_FN16 -KC_FN17 -KC_FN18 -KC_FN19 -KC_FN20 -KC_FN21 -KC_FN22 -KC_FN23 -KC_FN24 -KC_FN25 -KC_FN26 -KC_FN27 -KC_FN28 -KC_FN29 -KC_FN30 -KC_FN31 -- cgit v1.2.3 From 2ad2b73d685cf25268fa7d3726f45594edee70c4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 7 Dec 2018 16:51:27 -0800 Subject: Add support for PR and Issue templates to QMK_firmware GitHub (#4494) * Add support document * Add Bug Report * Add GitHub Pull Request Template * Feature request issue template * Touch up feature request template * Add 'other issues' template * move support doc * Minor tweaks * More minor tweaks * Spleeling fix Co-Authored-By: drashna * CapiTALization fIXes Co-Authored-By: drashna * Use new issue URL Co-Authored-By: drashna * Add blanck issue template * Update the PR template * Formatting and additional changes * Update docs/support.md Co-Authored-By: drashna --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/support.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 docs/support.md (limited to 'docs') diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 6338d69121..b209c5e0b8 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -88,6 +88,7 @@ * Other Topics * [Using Eclipse with QMK](eclipse.md) + * [Support](support.md) * QMK Internals (In Progress) * [Defines](internals_defines.md) diff --git a/docs/_summary.md b/docs/_summary.md index 6338d69121..b209c5e0b8 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -88,6 +88,7 @@ * Other Topics * [Using Eclipse with QMK](eclipse.md) + * [Support](support.md) * QMK Internals (In Progress) * [Defines](internals_defines.md) diff --git a/docs/support.md b/docs/support.md new file mode 100644 index 0000000000..5c275b07e4 --- /dev/null +++ b/docs/support.md @@ -0,0 +1,43 @@ +# Support + +If you need help with something, the best place to get quick support is going to be on our [Discord Server](https://discord.gg/Uq7gcHh). There is usually somebody online, and there are a bunch of very helpful people there. + +Don't forget to read our [Code of Conduct](https://qmk.fm/coc/). + +## Help! I don't know where to start! + +If this is the case, then you should start with our [Newbs Guide](https://docs.qmk.fm/#/newbs). There is a lot of great info there, and that should cover everything you need to get started. + +If that's an issue, hop onto the [QMK Configurator](https://config.qmk.fm), as that will handle a majority of what you need there. + +## Help! I'm having issues flashing! + +First, head to the [Compiling/Flashing FAQ Page](https://docs.qmk.fm/#/faq_build). There is a good deal of info there, and you'll find a bunch of solutions to common issues there. + +## Help, I have an issue that isn't covered by the links above + +Okay, that's fine. Then please check the [open issues in our GitHub](https://github.com/qmk/qmk_firmware/issues) to see if somebody is experiencing the same thing (make sure it's not just similar, but actually the same). + +If you can't find anything, then please open a [new issue](https://github.com/qmk/qmk_firmware/issues/new)! + +## What if I found a bug? + +Then please open an [issue](https://github.com/qmk/qmk_firmware/issues/new), and if you know how to fix it, open up a Pull Request on GitHub with the fix. + +## But `git` and `GitHub` are intimidating! + +Don't worry, we have some pretty nice [Guidelines](https://docs.qmk.fm/#/newbs_best_practices) on how to start using `git` and GitHub to make things easier to develop. + +Additionally, you can find additional `git` and GitHub related links [here](https://docs.qmk.fm/#/newbs_learn_more_resources). + +## I have a Keyboard that I want to add support for + +Awesome! Open up a Pull Request for it. We'll review the code, and merge it! + +### What if I want to do brand it with `QMK`? + +That's amazing! We would love to assist you with that! + +In fact, we have a [whole page](https://qmk.fm/powered/) dedicated to adding QMK Branding to your page and keyboard. This covers pretty much everything you need (knowledge and images) to officially support QMK. + +If you have any questions about this, open an issue or head to [Discord](https://discord.gg/Uq7gcHh). -- cgit v1.2.3 From 13ad6501361faa9433562dba4ea8c55f85bf1dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Sat, 8 Dec 2018 18:42:46 +0100 Subject: Add a better Docker build script + update Dockerfile (#4222) * Add a Docker build script * Add usage and error messages * Add -r to reads Thanks mechmerlin * Add keyboard:keymap form, improve script * Add target argument, change usage forms in script * Add check for more than 3 args in keyboard:keymap:target form * Change Docker base image to debian, use community repo This matches what qmk_compiler uses (https://github.com/qmk/qmk_compiler/blob/master/Dockerfile#L1). I've removed the maintainer as we now have a community build on Docker Hub (https://hub.docker.com/r/qmkfm/qmk_firmware). This Dockerfile will also be maintained by the community. * Change build command format to keyboard:keymap * Call make directly in container run command * Simplify script, remove 3-arg form * Add COPY to Dockerfile so images are usable in and of themselves Also change WORKDIR from /qmk to /qmk_firmware * Add USB pass-through for Linux and docker-machine hosts * Read directly into variables instead of array * Alphabetically sort dependencies in Dockerfile * Set executable bit on util/docker_build.sh * Update Docker docs * Add warning about Docker on Windows * Expand comment in docs * Check docker-machine exit code instead of string * Only match --help with whole arguments * Make script POSIX-compliant * Convert script indentation to tabs --- docs/getting_started_build_tools.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'docs') diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index 67bbe54344..375e9d108f 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -123,24 +123,27 @@ If you have trouble and want to ask for help, it is useful to generate a *Win_Ch ## Docker -If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap: - +If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker CE](https://docs.docker.com/install/#supported-platforms), run the following command from the `qmk_firmware` directory to build a keyboard/keymap: ```bash -# You'll run this every time you want to build a keymap -# modify the keymap and keyboard assignment to compile what you want -# defaults are ergodox/default - -docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware +util/docker_build.sh keyboard:keymap +# For example: util/docker_build.sh ergodox_ez:steno ``` +This will compile the targeted keyboard/keymap and leave the resulting `.hex` or `.bin` file in the QMK directory for you to flash. If `:keymap` is omitted, the `default` keymap is used. Note that the parameter format is the same as when building with `make`. -On Windows Docker seems to have issues with the VOLUME tag in Dockerfile, and `$('pwd')` won't print a Windows compliant path; use full path instead, like this: - +You can also start the script without any parameters, in which case it will ask you to input the build parameters one by one, which you may find easier to use: ```bash -docker run -e keymap=default -e keyboard=ergodox_ez --rm -v D:/Users/Sacapuces/Documents/Repositories/qmk:/qmk:rw edasque/qmk_firmware +util/docker_build.sh +# Reads parameters as input (leave blank for defaults) +``` +There is also support for building _and_ flashing the keyboard straight from Docker by specifying the `target` as well: +```bash +util/docker_build.sh keyboard:keymap:target +# For example: util/docker_build.sh planck/rev6:default:dfu-util ``` +If you're on Linux, this should work out of the box. On Windows and macOS, it requires [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) to be running. This is tedious to set up, so it's not recommended; use QMK Toolbox instead. -This will compile the targeted keyboard/keymap and leave it in your QMK directory for you to flash. +!> Docker for Windows requires [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) to be enabled. This means that it cannot work on versions of Windows which don't have Hyper-V, such as Windows 7, Windows 8 and **Windows 10 Home**. ## Vagrant If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [vagrant guide](getting_started_vagrant.md). -- cgit v1.2.3 From 16302be5adfa0f094e95f734b432c96460b79a6e Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 9 Dec 2018 23:26:09 +0100 Subject: docs typo (#4584) --- docs/feature_encoders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index 036c6a1d89..208d6db13c 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md @@ -13,7 +13,7 @@ and this to your `config.h`: Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.: #define ENCODERS_PAD_A { encoder1a, encoder2a } - #define ENCODERS_PAD_B { encoder1a, encoder2b } + #define ENCODERS_PAD_B { encoder1b, encoder2b } If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions. -- cgit v1.2.3 From fb900e2ad173c569ca97a57c076e32ca4a06fa76 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 11 Dec 2018 09:11:35 -0800 Subject: Fix macro docs to be consistent with keyboard template (#4600) --- docs/feature_macros.md | 158 +++++++++++++++++++++++++++---------------------- 1 file changed, 88 insertions(+), 70 deletions(-) (limited to 'docs') diff --git a/docs/feature_macros.md b/docs/feature_macros.md index ba5d91882f..29ba29fef7 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -12,24 +12,28 @@ Here is an example `keymap.c` for a two-key keyboard: ```c enum custom_keycodes { - MY_CUSTOM_MACRO = SAFE_RANGE + QMKBEST = SAFE_RANGE, }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case MY_CUSTOM_MACRO: - SEND_STRING("QMK is the best thing ever!"); // this is our macro! - return false; - } - } - return true; + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + + } + return true; }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { - {MY_CUSTOM_MACRO, KC_ESC} - } + [0] = { + {QMKBEST, KC_ESC} + } }; ``` @@ -37,7 +41,7 @@ What happens here is this: We first define a new custom keycode in the range not occupied by any other keycodes. Then we use the `process_record_user` function, which is called whenever a key is pressed or released, to check if our custom keycode has been activated. If yes, we send the string `"QMK is the best thing ever!"` to the computer via the `SEND_STRING` macro (this is a C preprocessor macro, not to be confused with QMK macros). -We return `false` to indicate to the caller that the key press we just processed need not be processed any further. +We return `true` to indicate to the caller that the key press we just processed should continue to be processed as normal (as we didn't replace or alter the functionality). Finally, we define the keymap so that the first button activates our macro and the second button is just an escape button. You might want to add more than one macro. @@ -45,28 +49,42 @@ You can do that by adding another keycode and adding another case to the switch ```c enum custom_keycodes { - MY_CUSTOM_MACRO = SAFE_RANGE, - MY_OTHER_MACRO + QMKBEST = SAFE_RANGE, + QMKURL, + MY_OTHER_MACRO }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case MY_CUSTOM_MACRO: - SEND_STRING("QMK is the best thing ever!"); - return false; - case MY_OTHER_MACRO: - SEND_STRING(SS_LCTRL("ac")); // selects all and copies - return false; - } - } - return true; + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + case MY_OTHER_MACRO: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("ac")); // selects all and copies + } + break; + } + return true; }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { - {MY_CUSTOM_MACRO, MY_OTHER_MACRO} - } + [0] = { + {MY_CUSTOM_MACRO, MY_OTHER_MACRO} + } }; ``` @@ -136,21 +154,21 @@ By default QMK assumes you don't have any macros. To define your macros you crea ```c const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch(id) { - case 0: - return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); - case 1: - return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); - } - } - return MACRO_NONE; + if (record->event.pressed) { + switch(id) { + case 0: + return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); + case 1: + return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); + } + } + return MACRO_NONE; }; ``` This defines two macros which will be run when the key they are assigned to is pressed. If instead you'd like them to run when the key is released you can change the if statement: - if (!record->event.pressed) { + if (!record->event.pressed) { ### Macro Commands @@ -169,21 +187,21 @@ Use the `M()` function within your `KEYMAP()` to call a macro. For example, here ```c const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( - M(0), M(1) - ), + [0] = KEYMAP( + M(0), M(1) + ), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch(id) { - case 0: - return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); - case 1: - return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); - } - } - return MACRO_NONE; + if (record->event.pressed) { + switch(id) { + case 0: + return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); + case 1: + return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); + } + } + return MACRO_NONE; }; ``` @@ -198,9 +216,9 @@ If you have a bunch of macros you want to refer to from your keymap while keepin #define M_BYE M(1) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( - M_HI, M_BYE - ), + [0] = KEYMAP( + M_HI, M_BYE + ), }; ``` @@ -213,11 +231,11 @@ There are some functions you may find useful in macro-writing. Keep in mind that This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is ```c - if (record->event.pressed) { - // on keydown - } else { - // on keyup - } + if (record->event.pressed) { + // on keydown + } else { + // on keyup + } ``` ### `register_code();` @@ -250,16 +268,16 @@ This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V ```c const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: { - if (record->event.pressed) { - return MACRO( D(LCTL), T(C), U(LCTL), END ); - } else { - return MACRO( D(LCTL), T(V), U(LCTL), END ); - } - break; - } - } - return MACRO_NONE; + switch(id) { + case 0: { + if (record->event.pressed) { + return MACRO( D(LCTL), T(C), U(LCTL), END ); + } else { + return MACRO( D(LCTL), T(V), U(LCTL), END ); + } + break; + } + } + return MACRO_NONE; }; ``` -- cgit v1.2.3 From 28fbf84cc5ff52f545011ea4198a6cc6d054f896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Wed, 12 Dec 2018 19:17:19 +0100 Subject: Add standard definitions for ALGR and KC_ALGR (#4389) * Add standard ALGR defition, remove (re)definitions from language files * Use ALGR(kc) consistently in ALTGR(kc) aliases * Non-Nordic keymaps should not use NO_ALGR * Add standard KC_ALGR definition * Update docs with ALGR and KC_ALGR * Update SS_ALGR and ALGR_T aliases --- docs/feature_advanced_keycodes.md | 4 ++-- docs/keycodes.md | 4 ++-- docs/keycodes_basic.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index bb5cb7419b..e5f241f7f1 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -68,7 +68,7 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown |`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | |`RCTL(kc)`| |Hold Right Control and press `kc` | |`RSFT(kc)`| |Hold Right Shift and press `kc` | -|`RALT(kc)`| |Hold Right Alt and press `kc` | +|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | |`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | @@ -92,7 +92,7 @@ The modifiers this keycode and `OSM()` accept are prefixed with `MOD_`, not `KC_ |`MOD_LGUI`|Left GUI (Windows/Command/Meta key) | |`MOD_RCTL`|Right Control | |`MOD_RSFT`|Right Shift | -|`MOD_RALT`|Right Alt | +|`MOD_RALT`|Right Alt (AltGr) | |`MOD_RGUI`|Right GUI (Windows/Command/Meta key) | |`MOD_HYPR`|Hyper (Left Control, Shift, Alt and GUI)| |`MOD_MEH` |Meh (Left Control, Shift, and Alt) | diff --git a/docs/keycodes.md b/docs/keycodes.md index 75b01389c5..d12a85aa15 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -177,7 +177,7 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | |`KC_RCTRL` |`KC_RCTL` |Right Control | |`KC_RSHIFT` |`KC_RSFT` |Right Shift | -|`KC_RALT` | |Right Alt | +|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) | |`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key) | |`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | |`KC_SYSTEM_SLEEP` |`KC_SLEP` |System Sleep | @@ -331,7 +331,7 @@ This is a reference only. Each group of keys links to the page documenting their |`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | |`RCTL(kc)`| |Hold Right Control and press `kc` | |`RSFT(kc)`| |Hold Right Shift and press `kc` | -|`RALT(kc)`| |Hold Right Alt and press `kc` | +|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | |`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 9cc00f0325..cba876d346 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -116,7 +116,7 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07 |`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | |`KC_RCTRL` |`KC_RCTL` |Right Control | |`KC_RSHIFT`|`KC_RSFT` |Right Shift | -|`KC_RALT` | |Right Alt | +|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) | |`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)| ## International -- cgit v1.2.3 From 9e6ee4777995a1ac3dfd7aa4454b0a4ed825d663 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Thu, 13 Dec 2018 18:05:50 -0800 Subject: Added noeeprom versions of set hue, sat, val, and step --- docs/feature_rgblight.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'docs') diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 4610467b02..52d5c5fe8a 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -161,6 +161,24 @@ If you need to change your RGB lighting in code, for example in a macro to chang |`rgblight_sethsv(h, s, v)` |Set all LEDs to the given HSV value where `h` is between 0 and 360 and `s`/`v` are between 0 and 255 | |`rgblight_sethsv_noeeprom(h, s, v)`|Set all LEDs to the given HSV value where `h` is between 0 and 360 and `s`/`v` are between 0 and 255 (not written to EEPROM) | |`rgblight_sethsv_at(h, s, v, led)` |Set a single LED to the given HSV value, where `h` is between 0 and 360, `s`/`v` are between 0 and 255, and `led` is between 0 and `RGBLED_NUM` (not written to EEPROM)| +|`rgblight_toggle()` |Toggle all LEDs between on and off | +|`rgblight_toggle_noeeprom()` |Toggle all LEDs between on and off (not written to EEPROM) | +|`rgblight_step()` |Change the mode to the next RGB animation in the list of enabled RGB animations | +|`rgblight_step_noeeprom()` |Change the mode to the next RGB animation in the list of enabled RGB animations (not written to EEPROM) | +|`rgblight_step_reverse()` |Change the mode to the previous RGB animation in the list of enabled RGB animations | +|`rgblight_step_reverse_noeeprom()` |Change the mode to the previous RGB animation in the list of enabled RGB animations (not written to EEPROM) | +|`rgblight_increase_hue()` |Increase the hue for all LEDs. This wraps around at maximum hue | +|`rgblight_increase_hue_noeeprom()` |Increase the hue for all LEDs. This wraps around at maximum hue (not written to EEPROM) | +|`rgblight_decrease_hue()` |Decrease the hue for all LEDs. This wraps around at minimum hue | +|`rgblight_decrease_hue_noeeprom()` |Decrease the hue for all LEDs. This wraps around at minimum hue (not written to EEPROM) | +|`rgblight_increase_sat()` |Increase the saturation for all LEDs. This wraps around at maximum saturation | +|`rgblight_increase_sat_noeeprom()` |Increase the saturation for all LEDs. This wraps around at maximum saturation (not written to EEPROM) | +|`rgblight_decrease_sat()` |Decrease the saturation for all LEDs. This wraps around at minimum saturation | +|`rgblight_decrease_sat_noeeprom()` |Decrease the saturation for all LEDs. This wraps around at minimum saturation (not written to EEPROM) | +|`rgblight_increase_val()` |Increase the value for all LEDs. This wraps around at maximum value | +|`rgblight_increase_val_noeeprom()` |Increase the value for all LEDs. This wraps around at maximum value (not written to EEPROM) | +|`rgblight_decrease_val()` |Decrease the value for all LEDs. This wraps around at minimum value | +|`rgblight_decrease_val_noeeprom()` |Decrease the value for all LEDs. This wraps around at minimum value (not written to EEPROM) | Additionally, [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h) defines several predefined shortcuts for various colors. Feel free to add to this list! -- cgit v1.2.3 From 641bbeb41af87feb01882e9f8a252312d2665a6a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 07:36:38 -0800 Subject: Remove userspace info from Quad-Function Tap Dance example (#4631) --- docs/feature_tap_dance.md | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) (limited to 'docs') diff --git a/docs/feature_tap_dance.md b/docs/feature_tap_dance.md index b2b567f1d0..f2f2749440 100644 --- a/docs/feature_tap_dance.md +++ b/docs/feature_tap_dance.md @@ -185,29 +185,11 @@ Below is a specific example: ## Setup -You will need a few things that can be used for 'Quad Function Tap-Dance'. The suggested setup is to create a user directory for yourself. This directory will contain rules.mk `.c` and `.h`. This directory should be called ``, and located in the top level `users` directory. There should already be a few examples to look at there. +You will need a few things that can be used for 'Quad Function Tap-Dance'. -### In `/qmk_firmware/users//rules.mk` +You'll need to add these to the top of your `keymap.c` file, before your keymap. -Put the following: ```c -TAP_DANCE_ENABLE = yes -SRC += your_name.c -``` - -Pretty simple. It is a nice way to keep some rules common on all your keymaps. - - -### In `/qmk_firmware/users//.h` - -You will need a few things in this file: - -```c -#pragma once - -#include "quantum.h" -#include "process_keycode/process_tap_dance.h" - typedef struct { bool is_press_action; int state; @@ -234,18 +216,12 @@ int cur_dance (qk_tap_dance_state_t *state); //for the x tap dance. Put it here so it can be used in any keymap void x_finished (qk_tap_dance_state_t *state, void *user_data); void x_reset (qk_tap_dance_state_t *state, void *user_data); -``` -### In `/qmk_firmware/users//.c` +``` -And then in your user's `.c` file you implement the functions above: +Now, at the bottom of your `keymap.c` file, you'll need to add the following: ```c -#include ".h" -#include "quantum.h" -#include "action.h" -#include "process_keycode/process_tap_dance.h" - /* Return an integer that corresponds to what kind of tap dance should be executed. * * How to figure out tap dance state: interrupted and pressed. @@ -335,4 +311,6 @@ qk_tap_dance_action_t tap_dance_actions[] = { }; ``` -And then simply use `TD(X_CTL)` anywhere in your keymap after including `.h`. +And then simply use `TD(X_CTL)` anywhere in your keymap. + +If you want to implement this in your userspace, then you may want to check out how [DanielGGordon](https://github.com/qmk/qmk_firmware/tree/master/users/gordon) has implemented this in their userspace. -- cgit v1.2.3 From 6c6bbff600cd37416bdf067ac67971c58136129f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 07:37:27 -0800 Subject: Enhance documentation for Tap-Hold functions (#4628) --- docs/feature_advanced_keycodes.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index e5f241f7f1..bda4972331 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -161,8 +161,13 @@ For one shot mods, you need to call `set_oneshot_mods(MOD)` to set it, or `clear !> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. +# Tap-Hold Configuration Options -# Permissive Hold +While Tap-Hold options are fantastic, they are not without their issues. We have tried to configure them with reasonal defaults, but that may still cause issues for some people. + +These options let you modify the behavior of the Tap-Hold keys. + +## Permissive Hold As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option: @@ -185,7 +190,7 @@ Normally, if you do all this within the `TAPPING_TERM` (default: 200ms) this wil ?> If you have `Ignore Mod Tap Interrupt` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. -# Ignore Mod Tap Interrupt +## Ignore Mod Tap Interrupt To enable this setting, add this to your `config.h`: @@ -211,7 +216,7 @@ Normally, this would send `X` (`SHIFT`+`x`). With `Ignore Mod Tap Interrupt` ena ?> If you have `Permissive Hold` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. -# Tapping Force Hold +## Tapping Force Hold To enable `tapping force hold`, add the following to your `config.h`: @@ -235,7 +240,7 @@ With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allo !> `TAPPING_FORCE_HOLD` will break anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tapping Toggle). -# Retro Tapping +## Retro Tapping To enable `retro tapping`, add the following to your `config.h`: -- cgit v1.2.3 From 8c3054777a9d86613fd9d73cca1fdfaee54a6eff Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 07:51:17 -0800 Subject: Docs: Remove duplicate layer block in keycodes.md (#4621) * Docs: Remove duplicate layer block in keycodes.md Reorder and add OSL * remove glitch Co-Authored-By: drashna --- docs/keycodes.md | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'docs') diff --git a/docs/keycodes.md b/docs/keycodes.md index d12a85aa15..468b59f84f 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -288,15 +288,16 @@ This is a reference only. Each group of keys links to the page documenting their ## [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers) -|Key |Description | -|-----------------|---------------------------------------------------------------------| -|`DF(layer)` |Switches the default layer | -|`MO(layer)` |Momentarily activates layer, switches off when you let go | -|`LM(layer, mod)` |As `MO(layer)` but with `mod` active | -|`LT(layer, kc)` |Momentarily activates layer if held, sends kc if tapped | -|`TG(layer)` |Toggles the layer (enables it if no active, and vise versa) | -|`TO(layer)` |Activates layer and deactivates all other layers | -|`TT(layer)` |Momentarily activates layer if held, toggles it if tapped repeatedly | +|Key |Description | +|----------------|----------------------------------------------------------------------------------| +|`DF(layer)` |Set the base (default) layer | +|`MO(layer)` |Momentarily turn on `layer` when pressed (requires `KC_TRNS` on destination layer)| +|`OSL(layer)` |Momentarily activates `layer` until a key is pressed. See [One Shot Keys](https://docs.qmk.fm/#/feature_advanced_keycodes?id=one-shot-keys) for details. | +|`LM(layer, mod)`|Momentarily turn on `layer` (like MO) with `mod` active as well. +|`LT(layer, kc)` |Turn on `layer` when held, `kc` when tapped | +|`TG(layer)` |Toggle `layer` on or off | +|`TO(layer)` |Turn on `layer` when pressed | +|`TT(layer)` |Normally acts like MO unless it's tapped multiple times, which toggles `layer` on | ## [Mouse Keys](feature_mouse_keys.md) @@ -431,18 +432,6 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_RIGHT_ANGLE_BRACKET`|`KC_RABK`, `KC_GT` |`>` | |`KC_QUESTION` |`KC_QUES` |`?` | -## [Switching and Toggling Layers](feature_advanced_keycodes.md#switching-and-toggling-layers) - -|Key |Description | -|----------------|----------------------------------------------------------------------------------| -|`LT(layer, kc)` |Turn on `layer` when held, `kc` when tapped | -|`TO(layer)` |Turn on `layer` when pressed | -|`MO(layer)` |Momentarily turn on `layer` when pressed (requires `KC_TRNS` on destination layer)| -|`DF(layer)` |Set the base (default) layer | -|`TG(layer)` |Toggle `layer` on or off | -|`TT(layer)` |Normally acts like MO unless it's tapped multiple times, which toggles `layer` on | -|`LM(layer, mod)`|Momentarily turn on `layer` (like MO) with `mod` active as well. | - ## [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) |Key |Description | -- cgit v1.2.3 From 80dfd34fe454f8dde67145fef51eb82ef7ea2e45 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 07:52:11 -0800 Subject: Add additional resource links (#4594) * Add additional resource links And fix a typo or two * Update docs/newbs.md Co-Authored-By: drashna * Wordsmithing Co-Authored-By: drashna --- docs/newbs.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/newbs.md b/docs/newbs.md index e687fd2279..4f115c3c78 100644 --- a/docs/newbs.md +++ b/docs/newbs.md @@ -6,13 +6,17 @@ Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built y ## Overview -There are 5 main sections to this guide: +There are 6 main sections to this guide: * [Getting Started](newbs_getting_started.md) * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) -* [Best Practices](newbs_best_practices.md) +* [Git Best Practices](newbs_best_practices.md) * [Learn More with these Resources](newbs_learn_more_resources.md) This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md). + +## Additional Resources + +* [Thomas Baart's QMK Basics Blog](https://thomasbaart.nl/category/mechanical-keyboards/firmware/qmk/qmk-basics/) – A user-created blog covering the basics of how to use QMK Firmware, as seen from a new user's perspective. -- cgit v1.2.3 From 02d44beb4410b806cb8c38e272941d212fee8a74 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 09:01:58 -0800 Subject: Fix up tap_code functionality (#4609) * Add delay in Tap Code to avoid issues I think a few people have reporting issues with it working properly, and it may be a timing issue. The 'register_code' uses this sort of delay in some of the functions, and this is probably why. Adding the 100ms delay should hopefully fix any issues with it. * Make tap_code delay configurable * Update documentation * Bring tap_code16 inline with changes * Fix type for tap_code16 Bad copy-paste job * Just use the value check for the define * Clarify timing in docs Co-Authored-By: drashna * Wordsmithing Co-Authored-By: drashna --- docs/config_options.md | 2 ++ docs/feature_macros.md | 2 ++ 2 files changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index b811fa877d..69fecc8b49 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -160,6 +160,8 @@ If you define these options you will enable the associated feature, which may in * Set this to the number of combos that you're using in the [Combo](feature_combo.md) feature. * `#define COMBO_TERM 200` * how long for the Combo keys to be detected. Defaults to `TAPPING_TERM` if not defined. +* `#define TAP_CODE_DELAY 100` + * Sets the delay between `register_code` and `unregister_code`, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds. ## RGB Light Configuration diff --git a/docs/feature_macros.md b/docs/feature_macros.md index 29ba29fef7..aa13fb97f4 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -250,6 +250,8 @@ Parallel to `register_code` function, this sends the `` keyup event to the c This will send `register_code()` and then `unregister_code()`. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it). +If you're having issues with taps (un)registering, you can add a delay between the register and unregister events by setting `#define TAP_CODE_DELAY 100` in your `config.h` file. The value is in milliseconds. + ### `clear_keyboard();` This will clear all mods and keys currently pressed. -- cgit v1.2.3 From 9739d6ba0ad3da93f42cc28a78a6722d39ad3d72 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 10:43:24 -0800 Subject: Docs: Clarify audio keycodes (#4620) * Clarify audio keycodes * Spelling errors Co-Authored-By: drashna * Spacing in md Co-Authored-By: drashna * Fix midi link too * Wordsmithing --- docs/feature_audio.md | 10 ++++++---- docs/keycodes.md | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/feature_audio.md b/docs/feature_audio.md index a39c456873..38861e8c14 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -61,9 +61,11 @@ It's advised that you wrap all audio features in `#ifdef AUDIO_ENABLE` / `#endif The available keycodes for audio are: -* `AU_ON` - Turn audio mode on -* `AU_OFF` - Turn audio mode off -* `AU_TOG` - Toggle audio mode +* `AU_ON` - Turn Audio Feature on +* `AU_OFF` - Turn Audio Feature off +* `AU_TOG` - Toggle Audio Feature state + +!> These keycodes turn all of the audio functionality on and off. Turning it off means that audio feedback, audio clicky, music mode, etc. are disabled, completely. ## ARM Audio Volume @@ -158,7 +160,7 @@ You can configure the default, min and max frequencies, the stepping and built i ## MIDI Functionality -This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile. +This is still a WIP, but check out `quantum/process_keycode/process_midi.c` to see what's happening. Enable from the Makefile. ## Audio Keycodes diff --git a/docs/keycodes.md b/docs/keycodes.md index 468b59f84f..6d85253935 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -226,9 +226,9 @@ This is a reference only. Each group of keys links to the page documenting their |Key |Aliases |Description | |----------------|---------|----------------------------------| -|`AU_ON` | |Audio mode on | -|`AU_OFF` | |Audio mode off | -|`AU_TOG` | |Toggles Audio mode | +|`AU_ON` | |Turns on Audio Feature | +|`AU_OFF` | |Turns off Audio Feature | +|`AU_TOG` | |Toggles Audio state | |`CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode | |`CLICKY_UP` |`CK_UP` |Increases frequency of the clicks | |`CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks | -- cgit v1.2.3 From 155e9310ff685f557287749bef2e02510538a6d9 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Sat, 15 Dec 2018 04:00:10 +0900 Subject: Make quantum/split_common/serial.[ch] configurable (#4419) * add temporary compile test shell script * add 'CONFIG_H += serial_backward_compatibility.h' into common_features.mk:SPLIT_KEYBOARD block * add quantum/split_common/serial_backward_compatibility.h SERIAL_PIN_PORT and other PIN define move to serial_backward_compatibility.h SERIAL_BACKLIT_START move to split_util.h * quantum/split_common/serial.c change to helix-serial.c style serial configuration * add temporary file quantum/split_common/split-keyboards-list.txt * add '#define SOFT_SERIAL_PIN D0' to keyboards/6lit/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/divergetm2/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/ergotravel/rev1/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/foobar/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/handwired/dactyl_manuform/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/handwired/qc60/config.h * add '//#define SOFT_SERIAL_PIN D0' to keyboards/handwired/xealous/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/iris/rev*/config.h * add '//#define SOFT_SERIAL_PIN D0' to keyboards/lets_split_eh/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/levinson/rev*/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/miniaxe/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/nyquist/rev?/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/quefrency/rev1/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/qwertyydox/config.h,keyboards/qwertyydox/rev1/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/redox/rev1/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/rorschach/rev1/config.h * remove '#define SOFT_SERIAL_PIN D0' from quantum/split_common/serial_backward_compatibility.h * remove temporary file quantum/split_common/split-keyboards-list.txt * remove temporary compile test shell script * Revert "remove temporary compile test shell script" This reverts commit 15b0021b4092127b8d8a21f572642ad3702b46d4. * update quantum/split_common/compile_split_test.sh for new keyboard test * add '#define SOFT_SERIAL_PIN D0' to keyboards/diverge3/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/40percentclub/25/config.h * remove temporary compile test shell script * update docs/config_options.md, quantum/template/avr/config.h * fix quantum/template/avr/config.h * fix typo docs/config_options.md --- docs/config_options.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index 69fecc8b49..bea4acb010 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -198,6 +198,9 @@ Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in yo * `#define USE_I2C` * For using I2C instead of Serial (defaults to serial) +* `#define SOFT_SERIAL_PIN D0` + * When using serial, define this. `D0` or `D1`,`D2`,`D3`,`E6`. + # The `rules.mk` File 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. -- cgit v1.2.3 From 3ec4a00bfc090fc440480336e3273b459074aa18 Mon Sep 17 00:00:00 2001 From: Alexander Kagno Date: Sat, 15 Dec 2018 08:29:24 -0700 Subject: Per Key Leader Timing Option (#4026) * leader changes to enable per key timing option * Changes requested to docs for @drashna * Changes requested by @drashna --- docs/config_options.md | 6 +++++- docs/feature_leader_key.md | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index bea4acb010..fb1655e9a3 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -143,6 +143,8 @@ If you define these options you will enable the associated feature, which may in * Breaks any Tap Toggle functionality (`TT` or the One Shot Tap Toggle) * `#define LEADER_TIMEOUT 300` * how long before the leader key times out +* `#define LEADER_PER_KEY_TIMING` + * sets the timer for leader key chords to run on each key press rather than overall * `#define ONESHOT_TIMEOUT 300` * how long before oneshot times out * `#define ONESHOT_TAP_TOGGLE 2` @@ -194,7 +196,7 @@ Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in yo * `#define SPLIT_HAND_PIN B7` * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace 'B7' with the pin you are using. This is optional and you can still use the EEHANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. - + * `#define USE_I2C` * For using I2C instead of Serial (defaults to serial) @@ -252,6 +254,8 @@ Use these to enable or disable building certain features. The more you have enab * Enable the audio subsystem. * `RGBLIGHT_ENABLE` * Enable keyboard underlight functionality +* `LEADER_ENABLE` + * Enable leader key chording * `MIDI_ENABLE` * MIDI controls * `UNICODE_ENABLE` diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 92aebd463d..9b49e0fd96 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -47,3 +47,26 @@ To add support for Leader Key you simply need to add a single line to your keyma ``` LEADER_ENABLE = yes ``` + +## Per Key Timing on Leader keys + +Rather than relying on an incredibly high timeout for long leader key strings or those of us without 200wpm typing skills, we can enable per key timing to ensure that each key pressed provides us with more time to finish our stroke. This is incredibly helpful with leader key emulation of tap dance (read: multiple taps of the same key like C, C, C). + +In order to enable this, place this in your `config.h`: +``` +#define LEADER_PER_KEY_TIMING +``` + +After this, it's recommended that you lower your `LEADER_TIMEOUT` to something less that 300ms. + +``` +#define LEADER_TIMEOUT 250 +``` + +Now, something like this won't seem impossible to do without a 1000MS leader key timeout: + +``` +SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { + SEND_STRING("Per key timing is great!!!"); +} +``` -- cgit v1.2.3 From fdeec296369c0995bad1117e50946b2df84f35e4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 19 Dec 2018 08:39:24 -0800 Subject: Overhaul Unicode Common functionality (#4325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix spacing Co-Authored-By: drashna * Because I missed it! Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * SPAAAAAAAAAACing Co-Authored-By: drashna * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna * non-breaking Co-Authored-By: drashna * Considered that Co-Authored-By: drashna * Yuuup Co-Authored-By: drashna * consistency Co-Authored-By: drashna * white spaces .... copied from elsewhere Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna * remove merge artifacts * Unicode common cleanup (#17) * Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix white spaces Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * Because I missed it! Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * SPAAAAAAAAAACing Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna * non-breaking Co-Authored-By: drashna * Considered that Co-Authored-By: drashna * Yuuup Co-Authored-By: drashna * consistency Co-Authored-By: drashna * white spaces .... copied from elsewhere Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna * Rearrange process_unicode_common functions * Make Unicode input mode constants (UC_*) an enum * Simplify unicode_input_start/finish code * Make the key used for WinCompose configurable * Remove UC_OSX_RALT in favor of setting the key with UNICODE_OSX_KEY * Update Unicode input mode doc * Add descriptions and rearrange definitions in process_unicode_common.h * Add registry command to Unicode docs + misc updates * Reword an explanation in Unicode docs * Add TODO comment * Remove trailing whitespace * Improve Cycling documentation * Add Unicode Input method Cycling support (#19) * Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix white spaces Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * Because I missed it! Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * SPAAAAAAAAAACing Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna * non-breaking Co-Authored-By: drashna * Considered that Co-Authored-By: drashna * Yuuup Co-Authored-By: drashna * consistency Co-Authored-By: drashna * white spaces .... copied from elsewhere Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna * Rearrange process_unicode_common functions * Make Unicode input mode constants (UC_*) an enum * Simplify unicode_input_start/finish code * Make the key used for WinCompose configurable * Remove UC_OSX_RALT in favor of setting the key with UNICODE_OSX_KEY * Update Unicode input mode doc * Add descriptions and rearrange definitions in process_unicode_common.h * Add registry command to Unicode docs + misc updates * Reword an explanation in Unicode docs * Add TODO comment * Add cycle_unicode_input_mode and UNICODE_SELECTED_MODES macro * Add an option for making cycle changes persistent * Add debug prints to functions that change input_mode * Use cycle_unicode_input_mode in whitefox/konstantin * Add persist_unicode_input_mode function * Add offset to cycle to allow stepping in reverse * Add keycodes: UNICODE_MODE_FORWARD, UNICODE_MODE_REVERSE Aliases: UC_MOD, UC_RMOD (respectively) * REVERT ME: Undo changes to whitefox/konstantin to avoid conflicts * Fix wrong constant name * Revert "REVERT ME: Undo changes to whitefox/konstantin to avoid conflicts" This reverts commit 42676bf251fc8e3823f5e614dad6e510ba47a2f3. * Change dprintf text * Give selected modes priority over EEPROM when !UNICODE_CYCLE_PERSIST * Remove trailing whitespace * Cleanup of RALT code and unicode compilation stuff * Remove else for unicode handling --- docs/feature_unicode.md | 133 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 97 insertions(+), 36 deletions(-) (limited to 'docs') diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index c98a402287..1b083896a2 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -1,28 +1,28 @@ # Unicode Support -There are three Unicode keymap definition method available in QMK: +There are three Unicode keymap definition methods available in QMK: ## UNICODE_ENABLE -Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in keymap file, where *n* is a 4 digit hexadecimal. +Supports Unicode up to `0xFFFF`. The keycode function is `UC(n)` in the keymap file, where _n_ is a 4 digit hexadecimal number. ## UNICODEMAP_ENABLE -Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(n)` where *n* is the array index of the mapping table. +Supports Unicode up to `0x10FFFF` (all possible code points). You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(n)`, where _n_ is an array index into the mapping table. And you may want to have an enum to make reference easier. So you'd want to add something like this to your keymap: ```c -enum unicode_name { - BANG, // ‽ - IRONY, // ⸮ - SNEK // snke 🐍 +enum unicode_names { + BANG, + IRONY, + SNEK, }; const uint32_t PROGMEM unicode_map[] = { - [BANG] = 0x0203D, // ‽ - [IRONY] = 0x02E2E, // ⸮ - [SNEK] = 0x1F40D // snke 🐍 + [BANG] = 0x203D, // ‽ + [IRONY] = 0x2E2E, // ⸮ + [SNEK] = 0x1F40D, // 🐍 }: ``` @@ -30,7 +30,7 @@ Make sure that the order for both matches. ## UCIS_ENABLE -Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to maintain a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence. +Supports Unicode up to `0x10FFFF` (all possible code points). As with `UNICODEMAP`, you may want to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you will have to add a keycode or function that calls `qk_ucis_start()`. Once it's been called, you can type the mnemonic for your character, then hit Space or Enter to complete it or Esc to cancel. If the mnemonic matches an entry in your table, the typed text will automatically be erased and the corresponding Unicode sequence inserted. For instance, you would need to have a table like this in your keymap: @@ -53,42 +53,103 @@ There are several functions that you can add to your keymap to customize the fun * `void qk_ucis_success(uint8_t symbol_index)` - This runs when the unicode input has matched something, and has completed. Default doesn't do anything. * `void qk_ucis_symbol_fallback (void)` - This runs if the input text doesn't match anything. The default function falls back to trying that input as a unicode code. -The default code for these are: +You can find the default implementations of these functions in [`process_ucis.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_ucis.c). + +## Input Modes + +Unicode input in QMK works by inputting a sequence of characters to the OS, sort of like a macro. Unfortunately, the way this is done differs for each platform. Specifically, each platform requires a different combination of keys to trigger Unicode input. Therefore, a corresponding input mode has to be set in QMK. + +The following input modes are available: + +* **`UC_OSX`**: Mac OS X built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`). + + To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar. + By default, this mode uses the left Option key (`KC_LALT`), but this can be changed by defining [`UNICODE_OSX_KEY`](#input-key-configuration) with another keycode. + +* **`UC_LNX`**: Linux built-in IBus Unicode input. Supports all possible code points (`0x10FFFF`). + + Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else. + +* **`UC_WIN`**: _(not recommended)_ Windows built-in hex numpad Unicode input. Supports code points up to `0xFFFF`. + + To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Afterwards, reboot. + This mode is not recommended because of reliability and compatibility issues; use the `UC_WINC` mode instead. + +* **`UC_BSD`**: _(non implemented)_ Unicode input under BSD. Not implemented at this time. If you're a BSD user and want to help add support for it, please [open an issue on GitHub](https://github.com/qmk/qmk_firmware/issues). + +* **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.8.2, supports code points up to `0xFFFFF`. + + To enable, install the [latest release](https://github.com/samhocevar/wincompose/releases/latest). Once installed, WinCompose will automatically run on startup. Works reliably under all version of Windows supported by the app. + By default, this mode uses the right Alt key (`KC_RALT`), but this can be changed in the WinCompose settings and by defining [`UNICODE_WINC_KEY`](#input-key-configuration) with another keycode. + +### Switching Input Modes + +There are two ways to set the input mode for Unicode: by keycode or by function. Keep in mind that both methods write to persistent storage (EEPROM), and are loaded each time the keyboard starts. So once you've set it the first time, you don't need to set it again unless you want to change it, or you've reset the EEPROM settings. + +You can switch the input mode at any time by using one of the following keycodes. The easiest way is to add the ones you use to your keymap. + +|Keycode |Alias |Input mode |Description | +|-----------------------|---------|-------------|-----------------------------------------| +|`UNICODE_MODE_FORWARD` |`UC_MOD` | |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)| +|`UNICODE_MODE_REVERSE` |`UC_RMOD`| |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)| +|`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to Mac OS X input. | +|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input. | +|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input. | +|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented). | +|`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose.| + +You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). Since the function only needs to be called once, it's recommended that you do it in `eeconfig_init_user` (or a similar function). For example: ```c -void qk_ucis_start_user(void) { // outputs keyboard emoji - unicode_input_start(); - register_hex(0x2328); - unicode_input_finish(); +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_LNX); } +``` -void qk_ucis_success(uint8_t symbol_index) { -} +### Audio Feedback -void qk_ucis_symbol_fallback (void) { // falls back to manual unicode entry - for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) { - uint8_t code = qk_ucis_state.codes[i]; - register_code(code); - unregister_code(code); - wait_ms(UNICODE_TYPE_DELAY); - } -} +If you have the [Audio feature](feature_audio.md) enabled on the board, you can set melodies to be played when you press the above keys. That way you can have some audio feedback when switching input modes. + +For instance, you can add these definitions to your `config.h` file: + +```c +#define UNICODE_SONG_OSX COIN_SOUND +#define UNICODE_SONG_LNX UNICODE_LINUX +#define UNICODE_SONG_BSD MARIO_GAMEOVER +#define UNICODE_SONG_WIN UNICODE_WINDOWS +#define UNICODE_SONG_WINC UNICODE_WINDOWS ``` -## Unicode Input methods +### Additional Customization + +Because Unicode is such a large and variable feature, there are a number of options that you can customize to work better on your system. + +#### Start and Finish input functions + +The functions for starting and finishing Unicode input on your platform can be overridden locally. Possible uses include customizing input mode behavior if you don't use the default keys, or adding extra visual/audio feedback to Unicode input. + +* `void unicode_input_start(void)` – This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it presses Ctrl+Shift+U on Linux and holds the Option key on Mac. +* `void unicode_input_finish(void)` – This is called to exit Unicode input mode, for example by pressing Space or releasing the Option key. -Unicode input in QMK works by inputting a sequence of characters to the OS, -sort of like macro. Unfortunately, each OS has different ideas on how Unicode is input. +You can find the default implementations of these functions in [`process_unicode_common.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode_common.c). -This is the current list of Unicode input method in QMK: -* __UC_OSX__: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. -* __UC_OSX_RALT__: Same as UC_OSX, but sends the Right Alt key for unicode input -* __UC_LNX__: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. -* __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. +#### Input Key Configuration -At some point, you need to call `set_unicode_input_mode(x)` to set the correct unicode method. This sets the method that is used to send the unicode, and stores it in EEPROM, so you only need to call this once. +Additionally, you can customize the keys used to trigger the unicode input for macOS and WinCompose by adding defines to your `config.h` + +```c +#define UNICODE_OSX_KEY KC_LALT +#define UNICODE_WINC_KEY KC_RALT +``` + +#### Input Method Cycling + +Also, you can choose which input methods are availble for cycling through. By default, this is disabled. But if you want to enabled it, then limiting it to just those modes makes sense. Note that `UNICODE_SELECTED_MODES` define is comma delimited. + +```c +#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_BSD, UC_WINC +``` ## `send_unicode_hex_string` -- cgit v1.2.3 From 639585314863912480c9967fc38bb2d9418a34ab Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 20 Dec 2018 08:58:12 -0800 Subject: Docs: Add additional clarification to Leader Key documention (#4660) * Add clarification for Leader Timeout * Add additional documentatin to config_options.md * Add leader_start() and leader_end() documentation * Add Examples * Clarify timout * Remove customization * Improve docs based on feedback * Better clarification of features * Fix example * Spelling/grammar issue * Spelling and clarification --- docs/config_options.md | 1 + docs/feature_leader_key.md | 82 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 76 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index fb1655e9a3..879761a402 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -143,6 +143,7 @@ If you define these options you will enable the associated feature, which may in * Breaks any Tap Toggle functionality (`TT` or the One Shot Tap Toggle) * `#define LEADER_TIMEOUT 300` * how long before the leader key times out + * If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. * `#define LEADER_PER_KEY_TIMING` * sets the timer for leader key chords to run on each key press rather than overall * `#define ONESHOT_TIMEOUT 300` diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 9b49e0fd96..168a1fc1c8 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -5,10 +5,11 @@ If you've ever used Vim, you know what a Leader key is. If not, you're about to That's what `KC_LEAD` does. Here's an example: 1. Pick a key on your keyboard you want to use as the Leader key. Assign it the keycode `KC_LEAD`. This key would be dedicated just for this -- it's a single action key, can't be used for anything else. -2. Include the line `#define LEADER_TIMEOUT 300` in your config.h. The 300 there is 300ms -- that's how long you have for the sequence of keys following the leader. You can tweak this value for comfort, of course. -3. Within your `matrix_scan_user` function, do something like this: +2. Include the line `#define LEADER_TIMEOUT 300` in your `config.h`. This sets the timeout for the `KC_LEAD` key. Specifically, when you press the `KC_LEAD` key, you only have a certain amount of time to complete the Leader Key sequence. The `300` here sets that to 300ms, and you can increase this value to give you more time to hit the sequence. But any keys pressed during this timeout are intercepted and not sent, so you may want to keep this value low. . + * By default, this timeout is how long after pressing `KC_LEAD` to complete your entire sequence. This may be very low for some people. So you may want to increase this timeout. Optionally, you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. This allows you to maintain a low value here, but still be able to use the longer sequences. To enable this option, add `#define LEADER_PER_KEY_TIMING` to your `config.h`. +3. Within your `matrix_scan_user` function, add something like this: -``` +```c LEADER_EXTERNS(); void matrix_scan_user(void) { @@ -44,7 +45,7 @@ Each of these accepts one or more keycodes as arguments. This is an important po To add support for Leader Key you simply need to add a single line to your keymap's `rules.mk`: -``` +```make LEADER_ENABLE = yes ``` @@ -53,20 +54,87 @@ LEADER_ENABLE = yes Rather than relying on an incredibly high timeout for long leader key strings or those of us without 200wpm typing skills, we can enable per key timing to ensure that each key pressed provides us with more time to finish our stroke. This is incredibly helpful with leader key emulation of tap dance (read: multiple taps of the same key like C, C, C). In order to enable this, place this in your `config.h`: -``` +```c #define LEADER_PER_KEY_TIMING ``` After this, it's recommended that you lower your `LEADER_TIMEOUT` to something less that 300ms. -``` +```c #define LEADER_TIMEOUT 250 ``` Now, something like this won't seem impossible to do without a 1000MS leader key timeout: -``` +```c SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { SEND_STRING("Per key timing is great!!!"); } ``` + +## Customization + +The Leader Key feature has some additional customization to how the Leader Key feature works. It has two functions that can be called at certain parts of the process. Namely `leader_start()` and `leader_end()`. + +The `leader_start()` function is called when you tap the `KC_LEAD` key, and the `leader_end()` function is called when either the leader sequence is completed, or the leader timeout is hit. + +You can add these functions to your code (`keymap.c` usually) to add feedback to the Leader sequences (such as beeping or playing music). + +```c +void leader_start(void) { + // sequence started +} + +void leader_end(void) { + // sequence ended (no success/failuer detection) +} +``` + +### Example + +This example will play the Mario "One Up" sound when you hit `KC_LEAD` to start the Leader Sequence, and will play "All Star" if it completes successfully or "Rick Roll" you if it fails. + +```c +bool did_leader_succeed; +#ifdef AUDIO_ENABLE +float leader_start[][2] = SONG(ONE_UP_SOUND ); +float leader_succeed[][2] = SONG(ALL_STAR); +float leader_fail[][2] = SONG(RICK_ROLL); +#endif +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + did_leader_succeed = leading = false; + + SEQ_ONE_KEY(KC_E) { + // Anything you can do in a macro. + SEND_STRING(SS_LCTRL(SS_LSFT("t"))); + did_leader_succeed = true; + } else + SEQ_TWO_KEYS(KC_E, KC_D) { + SEND_STRING(SS_LGUI("r")"cmd"SS_TAP(KC_ENTER)SS_LCTRL("c")); + did_leader_succeed = true; + } + leader_end(); + } +} + +void leader_start(void) { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_start); +#endif +} + +void leader_end(void) { + if (did_leader_succeed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_succeed); +#endif + } else { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_fail); +#endif + } +} +``` -- cgit v1.2.3 From afd5cda4a0d832bacfff319177fe93968f686a11 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 20 Dec 2018 16:54:06 -0800 Subject: Fix up process_leader to be a bit more optimized (#4662) * Fix up process_leader to be a bit more optimized * Process dual function keys better * Make leader start a callable function * Fix per key timer call location * Add escape if already leading * Return false for KC_LEAD * Add documentation --- docs/config_options.md | 2 ++ docs/feature_leader_key.md | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index 879761a402..4bbc5debda 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -146,6 +146,8 @@ If you define these options you will enable the associated feature, which may in * If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. * `#define LEADER_PER_KEY_TIMING` * sets the timer for leader key chords to run on each key press rather than overall +* `#define LEADER_KEY_STRICT_KEY_PROCESSING` + * Disables keycode filtering for Mod-Tap and Layer-Tap keycodes. Eg, if you enable this, you would need to specify `MT(MOD_CTL, KC_A)` if you want to use `KC_A`. * `#define ONESHOT_TIMEOUT 300` * how long before oneshot times out * `#define ONESHOT_TAP_TOGGLE 2` diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 168a1fc1c8..82cf789017 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -72,6 +72,12 @@ SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { } ``` +## Strict Key Processing + +By default, the Leader Key feature will filter the keycode out of [`Mod-Tap`](feature_advanced_keycodes.md#mod-tap) and [`Layer Tap`](feature_advanced_keycodes.md#switching-and-toggling-layers) functions when checking for the Leader sequences. That means if you're using `LT(3, KC_A)`, it will pick this up as `KC_A` for the sequence, rather than `LT(3, KC_A)`, giving a more expected behavior for newer users. + +While, this may be fine for most, if you want to specify the whole keycode (eg, `LT(3, KC_A)` from the example above) in the sequence, you can enable this by added `#define LEADER_KEY_STRICT_KEY_PROCESSING` to your `config.h` file. This well then disable the filtering, and you'll need to specify the whole keycode. + ## Customization The Leader Key feature has some additional customization to how the Leader Key feature works. It has two functions that can be called at certain parts of the process. Namely `leader_start()` and `leader_end()`. -- cgit v1.2.3 From ca3564753526fc866d6195ab6b957781070a64f8 Mon Sep 17 00:00:00 2001 From: Gergely Peidl Date: Fri, 21 Dec 2018 14:38:21 +0100 Subject: Feature Unicode example code fixed. --- docs/feature_unicode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index 1b083896a2..9d57e2fb7a 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -23,7 +23,7 @@ const uint32_t PROGMEM unicode_map[] = { [BANG] = 0x203D, // ‽ [IRONY] = 0x2E2E, // ⸮ [SNEK] = 0x1F40D, // 🐍 -}: +}; ``` Make sure that the order for both matches. -- cgit v1.2.3 From fbcbf4492685108a7f257df4e06871abd9def4d7 Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Fri, 28 Dec 2018 10:31:15 -0800 Subject: Update feature_advanced_keycodes.md (#3672) * Update feature_advanced_keycodes.md Probably a better way to word it, but I've solved this issue on reddit several times, had to solve this for friends, ect. It's something worth being in the docs as it's a common issue, and not always intuitive. I have offered this change as I was told by several people "It was never mentioned in the docs". * Update feature_advanced_keycodes.md Clear up what was meant to be said. --- docs/feature_advanced_keycodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index bda4972331..8c0a22fc67 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -21,7 +21,7 @@ Additionally, if at least one right-handed modifier is specified in a Mod Tap or # Switching and Toggling Layers -These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. For a detailed explanation of layers, see [Keymap Overview](keymap.md#keymap-and-layers) +These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. For a detailed explanation of layers, see [Keymap Overview](keymap.md#keymap-and-layers) When using momentary layer switching with MO(), LM(), TT(), or LT(), make sure to leave the key on the above layers transparent or it may not work as intended. * `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).) * `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. -- cgit v1.2.3 From c0859ac096f1e4251351bb0a5a04b3ae4a9451f4 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 28 Dec 2018 16:02:53 -0500 Subject: Update split keyboard docs (#4735) * Remove unused I2C_MASTER_RIGHT setting * Update documentation about split keyboard options --- docs/config_options.md | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config_options.md b/docs/config_options.md index 4bbc5debda..085ab3ee58 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -197,8 +197,27 @@ If you define these options you will enable the associated feature, which may in Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk -* `#define SPLIT_HAND_PIN B7` - * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace 'B7' with the pin you are using. This is optional and you can still use the EEHANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. +### Setting Handedness + +One thing to remember, the side that the USB port is plugged into is always the master half. The side not plugged into USB is the slave. + +There are a few different ways to set handedness for split keyboards (listed in order of precedence): + +1. Set `SPLIT_HAND_PIN`: Reads a pin to determine handedness. If pin is high, it's the left side, if low, the half is determined to be the right side +2. Set `EE_HANDS` and flash `eeprom-lefthand.eep`/`eeprom-righthand.eep` to each half +3. Set `MASTER_RIGHT`: Half that is plugged into the USB port is determined to be the master and right half (inverse of the default) +4. Default: The side that is plugged into the USB port is the master half and is assumed to be the left half. The slave side is the right half + +* `#define SPLIT_HAND_PIN B7` + * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace `B7` with the pin you are using. This is optional, and if you leave `SPLIT_HAND_PIN` undefined, then you can still use the EE_HANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. + +* `#define EE_HANDS` (only works if `SPLIT_HAND_PIN` is not defined) + * Reads the handedness value stored in the EEPROM after `eeprom-lefthand.eep`/`eeprom-righthand.eep` has been flashed to their respective halves. + +* `#define MASTER_RIGHT` + * Master half is defined to be the right half. + +### Other Options * `#define USE_I2C` * For using I2C instead of Serial (defaults to serial) @@ -206,6 +225,20 @@ Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in yo * `#define SOFT_SERIAL_PIN D0` * When using serial, define this. `D0` or `D1`,`D2`,`D3`,`E6`. +* `#define MATRIX_ROW_PINS_RIGHT { }` +* `#define MATRIX_COL_PINS_RIGHT { }` + * If you want to specify a different pinout for the right half than the left half, you can define `MATRIX_ROW_PINS_RIGHT`/`MATRIX_COL_PINS_RIGHT`. Currently, the size of `MATRIX_ROW_PINS` must be the same as `MATRIX_ROW_PINS_RIGHT` and likewise for the definition of columns. + +* `#define SELECT_SOFT_SERIAL_SPEED ` (default speed is 1) + * Sets the protocol speed when using serial communication + * Speeds: + * 0: about 189kbps (Experimental only) + * 1: about 137kbps (default) + * 2: about 75kbps + * 3: about 39kbps + * 4: about 26kbps + * 5: about 20kbps + # The `rules.mk` File 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. -- cgit v1.2.3