[Keymap] Cleanup coffeeislife87 keymap and remove features (#21061)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Fae <faenkhauser@gmail.com>
This commit is contained in:
parent
3a3e5abac9
commit
c2ddd77e0d
@ -52,14 +52,6 @@
|
|||||||
# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// If RGBLight is enabled
|
|
||||||
#ifdef RGBLIGHT_ENABLE
|
|
||||||
# define RGBLED_NUM RGB_MATRIX_LED_COUNT
|
|
||||||
|
|
||||||
# define RGBLIGHT_EFFECT_SNAKE
|
|
||||||
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Feature disable
|
// Feature disable
|
||||||
#ifndef NO_PRINT
|
#ifndef NO_PRINT
|
||||||
# define NO_PRINT
|
# define NO_PRINT
|
||||||
|
@ -4,16 +4,11 @@
|
|||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
enum custom_keycodes {
|
enum custom_keycodes {
|
||||||
NULLKEY = SAFE_RANGE, // An empty key to start (and maybe end) the enum
|
MCR_PLY = QK_USER, // Macro play
|
||||||
#ifdef DYNAMIC_MACRO_ENABLE
|
|
||||||
MCR_PLY, // Macro play
|
|
||||||
MCR_REC, // Macro record
|
MCR_REC, // Macro record
|
||||||
MCR_SWT, // Swap active macro
|
MCR_SWT, // Swap active macro
|
||||||
#endif
|
MS_ACL_U, // Mouse speed up
|
||||||
#ifdef MOUSEKEY_ENABLE
|
MS_ACL_D, // Mouse speed down
|
||||||
MS_ACL_U,
|
|
||||||
MS_ACL_D,
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum layout_names {
|
enum layout_names {
|
||||||
@ -35,25 +30,25 @@ static int current_accel = 0;
|
|||||||
#endif // MOUSEKEY_ENABLE
|
#endif // MOUSEKEY_ENABLE
|
||||||
|
|
||||||
#ifdef DYNAMIC_MACRO_ENABLE
|
#ifdef DYNAMIC_MACRO_ENABLE
|
||||||
// Macro 1 is = 1, Macro 2 = -1, No macro = 0
|
// Macro 1 is = 1, Macro 2 = -1, No macro = 0
|
||||||
static bool MACRO1 = true;
|
static bool MACRO1 = true; // Determines whether or not we're using 1 or 2
|
||||||
static bool RECORDING = false;
|
static bool RECORDING = false;
|
||||||
|
static uint16_t REC = DM_REC1; // Record either macro 1 or 2. Or stop recording
|
||||||
|
static uint16_t PLY = DM_PLY1; // Play either macro 1 or macro 2
|
||||||
|
|
||||||
static uint16_t REC = DM_REC1;
|
void dynamic_macro_record_start_user(int8_t direction) {
|
||||||
static uint16_t PLY = DM_PLY1;
|
|
||||||
|
|
||||||
void dynamic_macro_record_start_user(int8_t direction) {
|
|
||||||
REC = DM_RSTP;
|
REC = DM_RSTP;
|
||||||
RECORDING = true;
|
RECORDING = true;
|
||||||
}
|
}
|
||||||
void dynamic_macro_record_end_user(int8_t direction) {
|
|
||||||
|
void dynamic_macro_record_end_user(int8_t direction) {
|
||||||
RECORDING = false;
|
RECORDING = false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define MCR_PLY KC_NO
|
#define MCR_PLY KC_NO
|
||||||
#define MCR_REC KC_NO
|
#define MCR_REC KC_NO
|
||||||
#define MCR_SWT KC_NO
|
#define MCR_SWT KC_NO
|
||||||
#endif
|
#endif // DYNAMIC_MACRO_ENABLE
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[_END][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[_END][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[_MAIN] = LAYOUT_planck_mit(
|
[_MAIN] = LAYOUT_planck_mit(
|
||||||
@ -84,73 +79,62 @@ const uint16_t PROGMEM keymaps[_END][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
#endif // MOUSEKEY_ENABLE
|
#endif // MOUSEKEY_ENABLE
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LAYER (get_highest_layer(layer_state))
|
|
||||||
#define LAYER_SIZE (MATRIX_ROWS * MATRIX_COLS)
|
|
||||||
#define CHECK_LED() \
|
|
||||||
if ((i >= RGB_MATRIX_LED_COUNT) \
|
|
||||||
|| ((g_led_config.flags[pos] == LED_FLAG_NONE) || (g_led_config.flags[pos] == LED_FLAG_UNDERGLOW))) \
|
|
||||||
continue
|
|
||||||
|
|
||||||
#ifdef RGB_MATRIX_ENABLE
|
#ifdef RGB_MATRIX_ENABLE
|
||||||
|
|
||||||
#ifdef UNDERGLOW_DISABLE
|
#define LAYER (get_highest_layer(layer_state))
|
||||||
void keyboard_pre_init_user(void) {
|
#define LAYER_SIZE (MATRIX_ROWS * MATRIX_COLS)
|
||||||
|
#define BRIGHTNESS rgb_matrix_get_val()
|
||||||
|
|
||||||
|
#ifdef UNDERGLOW_DISABLE
|
||||||
|
void keyboard_pre_init_user(void) {
|
||||||
for (int key_id = 0; key_id < RGB_MATRIX_LED_COUNT; key_id++ ) {
|
for (int key_id = 0; key_id < RGB_MATRIX_LED_COUNT; key_id++ ) {
|
||||||
if (g_led_config.flags[key_id] == LED_FLAG_UNDERGLOW) {
|
if (g_led_config.flags[key_id] == LED_FLAG_UNDERGLOW) {
|
||||||
g_led_config.flags[key_id] = LED_FLAG_NONE;
|
g_led_config.flags[key_id] = LED_FLAG_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // UNDERGLOW_DISABLE
|
||||||
|
|
||||||
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||||
if (LAYER != _MAIN) {
|
if (LAYER == _MAIN) {return false;}
|
||||||
|
|
||||||
int DimmedMax = UINT8_MAX - (UINT8_MAX - rgb_matrix_config.hsv.v);
|
|
||||||
|
|
||||||
for (uint8_t i = led_min; i <= led_max; i++) {
|
for (uint8_t i = led_min; i <= led_max; i++) {
|
||||||
|
|
||||||
uint8_t pos = ((uint8_t*)g_led_config.matrix_co)[i];
|
uint8_t pos = ((uint8_t*)g_led_config.matrix_co)[i];
|
||||||
|
if (!HAS_ANY_FLAGS(g_led_config.flags[pos], (LED_FLAG_MODIFIER | LED_FLAG_KEYLIGHT))) {continue;}
|
||||||
CHECK_LED(); // Check LED before moving on
|
|
||||||
uint16_t KC = pgm_read_word(&((uint16_t*)keymaps)[(LAYER_SIZE * LAYER) + i]);
|
uint16_t KC = pgm_read_word(&((uint16_t*)keymaps)[(LAYER_SIZE * LAYER) + i]);
|
||||||
|
|
||||||
if (KC == KC_NO) {
|
switch (KC) {
|
||||||
|
case KC_NO:
|
||||||
RGB_MATRIX_INDICATOR_SET_COLOR(pos, 0, 0, 0 );
|
RGB_MATRIX_INDICATOR_SET_COLOR(pos, 0, 0, 0 );
|
||||||
}
|
break;
|
||||||
|
|
||||||
#ifdef DYNAMIC_MACRO_ENABLE
|
#ifdef DYNAMIC_MACRO_ENABLE
|
||||||
else if (KC == MCR_SWT) {
|
case MCR_SWT:
|
||||||
if (!MACRO1) {
|
if (!MACRO1) { RGB_MATRIX_INDICATOR_SET_COLOR(pos, 0, BRIGHTNESS, BRIGHTNESS); }
|
||||||
RGB_MATRIX_INDICATOR_SET_COLOR(pos, 0, DimmedMax, DimmedMax);
|
break;
|
||||||
}
|
|
||||||
} else if (KC == MCR_REC) {
|
|
||||||
if (RECORDING) {
|
|
||||||
RGB_MATRIX_INDICATOR_SET_COLOR(pos, DimmedMax, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
case MCR_REC:
|
||||||
|
if (RECORDING) { RGB_MATRIX_INDICATOR_SET_COLOR(pos, BRIGHTNESS, 0, 0); }
|
||||||
|
break;
|
||||||
|
#endif // DYNAMIC_MACRO_ENABLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
|
||||||
#ifdef DYNAMIC_MACRO_ENABLE
|
#ifdef DYNAMIC_MACRO_ENABLE
|
||||||
if (keycode == MCR_REC) keycode = REC;
|
if (keycode == MCR_REC) {keycode = REC;}
|
||||||
if (keycode == MCR_PLY) keycode = PLY;
|
if (keycode == MCR_PLY) {keycode = PLY;}
|
||||||
if (!process_dynamic_macro(keycode, record)) {
|
if (!process_dynamic_macro(keycode, record)) {
|
||||||
REC = (MACRO1 ? DM_REC1 : DM_REC2);
|
REC = (MACRO1 ? DM_REC1 : DM_REC2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // DYNAMIC_MACRO_ENABLE
|
||||||
|
|
||||||
#ifdef MOUSEKEY_ENABLE
|
#ifdef MOUSEKEY_ENABLE
|
||||||
if (keycode == MS_ACL_U || keycode == MS_ACL_D) {
|
if ((keycode == MS_ACL_U) || (keycode == MS_ACL_D)) {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
if ( (keycode == MS_ACL_U) && (current_accel < 2) ) { current_accel += 1; }
|
if ( (keycode == MS_ACL_U) && (current_accel < 2) ) { current_accel += 1; }
|
||||||
if ( (keycode == MS_ACL_D) && (current_accel > 0) ) { current_accel -= 1; }
|
if ( (keycode == MS_ACL_D) && (current_accel > 0) ) { current_accel -= 1; }
|
||||||
@ -159,7 +143,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
action_t mousekey_action = action_for_keycode(keycode);
|
action_t mousekey_action = action_for_keycode(keycode);
|
||||||
process_action(record, mousekey_action);
|
process_action(record, mousekey_action);
|
||||||
}
|
}
|
||||||
#endif
|
#endif // MOUSEKEY_ENABLE
|
||||||
|
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
#ifdef DYNAMIC_MACRO_ENABLE
|
#ifdef DYNAMIC_MACRO_ENABLE
|
||||||
@ -176,24 +160,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif // DYNAMIC_MACRO_ENABLE
|
||||||
|
|
||||||
#if defined(RGB_MATRIX_ENABLE) && defined(RGBLIGHT_ENABLE) // this only needs to be defined if both are enabled
|
|
||||||
case RGB_TOG: // We can intercept this keycode ig? Cool :)
|
|
||||||
if (record->event.pressed) {
|
|
||||||
if (rgb_matrix_is_enabled()) {
|
|
||||||
rgb_matrix_disable/*_noeeprom*/();
|
|
||||||
rgblight_enable/*_noeeprom*/();
|
|
||||||
} else if (rgblight_is_enabled()) {
|
|
||||||
rgb_matrix_disable/*_noeeprom*/();
|
|
||||||
rgblight_disable/*_noeeprom*/();
|
|
||||||
} else {
|
|
||||||
rgb_matrix_enable/*_noeeprom*/();
|
|
||||||
rgblight_disable/*_noeeprom*/();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return true; //Process all other keycodes normally
|
return true; //Process all other keycodes normally
|
||||||
|
Loading…
Reference in New Issue
Block a user