Skip to content

Commit

Permalink
[Keyboard] annepro2: match default keymap to stock keycaps (#16724)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwisn committed Apr 13, 2022
1 parent 3f8343e commit ad981de
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 6 deletions.
64 changes: 64 additions & 0 deletions keyboards/annepro2/annepro2.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ static const SerialConfig ble_uart_config = {

static uint8_t led_mcu_wakeup[11] = {0x7b, 0x10, 0x43, 0x10, 0x03, 0x00, 0x00, 0x7d, 0x02, 0x01, 0x02};

static uint8_t led_enabled = 1;

ble_capslock_t ble_capslock = {._dummy = {0}, .caps_lock = false};

#ifdef RGB_MATRIX_ENABLE
Expand Down Expand Up @@ -226,6 +228,68 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
else ap2_led_enable();
return true;
#endif

case KC_AP_RGB_VAI:
if (record->event.pressed) {
if (get_mods() & MOD_MASK_SHIFT) {
rgb_matrix_increase_hue();
return false;
} else if (get_mods() & MOD_MASK_CTRL) {
rgb_matrix_decrease_hue();
return false;
} else {
rgb_matrix_increase_val();
}
}
return true;

case KC_AP_RGB_VAD:
if (record->event.pressed) {
if (get_mods() & MOD_MASK_SHIFT) {
rgb_matrix_increase_sat();
return false;
} else if (get_mods() & MOD_MASK_CTRL) {
rgb_matrix_decrease_sat();
return false;
} else {
rgb_matrix_decrease_val();
}
}
return true;

case KC_AP_RGB_TOG:
if (record->event.pressed) {
if (get_mods() & MOD_MASK_SHIFT) {
rgb_matrix_increase_speed();
return false;
} else if (get_mods() & MOD_MASK_CTRL) {
rgb_matrix_decrease_speed();
return false;
} else {
if (led_enabled) {
ap2_led_disable();
rgb_matrix_disable();
led_enabled = 0;
} else {
ap2_led_enable();
rgb_matrix_enable();
led_enabled = 1;
}
return true;
}
}
return true;

case KC_AP_RGB_MOD:
if (record->event.pressed) {
if (get_mods() & MOD_MASK_CTRL) {
rgb_matrix_step_reverse();
return false;
} else {
rgb_matrix_step();
}
}
return true;

default:
break;
Expand Down
4 changes: 4 additions & 0 deletions keyboards/annepro2/annepro2.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ enum AP2KeyCodes {
KC_AP_LED_PREV_PROFILE,
KC_AP_LED_NEXT_INTENSITY,
KC_AP_LED_SPEED,
KC_AP_RGB_VAI,
KC_AP_RGB_VAD,
KC_AP_RGB_TOG,
KC_AP_RGB_MOD,
AP2_SAFE_RANGE,
};

Expand Down
12 changes: 6 additions & 6 deletions keyboards/annepro2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ enum anne_pro_layers {
/*
* Layer FN2
* ,-----------------------------------------------------------------------------------------.
* | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | HUE | SAT | BRI | SPD | MOD | TOG | Bksp |
* | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | F7 | F8 | MOD | TOG | BRI- | BRI+ | Bksp |
* |-----------------------------------------------------------------------------------------+
* | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ |
* |-----------------------------------------------------------------------------------------+
Expand All @@ -96,11 +96,11 @@ enum anne_pro_layers {
*
*/
[FN2] = LAYOUT_60_ansi( /* FN2 */
_______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, RGB_MOD, RGB_TOG, _______,
MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
_______, _______, _______, _______, _______, MO(FN1), MO(FN2), _______
_______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, _______, KC_AP_RGB_MOD, KC_AP_RGB_TOG, KC_AP_RGB_VAD, KC_AP_RGB_VAI, _______,
MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
_______, _______, _______, _______, _______, MO(FN1), MO(FN2), _______
),
};
// clang-format on

0 comments on commit ad981de

Please sign in to comment.