Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* https://www.reddit.com/r/olkb/comments/pohkyr/changing_backlight_level_also_enables_led_any_way/
- * This goes into keymap.c
- */
- static uint16_t key_timer;
- bool BL_flashing = true; //backlight flashing mode
- bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- if (BL_flashing && record->event.pressed) {
- backlight_level_noeeprom(255);
- key_timer = timer_read();
- }
- switch (keycode) {
- case BL_TOGG:
- if (record->event.pressed)
- BL_flashing = !BL_flashing; //toggle this variable
- return false; //do nothing else
- }
- return true;
- }
- void matrix_scan_user(void) {
- if (timer_elapsed(key_timer) > 50 && get_backlight_level())
- backlight_level_noeeprom(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement