Browse Source

Get rid of `USB_LED_CAPS_LOCK` (#21436)

pull/17207/merge
Ryan 10 months ago
committed by GitHub
parent
commit
87b11345a5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
70 changed files with 214 additions and 226 deletions
  1. +3
    -2
      keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c
  2. +3
    -2
      keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c
  3. +3
    -2
      keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c
  4. +3
    -2
      keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c
  5. +4
    -3
      keyboards/40percentclub/mf68/keymaps/delivrance/keymap.c
  6. +3
    -4
      keyboards/40percentclub/mf68/keymaps/emdarcher/keymap.c
  7. +17
    -14
      keyboards/40percentclub/ut47/led.c
  8. +3
    -2
      keyboards/converter/siemens_tastatur/keymaps/default/keymap.c
  9. +3
    -2
      keyboards/dz60/keymaps/muzfuz/keymap.c
  10. +2
    -2
      keyboards/dztech/dz60rgb_ansi/keymaps/kuru/keymap.c
  11. +2
    -2
      keyboards/dztech/dz60rgb_ansi/keymaps/muralisc/keymap.c
  12. +3
    -2
      keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c
  13. +3
    -2
      keyboards/ergodox_ez/keymaps/smurmann/keymap.c
  14. +3
    -3
      keyboards/handwired/frenchdev/keymaps/default/keymap.c
  15. +0
    -18
      keyboards/handwired/owlet60/keymaps/oled_testing/keymap.c
  16. +3
    -2
      keyboards/handwired/promethium/keymaps/default/keymap.c
  17. +3
    -2
      keyboards/handwired/promethium/keymaps/priyadi/keymap.c
  18. +3
    -14
      keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/keymap.c
  19. +3
    -3
      keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c
  20. +3
    -2
      keyboards/kbdfans/kbd75/keymaps/tucznak/keymap.c
  21. +3
    -2
      keyboards/keebio/bfo9000/keymaps/abstractkb/keymap.c
  22. +3
    -2
      keyboards/kmini/keymaps/default/keymap.c
  23. +1
    -1
      keyboards/kprepublic/bm40hsrgb/keymaps/signynt/keymap.c
  24. +3
    -2
      keyboards/kprepublic/jj50/keymaps/abstractkb/keymap.c
  25. +3
    -2
      keyboards/kprepublic/jj50/keymaps/abstractkb_gergomatch/keymap.c
  26. +3
    -2
      keyboards/lazydesigners/dimple/staggered/keymaps/tominabox1/keymap.c
  27. +3
    -2
      keyboards/lazydesigners/the50/keymaps/default/keymap.c
  28. +3
    -2
      keyboards/lazydesigners/the50/keymaps/mikethetiger/keymap.c
  29. +3
    -2
      keyboards/noxary/268/keymaps/ansi/keymap.c
  30. +3
    -2
      keyboards/noxary/268/keymaps/default/keymap.c
  31. +3
    -2
      keyboards/noxary/268/keymaps/iso/keymap.c
  32. +3
    -2
      keyboards/noxary/268/keymaps/sixtyeight/keymap.c
  33. +1
    -1
      keyboards/owlab/spring/spring.c
  34. +3
    -2
      keyboards/percent/canoe/keymaps/boy_314/keymap.c
  35. +6
    -5
      keyboards/planck/keymaps/altgr/common/init.h
  36. +6
    -5
      keyboards/planck/keymaps/hiea/common/init.h
  37. +6
    -5
      keyboards/planck/keymaps/hieax/common/init.h
  38. +1
    -1
      keyboards/planck/keymaps/rootiest/keymap.c
  39. +6
    -5
      keyboards/planck/keymaps/sdothum/common/init.h
  40. +3
    -12
      keyboards/playkbtw/ca66/keymaps/olivia/keymap.c
  41. +3
    -2
      keyboards/playkbtw/pk60/keymaps/default/keymap.c
  42. +3
    -2
      keyboards/primekb/prime_e/keymaps/jetpacktuxedo/keymap.c
  43. +3
    -2
      keyboards/primekb/prime_e/keymaps/madhatter/keymap.c
  44. +1
    -1
      keyboards/shoc/keymaps/bongo/keymap.c
  45. +3
    -2
      keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c
  46. +3
    -2
      keyboards/uk78/keymaps/default/keymap.c
  47. +3
    -2
      keyboards/uk78/keymaps/rask/keymap.c
  48. +3
    -2
      keyboards/v60_type_r/keymaps/followingghosts/keymap.c
  49. +3
    -2
      keyboards/v60_type_r/keymaps/vimouse/keymap.c
  50. +3
    -2
      keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c
  51. +2
    -2
      keyboards/work_louder/work_board/keymaps/drashna/keymap.c
  52. +1
    -1
      keyboards/xbows/woody/woody.c
  53. +3
    -10
      keyboards/xiudi/xd75/keymaps/bulbizarre/keymap.c
  54. +3
    -2
      layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c
  55. +3
    -5
      layouts/community/ergodox/colemak_code_friendly/keymap.c
  56. +4
    -4
      layouts/community/ergodox/drashna/keymap.c
  57. +2
    -2
      layouts/community/ergodox/jjerrell/keymap.c
  58. +1
    -1
      layouts/community/ergodox/ordinary/keymap.c
  59. +1
    -1
      layouts/community/ergodox/ordinary_osx/keymap.c
  60. +1
    -6
      layouts/community/ergodox/osx_neo2/keymap.c
  61. +1
    -1
      layouts/community/ergodox/software_neo2/keymap.c
  62. +1
    -6
      layouts/community/ergodox/swedish-lindhe/keymap.c
  63. +3
    -2
      layouts/community/ortho_4x12/brandonschlack/keymap.c
  64. +2
    -2
      layouts/community/ortho_4x12/drashna/keymap.c
  65. +6
    -3
      platforms/avr/sleep_led.c
  66. +7
    -4
      platforms/chibios/sleep_led.c
  67. +3
    -3
      quantum/led.c
  68. +0
    -3
      quantum/led.h
  69. +3
    -3
      users/curry/rgb_lighting_user.c
  70. +3
    -2
      users/turbomech/backupturbomech.c

+ 3
- 2
keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c View File

@ -18,12 +18,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
} else {
setPinInput(B2);
writePinLow(B2);
}
return false;
}

