Added in different configs for knob on different layers. Moved the numpad in layer 2 around so that the 5 would be under the j key to make it feel like a real numpad.

This commit is contained in:
Rohit Pai 2021-09-21 20:26:33 +01:00
parent cda7320c58
commit ad32bccf58
2 changed files with 80 additions and 12 deletions

View File

@ -76,3 +76,6 @@
/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ /* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */
// #define FORCE_NKRO // #define FORCE_NKRO
//custom defins
#define RGB_MATRIX_KEYPRESSES

View File

@ -20,7 +20,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record)
if (record->event.pressed) if (record->event.pressed)
{ {
// when keycode KC_DBL0 is pressed // when keycode KC_DBL0 is pressed
SEND_STRING("00"); tap_code(KC_P0);
tap_code(KC_P0);
} }
else else
{ {
@ -91,11 +92,43 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record)
// when keycode KC_UNI is released // when keycode KC_UNI is released
} }
break; break;
} }
return true; return true;
}; };
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (host_keyboard_led_state().caps_lock)
{
RGB prevColour = hsv_to_rgb(rgb_matrix_get_hsv());
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++)
{
if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW))
{
rgb_matrix_set_color(i, 255 - prevColour.r, 255 - prevColour.g, 255 - prevColour.b);
}
}
RGB_MATRIX_INDICATOR_SET_COLOR(3, 255 - prevColour.r, 255 - prevColour.g, 255 - prevColour.b);
}
if (host_keyboard_led_state().num_lock && layer_state_is(1))
{
RGB prevColour = hsv_to_rgb(rgb_matrix_get_hsv());
RGB_MATRIX_INDICATOR_SET_COLOR(55, 255 - prevColour.r, 255 - prevColour.g, 255 - prevColour.b);
}
if (layer_state_is(1))
{
RGB prevColour = hsv_to_rgb(rgb_matrix_get_hsv());
RGB_MATRIX_INDICATOR_SET_COLOR(70, 128 - prevColour.r, 128 - prevColour.g, 128 - prevColour.b);
}
if (layer_state_is(2))
{
RGB prevColour = hsv_to_rgb(rgb_matrix_get_hsv());
RGB_MATRIX_INDICATOR_SET_COLOR(19, 128 - prevColour.r, 128 - prevColour.g, 128 - prevColour.b);
}
}
// clang-format off // clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@ -127,15 +160,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(2), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(2), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
[1] = LAYOUT( [1] = LAYOUT(
KC_ESC, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_TRNS, KC_MPLY, KC_ESC, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_TRNS, KC_MPLY,
KC_GRV, TG(0), KC_TRNS, TG(2), KC_4, KC_5, KC_6, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR, KC_GRV, TG(0), KC_TRNS, TG(2), KC_4, KC_5, KC_6, KC_7, KC_8, KC_PSLS, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PSCR,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_P4, KC_P5, KC_P6, KC_PAST, KC_LBRC, KC_RBRC, KC_DEL, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_PAST, KC_P, KC_LBRC, KC_RBRC, KC_DEL,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_GRV, KC_NUHS, KC_ENT, KC_HOME, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_DBL0, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PPLS, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_P0, KC_DBL0, KC_PDOT, KC_PPLS, KC_RSFT, KC_UP, KC_END, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_P0, KC_P1, KC_P2, KC_3, KC_PDOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(2), KC_NLCK, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(2), KC_NLCK, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
[2] = LAYOUT( [2] = LAYOUT(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_GMAIL, KC_HMAIL, KC_UNI, KC_F12, KC_TRNS, KC_MPLY, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_GMAIL, KC_HMAIL, KC_UNI, KC_F12, KC_TRNS, KC_MPLY,
KC_GRV, TG(0), TG(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_PSCR, KC_GRV, TG(0), TG(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_PSCR,
KC_TAB, BL_TOGG, BL_ON, KC_TRNS, KC_TRNS, RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_DEL, KC_TAB, BL_TOGG, BL_ON, KC_TRNS, KC_TRNS, KC_INS, KC_PGUP, KC_PGDN, KC_TRNS, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_DEL,
KC_CAPS, RGB_TOG, KC_YELLOW, KC_GREEN, KC_TRNS, KC_MYCM, KC_MAIL, KC_CALC, KC_TRNS, RGB_HUD, RGB_SAD, RGB_VAD, RESET, KC_ENT, KC_HOME, KC_CAPS, RGB_TOG, KC_YELLOW, KC_GREEN, KC_TRNS, KC_MYCM, KC_MAIL, KC_CALC, KC_TRNS, RGB_HUD, RGB_SAD, RGB_VAD, RESET, KC_ENT, KC_HOME,
KC_LSFT, KC_TRNS, KC_MPRV, KC_MNXT, KC_MSEL, KC_TRNS, KC_BRIU, KC_BRID, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RSFT, KC_UP, KC_END, KC_LSFT, KC_TRNS, KC_MPRV, KC_MNXT, KC_MSEL, KC_TRNS, KC_BRIU, KC_BRID, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RSFT, KC_UP, KC_END,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT) KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT)
@ -145,11 +178,43 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// clang-format on // clang-format on
#ifdef ENCODER_ENABLE #ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise)
if (clockwise) { {
tap_code(KC_VOLU); if (index == 0)
} else { {
tap_code(KC_VOLD); switch(get_highest_layer(layer_state))
{
case 0:
if (clockwise)
{
tap_code16(KC_VOLU);
}
else
{
tap_code16(KC_VOLD);
}
break;
case 1:
if (clockwise)
{
tap_code16(KC_BRIU);
}
else
{
tap_code16(KC_BRID);
}
break;
case 2:
if (clockwise)
{
rgb_matrix_increase_hue();
}
else
{
rgb_matrix_decrease_hue();
}
}
} }
return true; return true;
} }