Remove redundant keymap templates (#23685)

This commit is contained in:
Joel Challis 2024-05-09 12:06:21 +01:00 committed by GitHub
parent c3b06efb1d
commit 42a37577e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 186 additions and 192 deletions

View File

@ -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;
}

View File

@ -61,3 +61,28 @@ void matrix_init_kb(void) {
matrix_init_user(); 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;
}

View File

@ -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;
}

View File

@ -61,3 +61,46 @@ void matrix_init_kb(void) {
matrix_init_user(); 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;
}

View File

@ -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;
}

View File

@ -61,3 +61,28 @@ void matrix_init_kb(void) {
matrix_init_user(); 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;
}

View File

@ -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;
}

View File

@ -73,3 +73,28 @@ bool led_update_kb(led_t led_state) {
} }
return res; 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;
}

View File

@ -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;
}

View File

@ -73,3 +73,46 @@ bool led_update_kb(led_t led_state) {
} }
return res; 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;
}

View File

@ -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;
}

View File

@ -73,3 +73,28 @@ bool led_update_kb(led_t led_state) {
} }
return res; 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;
}