+ 3
- 2
keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c View File

@ -18,12 +18,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
} else {
setPinInput(B2);
writePinLow(B2);
}
return false;
}

+ 3
- 2
keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c View File

@ -72,10 +72,11 @@ layer_state_t layer_state_set_user(layer_state_t state) {
}
// support for standard mod state keys (caps lock, scroll lock, etc.)
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
} else {
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
}
return false;
}

+ 3
- 2
keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c View File

@ -18,12 +18,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
} else {
setPinInput(B2);
writePinLow(B2);
}
return false;
}

+ 4
- 3
keyboards/40percentclub/mf68/keymaps/delivrance/keymap.c View File

@ -157,11 +157,11 @@ void dynamic_macro_record_end_user(int8_t direction) {
// Custom Caps Lock backlight behaviour
// ------------------------------------
void led_set_user(uint8_t usb_led) {
bool led_update_user(led_t led_state) {
// This exists because I don't like the backlight to turn OFF when the Caps Lock is ON.
// That is, this will turn the backlight ON (at half the brightness) when the Caps Lock is ON as well.
static bool prev_is_caps_on;
bool is_caps_on = IS_LED_ON(usb_led, USB_LED_CAPS_LOCK);
bool is_caps_on = led_state.caps_lock;
if (prev_is_caps_on != is_caps_on) {
prev_is_caps_on = is_caps_on;
@ -178,7 +178,7 @@ void led_set_user(uint8_t usb_led) {
}
// Turn on the Pro Micro's on-board LEDs for Caps Lock
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
if (led_state.caps_lock) {
// Set to low
setPinOutput(B0);
writePinLow(B0);
@ -189,6 +189,7 @@ void led_set_user(uint8_t usb_led) {
setPinInput(B0);
setPinInput(D5);
}
return false;
}
// Backlight idle timeout feature


+ 3
- 4
keyboards/40percentclub/mf68/keymaps/emdarcher/keymap.c View File

@ -35,11 +35,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
void led_set_user(uint8_t usb_led){
bool led_update_user(led_t led_state){
//turn on the Pro Micro's on board LEDs for CAPS LOCK
if(IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)){
if(led_state.caps_lock){
//set led pins to low
setPinOutput(B0);
writePinLow(B0);
@ -50,4 +48,5 @@ void led_set_user(uint8_t usb_led){
setPinInput(B0);
setPinInput(D5);
}
return false;
}

+ 17
- 14
keyboards/40percentclub/ut47/led.c View File

@ -19,20 +19,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#include "led.h"
void led_set(uint8_t usb_led)
bool led_update_kb(led_t led_state)
{
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// output low
DDRB |= (1<<0);
PORTB &= ~(1<<0);
DDRD |= (1<<5);
PORTD &= ~(1<<5);
} else {
// Hi-Z
DDRB &= ~(1<<0);
PORTB &= ~(1<<0);
DDRD &= ~(1<<5);
PORTD &= ~(1<<5);
bool res = led_update_user(led_state);
if (res) {
if (led_state.caps_lock) {
// output low
DDRB |= (1<<0);
PORTB &= ~(1<<0);
DDRD |= (1<<5);
PORTD &= ~(1<<5);
} else {
// Hi-Z
DDRB &= ~(1<<0);
PORTB &= ~(1<<0);
DDRD &= ~(1<<5);
PORTD &= ~(1<<5);
}
}
return false;
}

+ 3
- 2
keyboards/converter/siemens_tastatur/keymaps/default/keymap.c View File

@ -51,10 +51,11 @@ void matrix_init_user(void) {
writePinLow(B0);
}
void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
writePinHigh(B0);
} else {
writePinLow(B0);
}
return false;
}

+ 3
- 2
keyboards/dz60/keymaps/muzfuz/keymap.c View File

@ -25,12 +25,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
} else {
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
}
return false;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record)


+ 2
- 2
keyboards/dztech/dz60rgb_ansi/keymaps/kuru/keymap.c View File

@ -85,7 +85,7 @@ void highlight_layer3(void){
}
bool rgb_matrix_indicators_user(void) {
uint8_t this_led = host_keyboard_leds();
led_t led_state = host_keyboard_led_state();
if (!g_suspend_state) {
switch (get_highest_layer(layer_state)) {
case 3:
@ -94,7 +94,7 @@ bool rgb_matrix_indicators_user(void) {
break;
}
}
if ( this_led & (1<<USB_LED_CAPS_LOCK)) {
if (led_state.caps_lock) {
rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF);
}
return false;


+ 2
- 2
keyboards/dztech/dz60rgb_ansi/keymaps/muralisc/keymap.c View File

@ -146,7 +146,7 @@ void highlight_layer3(void) {
}
bool rgb_matrix_indicators_user(void) {
uint8_t this_led = host_keyboard_leds();
led_t led_state = host_keyboard_led_state();
if (!g_suspend_state) {
switch (get_highest_layer(layer_state)) {
case 1:
@ -161,7 +161,7 @@ bool rgb_matrix_indicators_user(void) {
break;
}
}
if ( this_led & (1<<USB_LED_CAPS_LOCK)) {
if (led_state.caps_lock) {
rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF);
}
return false;


+ 3
- 2
keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c View File

@ -296,12 +296,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
ergodox_right_led_1_on();
} else {
ergodox_right_led_1_off();
}
return false;
}


+ 3
- 2
keyboards/ergodox_ez/keymaps/smurmann/keymap.c View File

@ -194,11 +194,12 @@ void matrix_scan_user(void) {
}
};
void led_set_user(uint8_t usb_led){
if (usb_led & (1 << USB_LED_CAPS_LOCK))
bool led_update_user(led_t led_state){
if (led_state.caps_lock)
{
capsOn = true;
}else {
capsOn = false;
}
return false;
}

+ 3
- 3
keyboards/handwired/frenchdev/keymaps/default/keymap.c View File

@ -351,11 +351,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)){
bool led_update_user(led_t led_state) {
if (led_state.caps_lock){
frenchdev_led_3_on();
} else {
frenchdev_led_3_off();
}
return ;
return false;
}

+ 0
- 18
keyboards/handwired/owlet60/keymaps/oled_testing/keymap.c View File

@ -67,24 +67,6 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180;
}
bool oled_task_user(void) {
// Host Keyboard Layer Status
/*oled_write_P(PSTR("Lyr: "), false);
switch (get_highest_layer(layer_state)) {
case 0:
oled_write_P(PSTR("Alpha\n"), false);
break;
case 1:
oled_write_P(PSTR("FN\n"), false);
break;
default:
// Or use the write_ln shortcut over adding '\n' to the end of your string
oled_write_ln_P(PSTR("Undefined"), false);
}
uint8_t led_usb_state = host_keyboard_leds();
oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
*/
static const char PROGMEM qmk_logo[] = {
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,


+ 3
- 2
keyboards/handwired/promethium/keymaps/default/keymap.c View File

@ -1303,8 +1303,8 @@ void turn_off_capslock(void) {
rgbsps_send();
}
void led_set_user(uint8_t usb_led) {
bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
bool led_update_user(led_t led_state) {
bool new_capslock = led_state.caps_lock;
if (new_capslock ^ capslock) { // capslock state is different
if ((capslock = new_capslock)) {
rgbsps_set(LED_IND_CAPSLOCK, THEME_COLOR_CAPSLOCK);
@ -1313,6 +1313,7 @@ void turn_off_capslock(void) {
}
rgbsps_send();
}
return false;
}
#endif


+ 3
- 2
keyboards/handwired/promethium/keymaps/priyadi/keymap.c View File

@ -1306,8 +1306,8 @@ void turn_off_capslock(void) {
rgbsps_send();
}
void led_set_user(uint8_t usb_led) {
bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
bool led_update_user(led_t led_state) {
bool new_capslock = led_state.caps_lock;
if (new_capslock ^ capslock) { // capslock state is different
if ((capslock = new_capslock)) {
rgbsps_set(LED_IND_CAPSLOCK, THEME_COLOR_CAPSLOCK);
@ -1316,6 +1316,7 @@ void turn_off_capslock(void) {
}
rgbsps_send();
}
return false;
}
#endif


+ 3
- 14
keyboards/kbdfans/kbd67/rev2/keymaps/tucznak/keymap.c View File

@ -69,22 +69,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
rgblight_enable_noeeprom();
} else {
rgblight_disable_noeeprom();
}
return false;
}

+ 3
- 3
keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c View File

@ -43,8 +43,8 @@ static void check_light_layer(layer_state_t state) {
last_checked_layer = true;
}
static void check_light_led(uint8_t leds) {
if (IS_LED_ON(leds, USB_LED_CAPS_LOCK)) {
static void check_light_led(led_t led_state) {
if (led_state.caps_lock) {
caps_light();
} else if (IS_LAYER_ON(L_FN)) {
fn_light();
@ -57,7 +57,7 @@ static void check_light_led(uint8_t leds) {
static void inline check_light(void) {
last_checked_layer
? check_light_layer(layer_state)
: check_light_led(host_keyboard_leds());
: check_light_led(host_keyboard_led_state());
}
void eeconfig_init_keymap(void) {


+ 3
- 2
keyboards/kbdfans/kbd75/keymaps/tucznak/keymap.c View File

@ -79,11 +79,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
} else {
setPinInput(B2);
}
return false;
}

+ 3
- 2
keyboards/keebio/bfo9000/keymaps/abstractkb/keymap.c View File

@ -56,12 +56,13 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
rgblight_mode_noeeprom(RGBLIGHT_MODE_ALTERNATING);
} else {
layer_state_set_user(layer_state);
}
return false;
}
void myrgb_toggle(void) {


+ 3
- 2
keyboards/kmini/keymaps/default/keymap.c View File

@ -39,10 +39,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
writePinLow(B1);
} else {
writePinHigh(B1);
}
return false;
}

+ 1
- 1
keyboards/kprepublic/bm40hsrgb/keymaps/signynt/keymap.c View File

@ -165,7 +165,7 @@ if(IS_LAYER_ON(NSSL)) {
//capslock leds
if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color_all(50, 15.6, 0);
}


+ 3
- 2
keyboards/kprepublic/jj50/keymaps/abstractkb/keymap.c View File

@ -64,12 +64,13 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
rgblight_mode_noeeprom(RGBLIGHT_MODE_ALTERNATING);
} else {
layer_state_set_user(layer_state);
}
return false;
}
void myrgb_toggle(void) {


+ 3
- 2
keyboards/kprepublic/jj50/keymaps/abstractkb_gergomatch/keymap.c View File

@ -64,12 +64,13 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
rgblight_mode_noeeprom(RGBLIGHT_MODE_ALTERNATING);
} else {
layer_state_set_user(layer_state);
}
return false;
}
void myrgb_toggle(void) {


+ 3
- 2
keyboards/lazydesigners/dimple/staggered/keymaps/tominabox1/keymap.c View File

@ -100,10 +100,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
writePinLow(E6);
} else {
writePinHigh(E6);
}
return false;
}

+ 3
- 2
keyboards/lazydesigners/the50/keymaps/default/keymap.c View File

@ -49,11 +49,12 @@ EE_CLR, _______, _______, _______, _______,
)
};
void led_set_user(uint8_t usb_led) {
bool led_update_user(led_t led_state) {
// Turn LED On/Off for Caps Lock
if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) {
if (led_state.caps_lock) {
the50_led_on();
} else {
the50_led_off();
}
return false;
}

+ 3
- 2
keyboards/lazydesigners/the50/keymaps/mikethetiger/keymap.c View File

@ -69,11 +69,12 @@ EE_CLR, _______, _______, _______, _______,
)
};
void led_set_user(uint8_t usb_led) {
bool led_update_user(led_t led_state) {
// Turn LED On/Off for Caps Lock
if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) {
if (led_state.caps_lock) {
the50_led_on();
} else {
the50_led_off();
}
return false;
}

+ 3
- 2
keyboards/noxary/268/keymaps/ansi/keymap.c View File

@ -52,12 +52,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B6);
writePinHigh(B6);
} else {
setPinInput(B6);
writePinLow(B6);
}
return false;
}

