[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:
parent
b8cb147573
commit
cf152dd16b
6 changed files with 39 additions and 37 deletions
|
@ -21,8 +21,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[0] = LAYOUT_all(
|
[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_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_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_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_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_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)),
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, MO(1)),
|
||||||
// basic function layer
|
// basic function layer
|
||||||
[1] = LAYOUT_all(
|
[1] = LAYOUT_all(
|
||||||
|
|
|
@ -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] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
// main layer
|
// main layer
|
||||||
[0] = LAYOUT_all(
|
[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_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_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_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_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)),
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, MO(1)),
|
||||||
// basic function layer
|
// basic function layer
|
||||||
[1] = LAYOUT_all(
|
[1] = LAYOUT_all(
|
||||||
|
|
|
@ -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 led_update_kb(led_t led_state) {
|
||||||
bool res = led_update_user(led_state);
|
bool res = led_update_user(led_state);
|
||||||
if(CAPS_LOCK_ENABLE){
|
if (CAPS_LOCK_ENABLE && res) {
|
||||||
if(res) {
|
|
||||||
if(led_state.caps_lock) {
|
if(led_state.caps_lock) {
|
||||||
rgblight_enable();
|
#ifdef CAPS_LOCK_COLOR
|
||||||
rgblight_mode(1);
|
rgblight_sethsv_at(CAPS_LOCK_COLOR, 0);
|
||||||
rgblight_sethsv_noeeprom(CAPS_LOCK_COLOR);
|
#else
|
||||||
|
rgblight_sethsv_at(rgblight_get_hue(),rgblight_get_sat(),rgblight_get_val(), 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
rgblight_disable_noeeprom();
|
rgblight_sethsv_at(HSV_OFF, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -16,9 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// defines to set RGB-led behaviour. Off by default
|
#define CAPS_LOCK_ENABLE true
|
||||||
#define CAPS_LOCK_ENABLE false
|
//#define CAPS_LOCK_COLOR HSV_ORANGE
|
||||||
#define CAPS_LOCK_COLOR HSV_ORANGE
|
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,14 @@ bool led_update_kb(led_t led_state) {
|
||||||
bool res = led_update_user(led_state);
|
bool res = led_update_user(led_state);
|
||||||
if (CAPS_LOCK_ENABLE && res) {
|
if (CAPS_LOCK_ENABLE && res) {
|
||||||
if(led_state.caps_lock) {
|
if(led_state.caps_lock) {
|
||||||
rgblight_enable();
|
#ifdef CAPS_LOCK_COLOR
|
||||||
rgblight_mode(1);
|
rgblight_sethsv_at(CAPS_LOCK_COLOR, 0);
|
||||||
rgblight_sethsv_noeeprom(CAPS_LOCK_COLOR);
|
#else
|
||||||
} else {
|
rgblight_sethsv_at(rgblight_get_hue(),rgblight_get_sat(),rgblight_get_val(), 0);
|
||||||
rgblight_disable_noeeprom();
|
#endif
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
rgblight_sethsv_at(HSV_OFF, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -16,9 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// defines to set RGB-led behaviour. Off by default
|
#define CAPS_LOCK_ENABLE true
|
||||||
#define CAPS_LOCK_ENABLE false
|
//#define CAPS_LOCK_COLOR HSV_ORANGE
|
||||||
#define CAPS_LOCK_COLOR HSV_ORANGE
|
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue