1
0
Fork 0

[Keyboard] Waffling60 - minor tweak, improve default behavior of caps lock indicator. (#16836)

Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: 4pplet <4pplet@protonmail.com>
Co-authored-by: 4pplet <stefan.ess@gmail.com>
This commit is contained in:
4pplet 2022-04-13 16:11:19 +02:00 committed by GitHub
parent b8cb147573
commit cf152dd16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 37 deletions

View file

@ -21,8 +21,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_all(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, MO(1)),
// basic function layer
[1] = LAYOUT_all(

View file

@ -19,10 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// main layer
[0] = LAYOUT_all(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC,
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, MO(1)),
// basic function layer
[1] = LAYOUT_all(

View file

@ -18,15 +18,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(CAPS_LOCK_ENABLE){
if(res) {
if (CAPS_LOCK_ENABLE && res) {
if(led_state.caps_lock) {
rgblight_enable();
rgblight_mode(1);
rgblight_sethsv_noeeprom(CAPS_LOCK_COLOR);
#ifdef CAPS_LOCK_COLOR
rgblight_sethsv_at(CAPS_LOCK_COLOR, 0);
#else
rgblight_sethsv_at(rgblight_get_hue(),rgblight_get_sat(),rgblight_get_val(), 0);
#endif
}
else
rgblight_disable_noeeprom();
else{
rgblight_sethsv_at(HSV_OFF, 0);
}
}
return res;

View file

@ -16,9 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// defines to set RGB-led behaviour. Off by default
#define CAPS_LOCK_ENABLE false
#define CAPS_LOCK_COLOR HSV_ORANGE
#define CAPS_LOCK_ENABLE true
//#define CAPS_LOCK_COLOR HSV_ORANGE
#include "quantum.h"

View file

@ -20,11 +20,14 @@ bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (CAPS_LOCK_ENABLE && res) {
if(led_state.caps_lock) {
rgblight_enable();
rgblight_mode(1);
rgblight_sethsv_noeeprom(CAPS_LOCK_COLOR);
} else {
rgblight_disable_noeeprom();
#ifdef CAPS_LOCK_COLOR
rgblight_sethsv_at(CAPS_LOCK_COLOR, 0);
#else
rgblight_sethsv_at(rgblight_get_hue(),rgblight_get_sat(),rgblight_get_val(), 0);
#endif
}
else{
rgblight_sethsv_at(HSV_OFF, 0);
}
}
return res;

View file

@ -16,9 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// defines to set RGB-led behaviour. Off by default
#define CAPS_LOCK_ENABLE false
#define CAPS_LOCK_COLOR HSV_ORANGE
#define CAPS_LOCK_ENABLE true
//#define CAPS_LOCK_COLOR HSV_ORANGE
#include "quantum.h"