+ 3
- 2
keyboards/noxary/268/keymaps/default/keymap.c View File

@ -70,8 +70,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B6);
writePinHigh(B6);
}
@ -79,4 +79,5 @@ void led_set_user(uint8_t usb_led) {
setPinInput(B6);
writePinLow(B6);
}
return false;
}

+ 3
- 2
keyboards/noxary/268/keymaps/iso/keymap.c View File

@ -52,12 +52,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B6);
writePinHigh(B6);
} else {
setPinInput(B6);
writePinLow(B6);
}
return false;
}

+ 3
- 2
keyboards/noxary/268/keymaps/sixtyeight/keymap.c View File

@ -70,11 +70,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
DDRB |= (1 << 6); PORTB |= (1 << 6);
}
else {
DDRB &= ~(1 << 6); PORTB &= ~(1 << 6);
}
return false;
}

+ 1
- 1
keyboards/owlab/spring/spring.c View File

@ -108,7 +108,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
case KC_CAPS:
if(IS_LED_ON(host_keyboard_leds(), USB_LED_CAPS_LOCK)){
if(host_keyboard_led_state().caps_lock){
caps_mode_index = CAPS_MODE_LOWER;
} else{
caps_mode_index = CAPS_MODE_UPPER;


+ 3
- 2
keyboards/percent/canoe/keymaps/boy_314/keymap.c View File

@ -47,10 +47,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
rgblight_sethsv(HSV_RED);
} else {
rgblight_sethsv(HSV_TURQUOISE);
}
return false;
}

