Skip to content

Commit

Permalink
Remove unused fn_actions[] and action_function() in default keymaps (q…
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored and mechmerlin committed Jan 24, 2019
1 parent 5d1ea88 commit b5feae0
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 153 deletions.
35 changes: 0 additions & 35 deletions keyboards/alu84/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include QMK_KEYBOARD_H
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))

#define _BL 0
#define _FN1 1
Expand Down Expand Up @@ -108,37 +107,3 @@ void led_set_user(uint8_t usb_led) {
}

}

enum function_id {
SHIFT_ESC,
};

const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
};

void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
}
}
37 changes: 0 additions & 37 deletions keyboards/amjpad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include "rgblight.h"
#endif

// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))

// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
Expand Down Expand Up @@ -66,37 +63,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_P0, LT(_FL,KC_PDOT), KC_PENT \
),
};

enum function_id {
SHIFT_ESC,
};

const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
};

void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
}
}
4 changes: 0 additions & 4 deletions keyboards/bface/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS
), // */
};

const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1),
};
5 changes: 0 additions & 5 deletions keyboards/cospad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_P0, RESET, KC_PENT),
};


const uint16_t PROGMEM fn_actions[] = {
[0] = MO(_FL),
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case BL_TOGG:
Expand Down
6 changes: 0 additions & 6 deletions keyboards/cu75/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers
ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape
};


const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
Expand Down
6 changes: 0 additions & 6 deletions keyboards/cu75/keymaps/iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers
ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape
};


const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
Expand Down
4 changes: 0 additions & 4 deletions keyboards/ergodox_ez/keymaps/testing/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

};

const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(1)
};

// leaving this in place for compatibilty with old keymaps cloned and re-compiled.
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
Expand Down
3 changes: 0 additions & 3 deletions keyboards/handwired/traveller/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,8 @@ Right hand nav keys work pretty well chorded with the Right hand Hi Key
const uint16_t PROGMEM fn_actions[] = {
[_QW] = ACTION_LAYER_ON(_QW,ON_RELEASE), // return to QWERTY layer
[_LW] = ACTION_LAYER_TAP_TOGGLE(_LW), // Turn on LW when holding, or tap 3 times to switch
[_HI] = ACTION_LAYER_TAP_TOGGLE(_HI), // Turn on LW when holding, or tap 3 times to switch
[_NAV] = ACTION_LAYER_TOGGLE(_NAV),
[_FKEYS] = ACTION_LAYER_TOGGLE(_FKEYS),
[_LWOUT] = ACTION_LAYER_OFF(_LW,ON_RELEASE),
[_HIOUT] = ACTION_LAYER_OFF(_HI,ON_RELEASE),

// Functions
[RGBLED_TOGGLE] = ACTION_FUNCTION(RGBLED_TOGGLE),
Expand Down
6 changes: 0 additions & 6 deletions keyboards/katana60/keymaps/colemak/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

};


const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(CURS, KC_BSPC),
[1] = ACTION_LAYER_TAP_KEY(SYMB, KC_SPACE),
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
Expand Down
6 changes: 0 additions & 6 deletions keyboards/katana60/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

};


const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(CURS, KC_BSPC),
[1] = ACTION_LAYER_TAP_KEY(SYMB, KC_SPACE),
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
Expand Down
2 changes: 1 addition & 1 deletion keyboards/lfkeyboards/lfk87/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \
KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \
MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, \
AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \
AU_TOG, KC_FN1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \
KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, \
XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI \
),
Expand Down
16 changes: 6 additions & 10 deletions keyboards/lfkeyboards/lfk87/keymaps/iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers
ACTION_FUNCTION(LFK_ESC_TILDE), // FN1 - esc+shift = ~, else escape
ACTION_FUNCTION(LFK_LED_TEST), // FN2 - cycle through LEDs for testing
ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN3 - Increase Freq of audio click
ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN4 - Decrease Freq of audio click
ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN5 - Increase length of audio click
ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN6 - Decrease length of audio click
ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN7 - Toggle audio click
ACTION_FUNCTION(LFK_LED_TEST), // FN8 - cycle through LEDs for testing
ACTION_FUNCTION(LFK_DEBUG_SETTINGS), // FN9 - prints LED and click settings to HID
[0] = ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers
[3] = ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN3 - Increase Freq of audio click
[4] = ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN4 - Decrease Freq of audio click
[5] = ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN5 - Increase length of audio click
[6] = ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN6 - Decrease length of audio click
[7] = ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN7 - Toggle audio click
};


Expand Down
2 changes: 1 addition & 1 deletion keyboards/lfkeyboards/mini1800/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[SETTINGS] = LAYOUT(
KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, \
MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, XXXXXXX, \
AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
AU_TOG, KC_FN1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX \
),
Expand Down
12 changes: 5 additions & 7 deletions keyboards/lfkeyboards/smk65/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers
ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click
ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click
ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click
ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click
ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click
[1] = ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click
[2] = ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click
[3] = ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click
[4] = ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click
[5] = ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click
};


const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
Expand Down
11 changes: 5 additions & 6 deletions keyboards/lfkeyboards/smk65/keymaps/iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers
ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click
ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click
ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click
ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click
ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click
[1] = ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click
[2] = ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click
[3] = ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click
[4] = ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click
[5] = ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click
};


Expand Down
6 changes: 0 additions & 6 deletions layouts/community/ergodox/erez_experimental/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};

const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols)
[2] = ACTION_MACRO_TAP(0), // Eric Tang's Famous Macro!
[3] = ACTION_MACRO_TAP(1) // Eric Tang's Famous Macro!
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
return MACRO_NONE;
Expand Down
4 changes: 0 additions & 4 deletions layouts/community/ergodox/reset_eeprom/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};

const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
Expand Down
6 changes: 0 additions & 6 deletions layouts/community/ergodox/robot_test_layout/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};



const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(1)
};

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

0 comments on commit b5feae0

Please sign in to comment.