Skip to content

Commit

Permalink
[Keymap] GMMK Pro keymap (qmk#14389)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSchaeff authored and ptrxyz committed Nov 6, 2021
1 parent de6de2f commit 16486ba
Showing 1 changed file with 49 additions and 53 deletions.
102 changes: 49 additions & 53 deletions keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,58 +70,54 @@ 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);
}
} else {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
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);
}
}
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;
else
{
if (clockwise)
{
tap_code(KC_VOLU);
}
else
{
tap_code(KC_VOLD);
}

}
}
return true;

}

0 comments on commit 16486ba

Please sign in to comment.