+ 6
- 5
keyboards/planck/keymaps/altgr/common/init.h View File

@ -13,21 +13,22 @@ void matrix_init_user(void)
#ifdef AUDIO_ENABLE
#ifdef BACKLIGHT_ENABLE
void led_set_user(uint8_t usb_led)
bool led_update_user(led_t led_state)
{
static uint8_t old_usb_led = 0;
static led_t old_led_state = {0};
_delay_ms(10); // gets rid of tick
if (!is_playing_notes()) {
if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
if (led_state.caps_lock && !old_led_state.caps_lock) {
// if capslock LED is turning on
PLAY_SONG(song_caps_on);
}
else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
else if (!led_state.caps_lock && old_led_state.caps_lock) {
// if capslock LED is turning off
PLAY_SONG(song_caps_off);
}
}
old_usb_led = usb_led;
old_led_state = led_state;
return false;
}
#endif


+ 6
- 5
keyboards/planck/keymaps/hiea/common/init.h View File

@ -13,21 +13,22 @@ void matrix_init_user(void)
#ifdef AUDIO_ENABLE
#ifdef BACKLIGHT_ENABLE
void led_set_user(uint8_t usb_led)
bool led_update_user(led_t led_state)
{
static uint8_t old_usb_led = 0;
static led_t old_led_state = {0};
_delay_ms(10); // gets rid of tick
if (!is_playing_notes()) {
if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
if (led_state.caps_lock && !old_led_state.caps_lock) {
// if capslock LED is turning on
PLAY_SONG(song_caps_on);
}
else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
else if (!led_state.caps_lock && old_led_state.caps_lock) {
// if capslock LED is turning off
PLAY_SONG(song_caps_off);
}
}
old_usb_led = usb_led;
old_led_state = led_state;
return false;
}
#endif


