Skip to content

Commit

Permalink
Remove redundant keymap templates (qmk#23685)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored and Ardakilic committed Sep 10, 2024
1 parent 79f5f99 commit 2c2ba67
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 192 deletions.
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

0 comments on commit 2c2ba67

Please sign in to comment.