~ruther/qmk_firmware

42a37577e155554734efb7622e23e67dc55f99ad — Joel Challis 11 months ago c3b06ef
Remove redundant keymap templates (#23685)

12 files changed, 186 insertions(+), 192 deletions(-)

D keyboards/dumbpad/v0x/templates/keymap.c
M keyboards/dumbpad/v0x/v0x.c
D keyboards/dumbpad/v0x_dualencoder/templates/keymap.c
M keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c
D keyboards/dumbpad/v0x_right/templates/keymap.c
M keyboards/dumbpad/v0x_right/v0x_right.c
D keyboards/dumbpad/v1x/templates/keymap.c
M keyboards/dumbpad/v1x/v1x.c
D keyboards/dumbpad/v1x_dualencoder/templates/keymap.c
M keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
D keyboards/dumbpad/v1x_right/templates/keymap.c
M keyboards/dumbpad/v1x_right/v1x_right.c
D keyboards/dumbpad/v0x/templates/keymap.c => keyboards/dumbpad/v0x/templates/keymap.c +0 -26
@@ 1,26 0,0 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};


bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    }
    return true;
}

M keyboards/dumbpad/v0x/v0x.c => keyboards/dumbpad/v0x/v0x.c +25 -0
@@ 61,3 61,28 @@ void matrix_init_kb(void) {

    matrix_init_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }

    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    }
    return true;
}

D keyboards/dumbpad/v0x_dualencoder/templates/keymap.c => keyboards/dumbpad/v0x_dualencoder/templates/keymap.c +0 -44
@@ 1,44 0,0 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};


bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    } else if (index == 1) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_VOLU);
                } else {
                    tap_code(KC_VOLD);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_RIGHT);
                } else {
                    tap_code(KC_LEFT);
                }
                break;
        }
    }
    return true;
}

M keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c => keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c +43 -0
@@ 61,3 61,46 @@ void matrix_init_kb(void) {

    matrix_init_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }

    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    } else if (index == 1) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_VOLU);
                } else {
                    tap_code(KC_VOLD);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_RIGHT);
                } else {
                    tap_code(KC_LEFT);
                }
                break;
        }
    }
    return true;
}

D keyboards/dumbpad/v0x_right/templates/keymap.c => keyboards/dumbpad/v0x_right/templates/keymap.c +0 -26
@@ 1,26 0,0 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};


bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    }
    return true;
}

M keyboards/dumbpad/v0x_right/v0x_right.c => keyboards/dumbpad/v0x_right/v0x_right.c +25 -0
@@ 61,3 61,28 @@ void matrix_init_kb(void) {

    matrix_init_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }

    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    }
    return true;
}

D keyboards/dumbpad/v1x/templates/keymap.c => keyboards/dumbpad/v1x/templates/keymap.c +0 -26
@@ 1,26 0,0 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};


bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    }
    return true;
}

M keyboards/dumbpad/v1x/v1x.c => keyboards/dumbpad/v1x/v1x.c +25 -0
@@ 73,3 73,28 @@ bool led_update_kb(led_t led_state) {
    }
    return res;
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }

    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    }
    return true;
}

D keyboards/dumbpad/v1x_dualencoder/templates/keymap.c => keyboards/dumbpad/v1x_dualencoder/templates/keymap.c +0 -44
@@ 1,44 0,0 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};


bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    } else if (index == 1) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_VOLU);
                } else {
                    tap_code(KC_VOLD);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_RIGHT);
                } else {
                    tap_code(KC_LEFT);
                }
                break;
        }
    }
    return true;
}

M keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c => keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c +43 -0
@@ 73,3 73,46 @@ bool led_update_kb(led_t led_state) {
    }
    return res;
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }

    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    } else if (index == 1) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_VOLU);
                } else {
                    tap_code(KC_VOLD);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_RIGHT);
                } else {
                    tap_code(KC_LEFT);
                }
                break;
        }
    }
    return true;
}

D keyboards/dumbpad/v1x_right/templates/keymap.c => keyboards/dumbpad/v1x_right/templates/keymap.c +0 -26
@@ 1,26 0,0 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};


bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    }
    return true;
}

M keyboards/dumbpad/v1x_right/v1x_right.c => keyboards/dumbpad/v1x_right/v1x_right.c +25 -0
@@ 73,3 73,28 @@ bool led_update_kb(led_t led_state) {
    }
    return res;
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }

    if (index == 0) {
        switch (get_highest_layer(layer_state)) {
            case 0:
                if (clockwise) {
                    tap_code(KC_MS_R);
                } else {
                    tap_code(KC_MS_L);
                }
                break;

            default:
                if (clockwise) {
                    tap_code(KC_EQL);
                } else {
                    tap_code(KC_MINS);
                }
                break;
        }
    }
    return true;
}

Do not follow this link