+ 6
- 5
keyboards/planck/keymaps/hieax/common/init.h View File

@ -13,21 +13,22 @@ void matrix_init_user(void)
#ifdef AUDIO_ENABLE
#ifdef BACKLIGHT_ENABLE
void led_set_user(uint8_t usb_led)
bool led_update_user(led_t led_state)
{
static uint8_t old_usb_led = 0;
static led_t old_led_state = {0};
_delay_ms(10); // gets rid of tick
if (!is_playing_notes()) {
if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
if (led_state.caps_lock && !old_led_state.caps_lock) {
// if capslock LED is turning on
PLAY_SONG(song_caps_on);
}
else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
else if (!led_state.caps_lock && old_led_state.caps_lock) {
// if capslock LED is turning off
PLAY_SONG(song_caps_off);
}
}
old_usb_led = usb_led;
old_led_state = led_state;
return false;
}
#endif


+ 1
- 1
keyboards/planck/keymaps/rootiest/keymap.c View File

@ -1527,7 +1527,7 @@ void scap_finished(tap_dance_state_t* state, void* user_data) {
register_code(KC_LSFT);
break;
default:
if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) {
if (host_keyboard_led_state().caps_lock) {
tap_code(KC_CAPS);
reset_tap_dance(state);
break;


+ 6
- 5
keyboards/planck/keymaps/sdothum/common/init.h View File

@ -13,21 +13,22 @@ void matrix_init_user(void)
#ifdef AUDIO_ENABLE
#ifdef BACKLIGHT_ENABLE
void led_set_user(uint8_t usb_led)
bool led_update_user(led_t led_state)
{
static uint8_t old_usb_led = 0;
static led_t old_led_state = {0};
_delay_ms(10); // gets rid of tick
if (!is_playing_notes()) {
if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
if (led_state.caps_lock && !old_led_state.caps_lock) {
// if capslock LED is turning on
PLAY_SONG(song_caps_on);
}
else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) {
else if (!led_state.caps_lock && old_led_state.caps_lock) {
// if capslock LED is turning off
PLAY_SONG(song_caps_off);
}
}
old_usb_led = usb_led;
old_led_state = led_state;
return false;
}
#endif


+ 3
- 12
keyboards/playkbtw/ca66/keymaps/olivia/keymap.c View File

@ -17,20 +17,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
DDRD |= (1 << 1); PORTD &= ~(1 << 1);
} else {
DDRD &= ~(1 << 1); PORTD &= ~(1 << 1);
}
return false;
}

+ 3
- 2
keyboards/playkbtw/pk60/keymaps/default/keymap.c View File

@ -20,12 +20,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(F4);
writePinLow(F4);
} else {
setPinInput(F4);
writePinLow(F4);
}
return false;
}

+ 3
- 2
keyboards/primekb/prime_e/keymaps/jetpacktuxedo/keymap.c View File

