Skip to content

Commit

Permalink
Make PREVENT_STUCK_MODIFIERS the default (qmk#3107)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Talljoe authored and jackhumbert committed Sep 17, 2018
1 parent b65e214 commit 7434494
Show file tree
Hide file tree
Showing 198 changed files with 91 additions and 599 deletions.
11 changes: 7 additions & 4 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ ifeq ($(strip $(USB_HID_ENABLE)), yes)
include $(TMK_DIR)/protocol/usb_hid.mk
endif


ifeq ($(strip $(HD44780_ENABLE)), yes)
SRC += drivers/avr/hd44780.c
OPT_DEFS += -DHD44780_ENABLE
Expand All @@ -232,11 +231,15 @@ ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/dynamic_keymap.c
endif

ifeq ($(strip $(LEADER_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_leader.c
OPT_DEFS += -DLEADER_ENABLE
endif

QUANTUM_SRC:= \
$(QUANTUM_DIR)/quantum.c \
$(QUANTUM_DIR)/keymap_common.c \
$(QUANTUM_DIR)/keycode_config.c \
$(QUANTUM_DIR)/process_keycode/process_leader.c
$(QUANTUM_DIR)/keycode_config.c

ifndef CUSTOM_MATRIX
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
Expand All @@ -251,5 +254,5 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \
$(QUANTUM_DIR)/split_common/split_util.c \
$(QUANTUM_DIR)/split_common/i2c.c \
$(QUANTUM_DIR)/split_common/serial.c
$(QUANTUM_DIR)/split_common/serial.c
endif
4 changes: 2 additions & 2 deletions docs/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions docs/feature_leader_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion docs/understanding_qmk.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Comparing against our keymap we can see that the pressed key is KC_NLCK. From he
<!-- FIXME: Magic happens between here and process_record -->

##### 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)
Expand All @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions keyboards/1upkeyboards/1up60rgb/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#define RGB_DI_PIN E2
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
Expand Down
7 changes: 2 additions & 5 deletions keyboards/1upkeyboards/sweet16/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define DEVICE_VER 0x0001
#define MANUFACTURER 1up Keyboards
#define PRODUCT Sweet16
#define DESCRIPTION 4x4 grid
#define DESCRIPTION 4x4 grid

/* key matrix size */
#define MATRIX_ROWS 4
Expand Down Expand Up @@ -43,9 +43,6 @@
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#define RGB_DI_PIN B1
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
Expand All @@ -55,4 +52,4 @@
#define RGBLIGHT_VAL_STEP 8
#endif

#endif
#endif
3 changes: 0 additions & 3 deletions keyboards/acr60/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#define RGB_DI_PIN E2
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 20
Expand Down
5 changes: 1 addition & 4 deletions keyboards/alf/x2/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#define RGB_DI_PIN E2
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
Expand All @@ -55,4 +52,4 @@
#define RGBLIGHT_VAL_STEP 8
#endif

#endif
#endif
2 changes: 0 additions & 2 deletions keyboards/alpha/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#define RGB_DI_PIN F4
#ifdef RGB_DI_PIN
Expand Down
3 changes: 0 additions & 3 deletions keyboards/alu84/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#define RGB_DI_PIN E2
#ifdef RGB_DI_PIN
#define RGBLED_NUM 16
Expand Down
3 changes: 0 additions & 3 deletions keyboards/at101_blackheart/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,3 @@
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS
2 changes: 0 additions & 2 deletions keyboards/atreus/keymaps/jeremy/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include "action_layer.h"
#include "keymap_colemak.h"

#define PREVENT_STUCK_MODIFIERS

// Each layer gets a name for readability, which is then used in the keymap matrix below.
#define ALPH 0
#define NUMS 1
Expand Down
4 changes: 1 addition & 3 deletions keyboards/atreus/keymaps/khitsule/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#include "../../config.h"

#define PREVENT_STUCK_MODIFIERS

#define IGNORE_MOD_TAP_INTERRUPT

#endif
#endif
3 changes: 1 addition & 2 deletions keyboards/atreus/keymaps/xk/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ the Free Software Foundation, either version 2 of the License, or
#define MOUSEKEY_WHEEL_MAX_SPEED 8
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40

#define PREVENT_STUCK_MODIFIERS
#define IGNORE_MOD_TAP_INTERRUPT
#define PERMISSIVE_HOLD

#endif
#endif
1 change: 0 additions & 1 deletion keyboards/atreus62/keymaps/mneme/config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#define ONESHOT_TIMEOUT 3000
#define TAPPING_TERM 200
#define PREVENT_STUCK_MODIFIERS
#define FORCE_NKRO
#define LEADER_TIMEOUT 1000

Expand Down
1 change: 1 addition & 0 deletions keyboards/atreus62/keymaps/mneme/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ NKRO_ENABLE = true
MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = no
LEADER_ENABLE = yes
3 changes: 0 additions & 3 deletions keyboards/bfo9000/keymaps/andylikescandy6x18/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define PERMISSIVE_HOLD

#define PREVENT_STUCK_MODIFIERS


#endif
3 changes: 0 additions & 3 deletions keyboards/bigseries/1key/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
false \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN D3
#define RGBLIGHT_ANIMATIONS
Expand Down
3 changes: 0 additions & 3 deletions keyboards/bigseries/2key/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
false \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN D3
#define RGBLIGHT_ANIMATIONS
Expand Down
3 changes: 0 additions & 3 deletions keyboards/bigseries/3key/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
false \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN D3
#define RGBLIGHT_ANIMATIONS
Expand Down
3 changes: 0 additions & 3 deletions keyboards/bigseries/4key/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
false \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN D3
#define RGBLIGHT_ANIMATIONS
Expand Down
2 changes: 0 additions & 2 deletions keyboards/bigswitch/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
false \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN D3
Expand Down
3 changes: 0 additions & 3 deletions keyboards/catch22/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
false \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN F6
#define RGBLIGHT_ANIMATIONS
Expand Down
2 changes: 0 additions & 2 deletions keyboards/chimera_ergo/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* These options are also useful to firmware size reduction.
*/

#define PREVENT_STUCK_MODIFIERS

/* disable debug print */
//#define NO_DEBUG

Expand Down
2 changes: 0 additions & 2 deletions keyboards/chimera_ls/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* These options are also useful to firmware size reduction.
*/

#define PREVENT_STUCK_MODIFIERS

/* disable debug print */
//#define NO_DEBUG

Expand Down
2 changes: 0 additions & 2 deletions keyboards/chimera_ortho/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* These options are also useful to firmware size reduction.
*/

#define PREVENT_STUCK_MODIFIERS

/* disable debug print */
//#define NO_DEBUG

Expand Down
6 changes: 1 addition & 5 deletions keyboards/chocopad/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS


#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_HUE_STEP 8
Expand All @@ -56,4 +52,4 @@
#define ws2812_PORTREG PORTD
#define ws2812_DDRREG DDRD

#endif
#endif
3 changes: 0 additions & 3 deletions keyboards/clueboard/60/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 6

/* Prevent modifiers from being stuck on after layer changes. */
#define PREVENT_STUCK_MODIFIERS

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
Expand Down
1 change: 0 additions & 1 deletion keyboards/clueboard/66/keymaps/bloodlvst/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@

#include "../../config.h"

#define PREVENT_STUCK_MODIFIERS
#define DISABLE_SPACE_CADET_ROLLOVER
#endif
2 changes: 0 additions & 2 deletions keyboards/comet46/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* These options are also useful to firmware size reduction.
*/

#define PREVENT_STUCK_MODIFIERS

/* disable debug print */
//#define NO_DEBUG

Expand Down
4 changes: 0 additions & 4 deletions keyboards/contra/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS


#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 0
Expand Down
5 changes: 2 additions & 3 deletions keyboards/contra/keymaps/ryanm101/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "config_common.h"

#define PREVENT_STUCK_MODIFIERS
#define TAPPING_TERM 200

#ifdef AUDIO_ENABLE
Expand All @@ -28,7 +27,7 @@
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/

#define MIDI_BASIC

/* enable advanced MIDI features:
Expand All @@ -42,4 +41,4 @@
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2

#endif
#endif
3 changes: 0 additions & 3 deletions keyboards/crawlpad/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
false \
)

/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS

#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN D3
#define RGBLIGHT_ANIMATIONS
Expand Down
1 change: 0 additions & 1 deletion keyboards/crkbd/keymaps/default/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define USE_SERIAL_PD2

#define PREVENT_STUCK_MODIFIERS
#define TAPPING_FORCE_HOLD
#define TAPPING_TERM 100

Expand Down
Loading

0 comments on commit 7434494

Please sign in to comment.