Skip to content

Commit

Permalink
Merge branch 'master' into make_unicode_init
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna authored Nov 6, 2018
2 parents 36fce29 + 73e6344 commit 18830a8
Show file tree
Hide file tree
Showing 115 changed files with 4,105 additions and 1,752 deletions.
1 change: 1 addition & 0 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ endif
ifeq ($(strip $(TERMINAL_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c
OPT_DEFS += -DTERMINAL_ENABLE
OPT_DEFS += -DUSER_PRINT
endif

ifeq ($(strip $(USB_HID_ENABLE)), yes)
Expand Down
9 changes: 5 additions & 4 deletions docs/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
63 changes: 47 additions & 16 deletions docs/feature_advanced_keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down Expand Up @@ -171,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:

Expand All @@ -212,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.
10 changes: 5 additions & 5 deletions docs/feature_combo.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
31 changes: 27 additions & 4 deletions docs/flashing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
1 change: 0 additions & 1 deletion docs/keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |

Expand Down
25 changes: 13 additions & 12 deletions docs/quantum_keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, <code>&#96;</code> 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, <code>&#96;</code> 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 |
53 changes: 53 additions & 0 deletions keyboards/6lit/6lit.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* Copyright 2018
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "6lit.h"

void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up

matrix_init_user();
}

void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)

matrix_scan_user();
}

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware

return process_record_user(keycode, record);
}

void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here

led_set_user(usb_led);
}

#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
{{2, 2}, {1, 2}, {0, 2}},
{{2, 3}, {1, 3}, {0, 3}},
{{0, 0}, {1, 0}, {2, 0}},
{{0, 1}, {1, 1}, {2, 1}},
};
#endif
55 changes: 55 additions & 0 deletions keyboards/6lit/6lit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Copyright 2018
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once

#include "quantum.h"
#define ________ KC_NO

#ifndef FLIP_HALF
#define LAYOUT_split( \
L00, L01, L02, R00, R01, R02, \
L10, L11, L12, R10, R11, R12 \
) { \
{ L00, L01, L02 }, \
{ L10, L11, L12 }, \
{ R02, R01, R00 }, \
{ R12, R11, R10 }, \
}
#else
#define LAYOUT_split( \
L00, L01, L02, R00, R01, R02, \
L10, L11, L12, R10, R11, R12 \
) { \
{ L00, L01, L02 }, \
{ L10, L11, L12 }, \
{ R00, R01, R02 }, \
{ R10, R11, R12 }, \
}
#endif

#define LAYOUT_macro( \
L00, L01, L02, \
L10, L11, L12 \
) { \
{ L00, L01, L02 }, \
{ L10, L11, L12 }, \
}

#define LAYOUT LAYOUT_macro

#ifdef USE_I2C
#error "I2C not Supported"
#endif
Loading

0 comments on commit 18830a8

Please sign in to comment.