@ -100,13 +100,14 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}
void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
CAPS = 1;
}
else {
CAPS = 0;
}
return false;
}
void togg_indicator(uint8_t *state, uint8_t pin) {


+ 3
- 2
keyboards/primekb/prime_e/keymaps/madhatter/keymap.c View File

@ -91,8 +91,9 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}
void led_set_user(uint8_t usb_led) {
CAPS = IS_LED_ON(usb_led, USB_LED_CAPS_LOCK);
bool led_update_user(led_t led_state) {
CAPS = led_state.caps_lock;
return false;
}
void togg_indicator(uint8_t *state, uint8_t pin) {


+ 1
- 1
keyboards/shoc/keymaps/bongo/keymap.c View File

@ -163,7 +163,7 @@ bool oled_task_user(void) {
oled_set_cursor(0,6);
oled_write_P(PSTR(" WPM: "), false);
oled_write(get_u8_str(get_current_wpm(), '0'), false);
if(host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)){
if(host_keyboard_led_state().caps_lock){
oled_set_cursor(0,5);
oled_write_P(PSTR(" CAPS LOCK"), false);
}


+ 3
- 2
keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c View File

@ -91,12 +91,13 @@ Capslock's led cannot be controlled separately on bananasplit and you can only t
leds at once. If you only install led for capslock, it will look like capslock has toggable
backlight.
*/
void led_set_user(uint8_t usb_led) {
if (usb_led && (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
DDRB |= (1 << 7);
PORTB |= (1 << 7);
} else {
DDRB &= ~(1 << 7);
PORTB &= ~(1 << 7);
}
return false;
}

+ 3
- 2
keyboards/uk78/keymaps/default/keymap.c View File

@ -75,12 +75,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(A3);
writePinHigh(A3);
} else {
setPinInput(A3);
writePinLow(A3);
}
return false;
}

+ 3
- 2
keyboards/uk78/keymaps/rask/keymap.c View File

@ -74,10 +74,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
DDRA |= (1 << 3); PORTA |= (1 << 3);
} else {
DDRA &= ~(1 << 3); PORTA &= ~(1 << 3);
}
return false;
}

+ 3
- 2
keyboards/v60_type_r/keymaps/followingghosts/keymap.c View File

@ -95,8 +95,8 @@ WASD are Up Left Right Down respectively
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
// output low
DDRE |= (1<<PE6);
PORTE &= ~(1<<PE6);
@ -106,4 +106,5 @@ void led_set_user(uint8_t usb_led) {
DDRE &= ~(1<<PE6);
PORTE &= ~(1<<PE6);
}
return false;
}

+ 3
- 2
keyboards/v60_type_r/keymaps/vimouse/keymap.c View File

@ -97,8 +97,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_____, _____, _____, _____, _____, _____, _____, _____),
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
// output low
DDRE |= (1<<PE6);
PORTE &= ~(1<<PE6);
@ -108,4 +108,5 @@ void led_set_user(uint8_t usb_led) {
DDRE &= ~(1<<PE6);
PORTE &= ~(1<<PE6);
}
return false;
}

+ 3
- 2
keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c View File

@ -69,8 +69,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
// output low
DDRE |= (1<<PE6);
PORTE &= ~(1<<PE6);
@ -80,6 +80,7 @@ void led_set_user(uint8_t usb_led) {
DDRE &= ~(1<<PE6);
PORTE &= ~(1<<PE6);
}
return false;
}
#define C_RED 0xFF, 0x00, 0x00


+ 2
- 2
keyboards/work_louder/work_board/keymaps/drashna/keymap.c View File

