summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDidier Loiseau <didierloiseau+git@gmail.com>2016-02-07 23:22:48 +0100
committerDidier Loiseau <didierloiseau+git@gmail.com>2016-02-07 23:33:37 +0100
commita2f6ab16c001c1cc456882457aec6c7d7999fd1c (patch)
treec4cf30ffb96a55878e0430b11a44e85a5fa05113
parent7ba42b994babfa5f6b7dff5bdb779d8d06a9bb30 (diff)
downloadqmk_firmware-a2f6ab16c001c1cc456882457aec6c7d7999fd1c.tar.gz
qmk_firmware-a2f6ab16c001c1cc456882457aec6c7d7999fd1c.tar.xz
FN macro: use layer_invert() instead of modifying layer_state directly
- fixes stuck keys from the temporary layers (see also jackhumbert/qmk_firmware#78) - removed the workaround for jackhumbert/qmk_firmware#81 (using layer_invert() fixes the problem)
-rw-r--r--keyboard/ergodox_ez/keymaps/tm2030/keymap.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/keyboard/ergodox_ez/keymaps/tm2030/keymap.c b/keyboard/ergodox_ez/keymaps/tm2030/keymap.c
index 4ab0f7cc3..975460479 100644
--- a/keyboard/ergodox_ez/keymaps/tm2030/keymap.c
+++ b/keyboard/ergodox_ez/keymaps/tm2030/keymap.c
@@ -11,9 +11,6 @@
#define MDBL0 1
#define MFNLR 2
-#define MCUT 3
-#define MCOPY 4
-#define MPSTE 5
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Basic layer
@@ -178,7 +175,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM,
- KC_TRNS, KC_TRNS, M(MCUT), M(MCOPY), M(MPSTE), KC_MUTE, KC_VOLD,
+ KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
@@ -210,22 +207,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
}
break;
case MFNLR:
- layer_state ^= (1 << NUMR) | (1 << FNLR);
- break;
- case MCUT:
- if (record->event.pressed) {
- return MACRO(D(LSFT), T(DELT), U(LSFT), END);
- }
- break;
- case MCOPY:
- if (record->event.pressed) {
- return MACRO(D(LCTL), T(INS), U(LCTL), END);
- }
- break;
- case MPSTE:
- if (record->event.pressed) {
- return MACRO(D(LSFT), T(INS), U(LSFT), END);
- }
+ layer_invert(NUMR);
+ layer_invert(FNLR);
break;
}
return MACRO_NONE;