summaryrefslogtreecommitdiff
path: root/keyboards/annepro2/keymaps
diff options
context:
space:
mode:
authorzv0n <tom.zvon@gmail.com>2022-07-02 15:09:21 +0200
committerGitHub <noreply@github.com>2022-07-02 23:09:21 +1000
commit783d1cd458b68055a6ba6d66a3f0fcd0698158c8 (patch)
tree9a0b26b84f3b2dc2543b92c601865a57c18d98b9 /keyboards/annepro2/keymaps
parent7e926f5c939fdf5cfa3dd17fec774f61b77b5f07 (diff)
[keyboard] annepro2 Add support for sticky keys (#17359)
Diffstat (limited to 'keyboards/annepro2/keymaps')
-rw-r--r--keyboards/annepro2/keymaps/default-full-caps/keymap.c8
-rw-r--r--keyboards/annepro2/keymaps/default-layer-indicators/keymap.c12
2 files changed, 9 insertions, 11 deletions
diff --git a/keyboards/annepro2/keymaps/default-full-caps/keymap.c b/keyboards/annepro2/keymaps/default-full-caps/keymap.c
index c87447d311..cb6147d40a 100644
--- a/keyboards/annepro2/keymaps/default-full-caps/keymap.c
+++ b/keyboards/annepro2/keymaps/default-full-caps/keymap.c
@@ -96,7 +96,7 @@ enum anne_pro_layers {
*
*/
[FN2] = LAYOUT_60_ansi( /* FN2 */
- _______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, KC_AP_LED_OFF, KC_AP_LED_ON, _______, _______, _______, _______,
+ _______, 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, _______,
@@ -109,9 +109,11 @@ enum anne_pro_layers {
bool led_update_user(led_t leds) {
if (leds.caps_lock) {
// Set the leds to red
- ap2_led_set_foreground_color(0xFF, 0x00, 0x00);
+ const ap2_led_t color = {.p.red = 0xff, .p.green = 0x00, .p.blue = 0x00, .p.alpha = 0xff};
+ ap2_led_mask_set_mono(color);
} else {
- ap2_led_reset_foreground_color();
+ const ap2_led_t color = {.p.red = 0x00, .p.green = 0x00, .p.blue = 0x00, .p.alpha = 0x00};
+ ap2_led_mask_set_mono(color);
}
return true;
diff --git a/keyboards/annepro2/keymaps/default-layer-indicators/keymap.c b/keyboards/annepro2/keymaps/default-layer-indicators/keymap.c
index 1fd97c584e..ca042dcd32 100644
--- a/keyboards/annepro2/keymaps/default-layer-indicators/keymap.c
+++ b/keyboards/annepro2/keymaps/default-layer-indicators/keymap.c
@@ -96,7 +96,7 @@ enum anne_pro_layers {
*
*/
[FN2] = LAYOUT_60_ansi( /* FN2 */
- _______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, _______, KC_AP_LED_TOG, KC_AP_LED_NEXT_INTENSITY, KC_AP_LED_PREV_PROFILE, KC_AP_LED_NEXT_PROFILE, _______,
+ _______, 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, _______,
@@ -134,16 +134,12 @@ bool led_update_user(led_t leds) {
if (leds.caps_lock) {
// Set the caps-lock to red
const ap2_led_t color = {.p.red = 0xff, .p.green = 0x00, .p.blue = 0x00, .p.alpha = 0xff};
-
- ap2_led_mask_set_key(2, 0, color);
+ ap2_led_sticky_set_key(2, 0, color);
/* NOTE: Instead of colouring the capslock only, you can change the whole
- keyboard with ap2_led_set_foreground_color */
+ keyboard with ap2_led_mask_set_mono */
} else {
// Reset the capslock if there is no layer active
- if (!layer_state_is(FN1) && !layer_state_is(FN2)) {
- const ap2_led_t color = {.p.red = 0xff, .p.green = 0x00, .p.blue = 0x00, .p.alpha = 0x00};
- ap2_led_mask_set_key(2, 0, color);
- }
+ ap2_led_unset_sticky_key(2, 0);
}
return true;