Skip to content

Commit

Permalink
Migrate ACTION_LAYER_MOMENTARYs to MO() (qmk#5176)
Browse files Browse the repository at this point in the history
* Migrate ACTION_LAYER_MOMENTARYs to MO()

* Add changelog entry

* Update docs/ChangeLog/20190830/PR5176.md

Co-Authored-By: skullydazed <[email protected]>
  • Loading branch information
fauxpark and skullydazed committed Aug 30, 2019
1 parent 986d30c commit 071944e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 4 additions & 0 deletions docs/ChangeLog/20190830/PR5176.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* Migrating `ACTION_LAYER_MOMENTARY()` entries in `fn_actions` to `MO()` keycodes
* `fn_actions` is deprecated, and its functionality has been superseded by direct keycodes and `process_record_user()`
* The end result of removing this obsolete feature should result in a decent reduction in firmware size and code complexity
* All keymaps affected are recommended to switch away from `fn_actions` in favour of the [custom keycode](https://docs.qmk.fm/#/custom_quantum_functions) and [macro](https://docs.qmk.fm/#/feature_macros) features
1 change: 0 additions & 1 deletion layouts/community/60_iso/unxmaal/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ enum function_id {
};

const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(2), // Momentary Fn overlay
[1] = ACTION_LAYER_TOGGLE(1), // Toggle Arrow Layer overlay
[2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS), // Tap to toggle caps lock and hold to activate function layer
[3] = ACTION_LAYER_TOGGLE(3), // Toggle Underglow Layer overlay
Expand Down
1 change: 0 additions & 1 deletion layouts/community/ergodox/guni/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ const uint16_t PROGMEM fn_actions[] = {
//[29] = ACTION_LAYER_TOGGLE(4),
[29] = ACTION_MODS_TAP_KEY(MOD_RSFT,KC_ESC),
[30] = ACTION_LAYER_TAP_KEY(1, KC_QUOT),
[31] = ACTION_LAYER_MOMENTARY(2),
//[] = ACTION_LAYER_TAP_KEY(4, KC_S),
};

Expand Down
8 changes: 2 additions & 6 deletions layouts/community/ergodox/ishigoya-jp/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_RCTL, KC_LGUI, KC_LALT,JP_UNDS,KC_LCTL,
KC_BTN3, KC_DEL,
KC_NO,
KC_SPC,KC_LSFT,F(1),
KC_SPC,KC_LSFT,MO(NUM),
// right hand
LCTL(KC_Z), KC_NO, LSFT(KC_4), JP_AT, KC_LEFT, KC_UP, KC_RIGHT,
KC_PGUP, KC_J, KC_F, KC_U, KC_P, KC_DOWN, LSFT(KC_3),
Expand Down Expand Up @@ -187,7 +187,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_NO,
M(SHIFT), M(JPFN), F(1),
M(SHIFT), M(JPFN), MO(NUM),
// right hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, M(JPFU), M(JPSE), M(JPTSU), M(JPKU), KC_TRNS, KC_TRNS,
Expand Down Expand Up @@ -415,10 +415,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};

const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_MOMENTARY(NUM) // FN1 - Momentary Layer 6 (Numbers)
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
KC_TAB, M(KC_Q), M(KC_W), M(KC_E), M(KC_R), M(KC_T), KC_LBRC,
M(KC_CAPS), M(KC_A), M(KC_S), M(KC_D), M(KC_F), M(KC_G),
KC_LSFT, M(KC_Z), M(KC_X), M(KC_C), M(KC_V), M(KC_B), KC_FN0,
KC_LSFT, M(KC_Z), M(KC_X), M(KC_C), M(KC_V), M(KC_B), MO(SYMB),
KC_LCTL, KC_LALT, KC_LGUI, KC_LEFT, KC_RGHT,
KC_TRNS, KC_FN1,
KC_HOME,
Expand All @@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_GRV, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL,
KC_RBRC, M(KC_Y), M(KC_U), M(KC_I), M(KC_O), M(KC_P), KC_BSLS,
M(KC_H), M(KC_J), M(KC_K), M(KC_L), KC_SCLN, KC_QUOT,
KC_FN0, M(KC_N), M(KC_M), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
MO(SYMB), M(KC_N), M(KC_M), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_DOWN, KC_UP, KC_RCTL, KC_RGUI, KC_RALT,
KC_RALT, KC_RCTL,
KC_PGUP,
Expand Down Expand Up @@ -148,12 +148,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_MOMENTARY(SYMB), // FN0 - Momentary Layer 1 (Symbols)
ACTION_LAYER_ON(SYMB,ON_RELEASE), // FN1 - Enable Layer 1 (Symbols)
ACTION_LAYER_ON(MDIA,ON_RELEASE), // FN2 - Enable Layer 2 (Media)
ACTION_LAYER_OFF(SYMB,ON_RELEASE), // FN3 - Disable Layer 1 (Symbols)
ACTION_LAYER_OFF(MDIA,ON_RELEASE), // FN4 - Disable Layer 2 (MMedia)
ACTION_LAYER_MOMENTARY(MDIA) // FN5 - Momentary Layer 2 (Mdia)
[1] = ACTION_LAYER_ON(SYMB,ON_RELEASE), // FN1 - Enable Layer 1 (Symbols)
[2] = ACTION_LAYER_ON(MDIA,ON_RELEASE), // FN2 - Enable Layer 2 (Media)
[3] = ACTION_LAYER_OFF(SYMB,ON_RELEASE), // FN3 - Disable Layer 1 (Symbols)
[4] = ACTION_LAYER_OFF(MDIA,ON_RELEASE), // FN4 - Disable Layer 2 (MMedia)
};


Expand Down

0 comments on commit 071944e

Please sign in to comment.