diff --git a/keyboards/dumbpad/v0x/templates/keymap.c b/keyboards/dumbpad/v0x/templates/keymap.c deleted file mode 100644 index 6f862b822561..000000000000 --- a/keyboards/dumbpad/v0x/templates/keymap.c +++ /dev/null @@ -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; -} diff --git a/keyboards/dumbpad/v0x/v0x.c b/keyboards/dumbpad/v0x/v0x.c index 8625bb12c25a..5a610966066f 100644 --- a/keyboards/dumbpad/v0x/v0x.c +++ b/keyboards/dumbpad/v0x/v0x.c @@ -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; +} diff --git a/keyboards/dumbpad/v0x_dualencoder/templates/keymap.c b/keyboards/dumbpad/v0x_dualencoder/templates/keymap.c deleted file mode 100644 index c602269ed3e1..000000000000 --- a/keyboards/dumbpad/v0x_dualencoder/templates/keymap.c +++ /dev/null @@ -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; -} diff --git a/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c b/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c index 8625bb12c25a..1c622f7bf4e7 100644 --- a/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c +++ b/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c @@ -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; +} diff --git a/keyboards/dumbpad/v0x_right/templates/keymap.c b/keyboards/dumbpad/v0x_right/templates/keymap.c deleted file mode 100644 index 6f862b822561..000000000000 --- a/keyboards/dumbpad/v0x_right/templates/keymap.c +++ /dev/null @@ -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; -} diff --git a/keyboards/dumbpad/v0x_right/v0x_right.c b/keyboards/dumbpad/v0x_right/v0x_right.c index 8625bb12c25a..5a610966066f 100644 --- a/keyboards/dumbpad/v0x_right/v0x_right.c +++ b/keyboards/dumbpad/v0x_right/v0x_right.c @@ -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; +} diff --git a/keyboards/dumbpad/v1x/templates/keymap.c b/keyboards/dumbpad/v1x/templates/keymap.c deleted file mode 100644 index 6f862b822561..000000000000 --- a/keyboards/dumbpad/v1x/templates/keymap.c +++ /dev/null @@ -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; -} diff --git a/keyboards/dumbpad/v1x/v1x.c b/keyboards/dumbpad/v1x/v1x.c index cdbaff54aa19..3fec6cb7e683 100644 --- a/keyboards/dumbpad/v1x/v1x.c +++ b/keyboards/dumbpad/v1x/v1x.c @@ -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; +} diff --git a/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c b/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c deleted file mode 100644 index c602269ed3e1..000000000000 --- a/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c +++ /dev/null @@ -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; -} diff --git a/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c index cdbaff54aa19..31137ce77541 100644 --- a/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c +++ b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c @@ -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; +} diff --git a/keyboards/dumbpad/v1x_right/templates/keymap.c b/keyboards/dumbpad/v1x_right/templates/keymap.c deleted file mode 100644 index 6f862b822561..000000000000 --- a/keyboards/dumbpad/v1x_right/templates/keymap.c +++ /dev/null @@ -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; -} diff --git a/keyboards/dumbpad/v1x_right/v1x_right.c b/keyboards/dumbpad/v1x_right/v1x_right.c index cdbaff54aa19..3fec6cb7e683 100644 --- a/keyboards/dumbpad/v1x_right/v1x_right.c +++ b/keyboards/dumbpad/v1x_right/v1x_right.c @@ -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; +}