Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant keymap templates #23685

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions keyboards/dumbpad/v0x/templates/keymap.c

This file was deleted.

25 changes: 25 additions & 0 deletions keyboards/dumbpad/v0x/v0x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
44 changes: 0 additions & 44 deletions keyboards/dumbpad/v0x_dualencoder/templates/keymap.c

This file was deleted.

43 changes: 43 additions & 0 deletions keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
26 changes: 0 additions & 26 deletions keyboards/dumbpad/v0x_right/templates/keymap.c

This file was deleted.

25 changes: 25 additions & 0 deletions keyboards/dumbpad/v0x_right/v0x_right.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
26 changes: 0 additions & 26 deletions keyboards/dumbpad/v1x/templates/keymap.c

This file was deleted.

25 changes: 25 additions & 0 deletions keyboards/dumbpad/v1x/v1x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
44 changes: 0 additions & 44 deletions keyboards/dumbpad/v1x_dualencoder/templates/keymap.c

This file was deleted.

43 changes: 43 additions & 0 deletions keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
26 changes: 0 additions & 26 deletions keyboards/dumbpad/v1x_right/templates/keymap.c

This file was deleted.

Loading
Loading