@ -110,7 +110,7 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) {
uint8_t this_mod = get_mods();
uint8_t this_led = host_keyboard_leds();
led_t this_led = host_keyboard_led_state();
uint8_t this_osm = get_oneshot_mods();
#define THUMB_LED 6
#define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__)
@ -134,7 +134,7 @@ bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) {
}
}
if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) {
if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led.caps_lock) {
if (!layer_state_is(_ADJUST)) {
RGB_MATRIX_INDICATOR_SET_COLOR(12, 0x00, 0xFF, 0x00);
RGB_MATRIX_INDICATOR_SET_COLOR(13, 0x00, 0xFF, 0x00);


+ 1
- 1
keyboards/xbows/woody/woody.c View File

@ -101,7 +101,7 @@ bool rgb_matrix_indicators_kb(void) {
if (!rgb_matrix_indicators_user()) {
return false;
}
if (IS_LED_ON(host_keyboard_leds(), USB_LED_CAPS_LOCK)) {
if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(30, 0xFF, 0x00, 0x00);
}
return true;


+ 3
- 10
keyboards/xiudi/xd75/keymaps/bulbizarre/keymap.c View File

@ -130,16 +130,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
capslock_led_on();
} else {
capslock_led_off();
@ -149,4 +141,5 @@ void led_set_user(uint8_t usb_led) {
} else {
gp100_led_off();
}
return false;
}

+ 3
- 2
layouts/community/60_ansi_arrow_split_bs_7u_spc/mrsendyyk/keymap.c View File

@ -109,9 +109,9 @@ void update_led(void) {
}
}
void led_set_user(uint8_t usb_led) {
bool led_update_user(led_t led_state) {
// Caps Lock Indicator
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
if (led_state.caps_lock) {
writePinLow(B2);
rgblight_setrgb(255, 110, 0);
}
@ -133,6 +133,7 @@ void led_set_user(uint8_t usb_led) {
}
update_led();
}
return false;
}
layer_state_t layer_state_set_user(layer_state_t state) {


+ 3
- 5
layouts/community/ergodox/colemak_code_friendly/keymap.c View File

@ -310,9 +310,6 @@ void matrix_init_user(void) {
void matrix_scan_user(void) {
uint8_t layer = get_highest_layer(layer_state);
//led 1, RED, Caps-Lock ON
//if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ergodox_right_led_1_on();
//led 2, GREEN
if (layer == LAYER_NUM)
ergodox_right_led_2_on();
@ -327,9 +324,10 @@ void matrix_scan_user(void) {
};
// Runs constantly in the background, in a loop.
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK))
bool led_update_user(led_t led_state) {
if (led_state.caps_lock)
ergodox_right_led_1_on();
else
ergodox_right_led_1_off();
return false;
}

+ 4
- 4
layouts/community/ergodox/drashna/keymap.c View File

@ -212,9 +212,9 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
void housekeeping_task_keymap(void) { // runs frequently to update info
#ifdef KEYBOARD_ergodox_ez
uint8_t modifiers = get_mods();
uint8_t led_usb_state = host_keyboard_leds();
uint8_t one_shot = get_oneshot_mods();
uint8_t modifiers = get_mods();
led_t led_state = host_keyboard_led_state();
uint8_t one_shot = get_oneshot_mods();
if (!skip_leds) {
ergodox_board_led_off();
@ -225,7 +225,7 @@ void housekeeping_task_keymap(void) { // runs frequently to update info
// Since we're not using the LEDs here for layer indication anymore,
// then lets use them for modifier indicators. Shame we don't have 4...
// Also, no "else", since we want to know each, independently.
if ((modifiers | one_shot) & MOD_MASK_SHIFT || led_usb_state & (1 << USB_LED_CAPS_LOCK)) {
if ((modifiers | one_shot) & MOD_MASK_SHIFT || led_state.caps_lock) {
ergodox_right_led_2_on();
ergodox_right_led_2_set(50);
}


+ 2
- 2
layouts/community/ergodox/jjerrell/keymap.c View File

@ -94,12 +94,12 @@ layer_state_t layer_state_set_keymap(layer_state_t state) {
void matrix_scan_keymap(void) {
uint8_t modifiers = get_mods();
uint8_t led_usb_state = host_keyboard_leds();
led_t led_state = host_keyboard_led_state();
uint8_t one_shot = get_oneshot_mods();
uint8_t layer_is_workman = layer_state_is(_WORKMAN);
if ((modifiers) && (layer_is_workman)) {
if (modifiers & MOD_MASK_SHIFT || led_usb_state & (1<<USB_LED_CAPS_LOCK) || one_shot & MOD_MASK_SHIFT) {
if (modifiers & MOD_MASK_SHIFT || led_state.caps_lock || one_shot & MOD_MASK_SHIFT) {
ergodox_right_led_1_on();
ergodox_right_led_1_set( 25 );
} else {


+ 1
- 1
layouts/community/ergodox/ordinary/keymap.c View File

@ -238,7 +238,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
// shift or caps lock turns on red light
if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK))) {
if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || host_keyboard_led_state().caps_lock) {
ergodox_right_led_1_on();
} else {
ergodox_right_led_1_off();


+ 1
- 1
layouts/community/ergodox/ordinary_osx/keymap.c View File

@ -238,7 +238,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
// shift or caps lock turns on red light
if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK))) {
if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || host_keyboard_led_state().caps_lock) {
ergodox_right_led_1_on();
} else {
ergodox_right_led_1_off();


+ 1
- 6
layouts/community/ergodox/osx_neo2/keymap.c View File

@ -686,7 +686,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if ((capslock_state & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) {
// CAPSLOCK is currently active, disable it
if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) {
if (host_keyboard_led_state().caps_lock) {
unregister_code(KC_LOCKING_CAPS_LOCK);
} else {
register_code(KC_LOCKING_CAPS_LOCK);
@ -697,11 +697,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return process_record_user_shifted(keycode, record);
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void){
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
uint8_t layer = get_highest_layer(layer_state);


+ 1
- 1
layouts/community/ergodox/software_neo2/keymap.c View File

@ -106,7 +106,7 @@ void matrix_scan_user(void) {
ergodox_right_led_3_off();
ergodox_board_led_off();
if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
if (host_keyboard_led_state().caps_lock) {
ergodox_right_led_3_on();
}


+ 1
- 6
layouts/community/ergodox/swedish-lindhe/keymap.c View File

@ -154,11 +154,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
@ -185,7 +180,7 @@ void matrix_scan_user(void) {
break;
}
if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
if (host_keyboard_led_state().caps_lock) {
// if capslk is on, set led 1 on
ergodox_right_led_1_on();
} else {


+ 3
- 2
layouts/community/ortho_4x12/brandonschlack/keymap.c View File

@ -100,12 +100,13 @@ void keyboard_post_init_keymap(void) {
}
// Use Green LED for Caps Lock
void led_set_user(uint8_t usb_led) {
if (IS_LED_OFF(usb_led, USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
writePinLow(LED_GREEN);
} else {
writePinHigh(LED_GREEN);
}
return false;
}
#endif


+ 2
- 2
layouts/community/ortho_4x12/drashna/keymap.c View File

@ -184,7 +184,7 @@ led_config_t g_led_config = {
bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) {
uint8_t this_mod = get_mods();
uint8_t this_led = host_keyboard_leds();
led_t this_led = host_keyboard_led_state();
uint8_t this_osm = get_oneshot_mods();
# ifdef KEYBOARD_planck_ez
# define THUMB_LED 41
@ -208,7 +208,7 @@ bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) {
break;
}
if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) {
if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led.caps_lock) {
if (!layer_state_cmp(layer_state, _ADJUST)) {
RGB_MATRIX_INDICATOR_SET_COLOR(24, 0x00, 0xFF, 0x00);
}


+ 6
- 3
platforms/avr/sleep_led.c View File

@ -109,16 +109,19 @@ ISR(TIMERx_COMPA_vect) {
uint8_t duration : 2;
uint8_t index : 6;
} pwm;
} timer = {.row = 0};
} timer = {.row = 0};
static led_t led_state = {0};
timer.row++;
// LED on
if (timer.pwm.count == 0) {
led_set(1 << USB_LED_CAPS_LOCK);
led_state.caps_lock = true;
led_set(led_state.raw);
}
// LED off
if (timer.pwm.count == pgm_read_byte(&breathing_table[timer.pwm.index])) {
led_set(0);
led_state.caps_lock = false;
led_set(led_state.raw);
}
}

+ 7
- 4
platforms/chibios/sleep_led.c View File

@ -41,17 +41,20 @@ void sleep_led_timer_callback(void) {
uint8_t duration : 2;
uint8_t index : 6;
} pwm;
} timer = {.row = 0};
} timer = {.row = 0};
static led_t led_state = {0};
timer.row++;
// LED on
if (timer.pwm.count == 0) {
led_set(1 << USB_LED_CAPS_LOCK);
led_state.caps_lock = true;
led_set(led_state.raw);
}
// LED off
if (timer.pwm.count == breathing_table[timer.pwm.index]) {
led_set(0);
led_state.caps_lock = false;
led_set(led_state.raw);
}
}
@ -190,7 +193,7 @@ void sleep_led_toggle(void) {
void sleep_led_init(void) {}
void sleep_led_enable(void) {
led_set(1 << USB_LED_CAPS_LOCK);
led_set(2); // Caps Lock
}
void sleep_led_disable(void) {


+ 3
- 3
quantum/led.c View File

@ -153,14 +153,14 @@ __attribute__((weak)) void led_set(uint8_t usb_led) {
/** \brief Trigger behaviour on transition to suspend
*/
void led_suspend(void) {
uint8_t leds_off = 0;
led_t leds_off = {0};
#ifdef BACKLIGHT_CAPS_LOCK
if (is_backlight_enabled()) {
// Don't try to turn off Caps Lock indicator as it is backlight and backlight is already off
leds_off |= (1 << USB_LED_CAPS_LOCK);
leds_off.caps_lock = true;
}
#endif
led_set(leds_off);
led_set(leds_off.raw);
}
/** \brief Trigger behaviour on transition from suspend


+ 0
- 3
quantum/led.h View File

@ -22,9 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* FIXME: Add doxygen comments here. */
/* keyboard LEDs */
#define USB_LED_CAPS_LOCK 1
#ifdef __cplusplus
extern "C" {
#endif


+ 3
- 3
users/curry/rgb_lighting_user.c View File

@ -11,9 +11,9 @@ void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight
* This is especially useful for One Shot Mods, since it's not always obvious if they're still lit up.
*/
#if defined(INDICATOR_LIGHTS)
void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
void set_rgb_indicators(uint8_t this_mod, led_t this_led, uint8_t this_osm) {
if (userspace_config.rgb_layer_change && get_highest_layer(layer_state) == 0) {
if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) {
if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led.caps_lock) {
# ifdef SHFT_LED1
rgblight_sethsv_at(120, 255, 255, SHFT_LED1);
# endif // SHFT_LED1
@ -79,7 +79,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
/* Function for the indicators */
void matrix_scan_indicator(void) {
if (has_initialized) {
set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
set_rgb_indicators(get_mods(), host_keyboard_led_state(), get_oneshot_mods());
}
}
#endif // INDICATOR_LIGHTS


+ 3
- 2
users/turbomech/backupturbomech.c View File

@ -135,14 +135,15 @@ void matrix_init_user(void) {
}
static bool is_capslocked = false;
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
is_capslocked = true;
// DDRB |= (1 << 2); PORTB &= ~(1 << 2);
} else {
is_capslocked = false;
// DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
}
return false;
}
//rgblight_set();


Loading…
Cancel
Save