diff options
Diffstat (limited to 'keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c')
-rw-r--r-- | keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c | 104 |
1 files changed, 54 insertions, 50 deletions
diff --git a/keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c b/keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c index 39eac038d1..5f3e3f5fd8 100644 --- a/keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c +++ b/keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c @@ -20,7 +20,7 @@ enum userspace_layers { }; //custom keycodes -#define MODS_ALT_MASK (MOD_BIT(KC_LALT)) // Make ALT layer for encoder use +#define MODS_ALT_MASK (MOD_BIT(KC_LALT)) // Make ALT layer for encoder use #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)) // Make CTRL layer for encoder use #define SWAP_L SGUI(KC_LEFT) // Swap application to left display #define SWAP_R SGUI(KC_RGHT) // Swap application to right display @@ -70,54 +70,58 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -bool encoder_update_user(uint8_t index, bool clockwise) -{ - if (get_mods() & MODS_ALT_MASK) - { - if (clockwise) - { - tap_code(KC_TAB); - } - else - { - tap_code16(S(KC_TAB)); - } - } - else if (get_mods() & MODS_CTRL_MASK) - { - if (clockwise) - { - tap_code(KC_TAB); - } - else - { - tap_code16(S(KC)_TAB)); - - } - } - else if(IS_LAYER_ON(FNLAYER)) - { - if(clockwise) - { - tap_code(KC_MEDIA_NEXT_TRACK); - } - else - { - tap_code(KC_MEDIA_PREV_TRACK); - } +bool encoder_update_user(uint8_t index, bool clockwise) { + if (get_mods() & MODS_ALT_MASK) { + if (clockwise) { + tap_code(KC_TAB); + } else { + tap_code16(S(KC_TAB)); + } + } else if (get_mods() & MODS_CTRL_MASK) { + if (clockwise) { + tap_code(KC_TAB); + } else { + tap_code16(S(KC_TAB)); + } + } else if(IS_LAYER_ON(FNLAYER)) { + if (clockwise) { + tap_code(KC_MEDIA_NEXT_TRACK); + } else { + tap_code(KC_MEDIA_PREV_TRACK); + } + } else { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } } - else - { - if (clockwise) - { - tap_code(KC_VOLU); - } - else - { - tap_code(KC_VOLD); - } - + return false; +} + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + switch(get_highest_layer(layer_state)) { + // special handling per layer + case 0: //layer one + if (host_keyboard_led_state().caps_lock) + rgb_matrix_set_color_all(255,0,0); + else + rgb_matrix_set_color_all(0,255,56); + break; + case 1: + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_INDICATOR_SET_COLOR(i,0,0,0); + } + RGB_MATRIX_INDICATOR_SET_COLOR(0, 0, 0, 255) //esc + RGB_MATRIX_INDICATOR_SET_COLOR(6, 0, 0, 255) //f1 + RGB_MATRIX_INDICATOR_SET_COLOR(8, 0, 0, 255) //q + RGB_MATRIX_INDICATOR_SET_COLOR(14, 0, 0, 255) //w + RGB_MATRIX_INDICATOR_SET_COLOR(20, 0, 0, 255) //e + RGB_MATRIX_INDICATOR_SET_COLOR(15, 0, 0, 255) //s + RGB_MATRIX_INDICATOR_SET_COLOR(26, 0, 0, 255) //f + RGB_MATRIX_INDICATOR_SET_COLOR(49, 0, 0, 255) //R_Alt + break; + default: + break; } - return true; - -}
\ No newline at end of file +} |