Skip to content

Commit 443d306

Browse files
authored
[Keymap] Jonavin userspace keymap updates INVERT_NUMLOCK_INDICATOR (#14880)
Co-authored-by: Jonavin <=>
1 parent 09daafd commit 443d306

File tree

14 files changed

+93
-25
lines changed

14 files changed

+93
-25
lines changed

keyboards/gmmk/pro/ansi/keymaps/jonavin/keymap.c

+13-4
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
124124
rgb_matrix_set_color(LED_L1, RGB_GREEN);
125125
rgb_matrix_set_color(LED_L2, RGB_GREEN);
126126
}
127-
if (!IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // on if NUM lock is OFF
128-
rgb_matrix_set_color(LED_L3, RGB_MAGENTA);
129-
rgb_matrix_set_color(LED_L4, RGB_MAGENTA);
130-
}
127+
128+
#ifdef INVERT_NUMLOCK_INDICATOR
129+
if (!IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // on if NUM lock is OFF
130+
rgb_matrix_set_color(LED_L3, RGB_MAGENTA);
131+
rgb_matrix_set_color(LED_L4, RGB_MAGENTA);
132+
}
133+
#else
134+
if (IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // Normal, on if NUM lock is ON
135+
rgb_matrix_set_color(LED_L3, RGB_MAGENTA);
136+
rgb_matrix_set_color(LED_L4, RGB_MAGENTA);
137+
}
138+
#endif // INVERT_NUMLOCK_INDICATOR
139+
131140
if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
132141
rgb_matrix_set_color(LED_L5, RGB_RED);
133142
rgb_matrix_set_color(LED_L6, RGB_RED);

keyboards/gmmk/pro/ansi/keymaps/jonavin/readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ TD_LSFT_CAPSLOCK_ENABLE = yes
4444
IDLE_TIMEOUT_ENABLE = yes
4545
- Enables Timer functionality; for RGB idle timeouts that can be changed dynamically
4646

47+
INVERT_NUMLOCK_INDICATOR
48+
- inverts the Num lock indicator, LED is on when num lokc is off
49+
4750
COLEMAK_LAYER_ENABLE = yes
4851
- Enabled optional 5th layer for COLEMAK layout
4952
- Use Shift and encoder to enter 5th layer, right led indicator lights up BLUE

keyboards/gmmk/pro/ansi/keymaps/jonavin/rules.mk

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ STARTUP_NUMLOCK_ON = yes
99
ENCODER_DEFAULTACTIONS_ENABLE = no
1010

1111
COLEMAK_LAYER_ENABLE = yes #Enable Colemak layer / set to no to disable
12+
INVERT_NUMLOCK_INDICATOR = yes

keyboards/keebio/quefrency/keymaps/jonavin/keymap.c

+12-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
8989
enum custom_rgblight_layers
9090
{
9191
_rgbCAPS,
92+
_rgbNUMLOCK,
9293
_rgbWINLOCK,
9394
_rgbFN,
9495
_rgbNUMPAD,
@@ -98,7 +99,9 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
9899
const rgblight_segment_t PROGMEM _rgb_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
99100
{14, 1, HSV_RED} // Light 4 LEDs, starting with LED 6
100101
);
101-
const rgblight_segment_t PROGMEM _rgb_winlock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
102+
const rgblight_segment_t PROGMEM _rgb_numlock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
103+
{15, 1, HSV_BLUE}
104+
); const rgblight_segment_t PROGMEM _rgb_winlock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
102105
{13, 1, HSV_PURPLE} // Light 4 LEDs, starting with LED 6
103106
);
104107
const rgblight_segment_t PROGMEM _rgb_fn_layer[] = RGBLIGHT_LAYER_SEGMENTS(
@@ -113,13 +116,21 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
113116

114117
const rgblight_segment_t* const PROGMEM _rgb_layers[] = RGBLIGHT_LAYERS_LIST(
115118
_rgb_capslock_layer,
119+
_rgb_numlock_layer,
116120
_rgb_winlock_layer,
117121
_rgb_fn_layer,
118122
_rgb_numpad_layer
119123
);
120124

121125
bool led_update_user(led_t led_state) {
122126
rgblight_set_layer_state(_rgbCAPS, led_state.caps_lock);
127+
128+
#ifdef INVERT_NUMLOCK_INDICATOR
129+
rgblight_set_layer_state(_rgbNUMLOCK, !led_state.num_lock); // inverse numlock indicator override
130+
#else
131+
rgblight_set_layer_state(_rgbNUMLOCK, led_state.num_lock); // normal, light LED when numlock on
132+
#endif // INVERT_NUMLOCK_INDICATOR
133+
123134
rgblight_set_layer_state(_rgbWINLOCK, keymap_config.no_gui);
124135
return true;
125136
}

keyboards/keebio/quefrency/keymaps/jonavin/readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- additional RGB function key binds to arrow on Fn layer
1818
- Add capslock indicator, win key lock indicator
1919
- Fn and layer 2 indicators using RGB underglow
20+
- Inverted NUM lock indicator (light on when NUM lock is off when INVERT_NUMLOCK_INDICATOR = yes in rules.mk)
2021

2122
rules.mk OPTIONS - Active features from userspace
2223
STARTUP_NUMLOCK_ON = yes

keyboards/keebio/quefrency/keymaps/jonavin/rules.mk

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ TAP_DANCE_ENABLE = yes
77

88
TD_LSFT_CAPSLOCK_ENABLE = yes
99
STARTUP_NUMLOCK_ON = yes
10+
INVERT_NUMLOCK_INDICATOR = yes

keyboards/mechwild/obe/keymaps/jonavin/keymap.c

+20-15
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#ifdef RGBLIGHT_ENABLE
2121
// Custom RGB Colours
22-
#define RGB_OBE_BOW 0x00, 0xE4, 0xFF // colour for matching keycaps
22+
#define HSV_OBE_BOW 180, 100, 100 // colour for matching keycaps
2323
#endif // RGBLIGHT_ENABLE
2424

2525
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -28,8 +28,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
2828
KC_MUTE, KC_GESC, 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_DEL,
2929
KC_PGUP, 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_BSPC,
3030
KC_PGDN, TT(_RAISE), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
31-
KC_LSFTCAPSWIN,KC_Z, KC_X, KC_C, KC_V, KC_B, LT(_LOWER,KC_B), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT,
32-
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN1), LT(_RAISE,KC_SPC), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
31+
KC_LSFTCAPSWIN,KC_Z, KC_X, KC_C, KC_V, KC_B, LT(_LOWER,KC_B), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_SFTUP,KC_RSFT,
32+
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN1), KC_RAISESPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
3333
),
3434
[_FN1] = LAYOUT(
3535
KC_NO, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_INS,
@@ -39,27 +39,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
3939
KC_TRNS,KC_WINLCK,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_HOME, KC_PGDN, KC_END
4040
),
4141
[_LOWER] = LAYOUT(
42-
KC_NO, KC_TILD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_TRNS, KC_DEL,
42+
EEP_RST, KC_TILD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_TRNS, KC_DEL,
4343
RGB_HUI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, EMO_TEARS, EMO_SAD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_TOG,
4444
RGB_HUD, KC_NO, KC_NO, EMO_SHRUG,KC_NO, KC_NO, KC_NO, KC_NO, EMO_JOY, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS,
45-
KC_NO, KC_NO, KC_NO, EMO_CONFUSE,KC_NO,KC_NO,KC_TRNS,EMO_NERVOUS,KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, KC_TRNS,
46-
KC_TRNS, KC_APP, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPD, RGB_RMOD, RGB_SPI
45+
KC_NO, KC_NO, KC_NO, EMO_CONFUSE,KC_NO,KC_NO,KC_TRNS,EMO_NERVOUS, KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, KC_TRNS,
46+
KC_TRNS, KC_APP, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPD, RGB_RMOD,RGB_SPI
4747
),
4848
[_RAISE] = LAYOUT(
49-
KC_NO, KC_TILD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, KC_PSLS, KC_DEL,
50-
KC_NO, KC_NO, KC_HOME,KC_UP, KC_END, KC_PGUP, KC_NO, KC_TAB, KC_P4, KC_P5, KC_P6, KC_NO, KC_NO, KC_NO, KC_PEQL,
51-
KC_NO, TT(_RAISE),KC_LEFT,KC_DOWN, KC_RGHT, KC_PGDN, KC_NO, KC_NO, KC_P1, KC_P2, KC_P3, KC_NO, KC_PAST, KC_PENT,
49+
KC_NO, KC_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, KC_PSLS, KC_DEL,
50+
KC_VOLU, KC_NO, KC_HOME,KC_UP, KC_END, KC_PGUP, KC_NO, KC_TAB, KC_P4, KC_P5, KC_P6, KC_NO, KC_NO, KC_NO, KC_PEQL,
51+
KC_VOLD,TT(_RAISE),KC_LEFT,KC_DOWN,KC_RGHT, KC_PGDN, KC_NO, KC_NO, KC_P1, KC_P2, KC_P3, KC_NO, KC_PAST, KC_PENT,
5252
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_P0, KC_00, KC_NO, KC_PDOT, KC_PSLS, CT_PGUP, KC_TRNS,
53-
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CT_HOME, CT_PGDN, CT_END
53+
KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CT_HOME, CT_PGDN, CT_END
5454
)
5555
};
5656

5757
#ifdef RGBLIGHT_ENABLE
5858

5959
enum custom_rgblight_layers
6060
{
61-
_rgbWINLOCK,
62-
_rgbFN,
61+
_rgbWINLOCK, _rgbFN,
6362
_rgbLOWER,
6463
_rgbRAISE
6564
};
@@ -91,7 +90,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
9190

9291
bool led_update_user(led_t led_state) {
9392
rgblight_set_layer_state(_rgbWINLOCK, keymap_config.no_gui);
94-
return true;
93+
writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
94+
#ifdef INVERT_NUMLOCK_INDICATOR
95+
writePin(LED_NUM_LOCK_PIN, !led_state.num_lock); // inverse numlock indicator override
96+
#else
97+
writePin(LED_NUM_LOCK_PIN, led_state.num_lock); // normal, light LED when numlock on
98+
#endif // INVERT_NUMLOCK_INDICATOR
99+
return false;
95100
}
96101

97102
layer_state_t layer_state_set_user(layer_state_t state) {
@@ -106,8 +111,8 @@ void keyboard_post_init_keymap(void) {
106111
// keyboard_post_init_user() moved to userspace
107112
#ifdef RGBLIGHT_ENABLE
108113
rgblight_enable_noeeprom();
109-
rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT);
110-
rgblight_setrgb(RGB_OBE_BOW); // Default startup colour
114+
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
115+
rgblight_sethsv_noeeprom(HSV_OBE_BOW); // Default startup colour
111116
rgblight_layers = _rgb_layers;
112117
#endif
113118
}

keyboards/mechwild/obe/keymaps/jonavin/readme.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
# Jonavin's MechWild Orange Boy Ergo keymap
22

3-
--> This keymap makes user of user/jonavin userspace
3+
--> This keymap makes use of user/jonavin userspace
44

55
Features
66
- Split spacebars, Split Backspace
7+
- Inverted Num Lock indicator (LED on when num lock if off)
78
- RGB Winlock indicator (requires LED stripto be installed)
89
- RGB Layer indicators: FN/MO1 - Purple; LOWER/MO2 - Yellow; RAISE/MO3/NumPad - Green
910
- quick demo https://youtu.be/gR1awbsouLk
1011

1112
- Add PrtScr, Scroll Lock, Break, NumLock to Fn layer
1213
- Implement Win key lock using Fn+Win
1314
- Layer 2 (LOWER) when right B is held -- for emoticons
14-
- Layer 2 RGB functions
15+
- Layer 2 RGB functions, and EEPROM Reset
1516
- Layer 3 (RAISE) mod on Caps Lock with double-tap to switch to this layer, double tap to switch back
1617
- provides arrows on WASD and additional nav keys + right hand numpad with 00; an be used for Alt Code entry
1718
- left spacebar Backspace
1819
- add double tap of Left Shift to toggle Caps Lock
20+
- Up arrow is also Shift when held
1921

2022

2123
rules.mk OPTIONS - Active features from userspace
@@ -41,6 +43,8 @@ IDLE_TIMEOUT_ENABLE = yes
4143
EMOTICON_ENABLE
4244
- adds EMO_ keycodes for text emojis
4345

46+
INVERT_NUMLOCK_INDICATOR
47+
- inverts the Num lock indicator, LED is on when num lokc is off
48+
4449
## All layers diagram
45-
![image](https://user-images.githubusercontent.com/71780717/135770721-ab263532-f645-4903-99cb-749549944e15.png)
46-
50+
![image](https://user-images.githubusercontent.com/71780717/137356366-6b23c71b-9499-473e-a1e3-c65644135fc6.png)

keyboards/mechwild/obe/keymaps/jonavin/rules.mk

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ TD_LSFT_CAPSLOCK_ENABLE = yes
99
STARTUP_NUMLOCK_ON = yes
1010
ENCODER_DEFAULTACTIONS_ENABLE = yes
1111
EMOTICON_ENABLE = yes
12+
INVERT_NUMLOCK_INDICATOR = yes

users/jonavin/config.h

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define GRAVE_ESC_CTRL_OVERRIDE // Always send Escape if Control is pressed
2424

2525
#define TAPPING_TERM 180
26+
#define TAPPING_TERM_PER_KEY
2627

2728
#ifdef RGB_MATRIX_ENABLE
2829
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR

users/jonavin/jonavin.c

+12
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
341341
};
342342

343343

344+
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
345+
switch (keycode) {
346+
case KC_SFTUP:
347+
return 300;
348+
case KC_RAISESPC:
349+
case KC_LOWERSPC:
350+
return 450;
351+
default:
352+
return TAPPING_TERM;
353+
}
354+
}
355+
344356
// Turn on/off NUM LOCK if current state is different
345357
void activate_numlock(bool turn_on) {
346358
if (IS_HOST_LED_ON(USB_LED_NUM_LOCK) != turn_on) {

users/jonavin/jonavin.h

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ enum custom_user_keycodes {
5555
#define CT_PGDN RCTL(KC_PGDN)
5656
#define CT_HOME RCTL(KC_HOME)
5757
#define CT_END RCTL(KC_END)
58+
#define KC_SFTUP RSFT_T(KC_UP) // Shift when held, Up arrow when tapped
59+
#define KC_RAISESPC LT(_RAISE,KC_SPC) // _RAISE layer mod when held, space when tapped
60+
#define KC_LOWERSPC LT(_LOWER,KC_SPC) // _LOWER layer mod when held, space when tapped
61+
5862

5963
#ifdef TD_LSFT_CAPSLOCK_ENABLE
6064
// Tap Dance Definitions

users/jonavin/readme.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ KEYCODES:
3232
- CT_PGDN Ctrl-PgDn
3333
- CT_HOME Ctrl-HOme
3434
- CT_END Ctrl-End
35+
- KC_SFTUP RShift when held, Up arrow when tapped
36+
- KC_RAISESPC _RAISE layer mod when held, space when tapped
37+
- KC_LOWERSPC _LOWER layer mod when held, space when tapped
3538
-
3639
When EMOTICON_ENABLE = yes
3740
- EMO_SHRUG `\_("/)_/`
3841
- EMO_CONFUSE (*_*)
3942
- EMD_TEARS (T_T)
4043
- EMO_NERVOUS (~_~;)
4144
- EMO_JOY (^o^)
45+
- EMO_SAD :'-(
4246

4347

4448
AVAILABLE ENCODER ACTIONS:
@@ -79,7 +83,15 @@ IDLE_TIMEOUT_ENABLE = yes
7983
- Enables Timer functionality; for RGB idle timeouts that can be changed dynamically
8084
- When enabled, use this in the keymap for an additional matrix processing: void matrix_scan_keymap(void)
8185

82-
- Functions:
86+
EMOTICON_ENABLE
87+
- adds EMO_ keycodes for text emojis
88+
89+
INVERT_NUMLOCK_INDICATOR
90+
- inverts the Num lock indicator, LED is on when num lock is off
91+
92+
93+
FUNCTIONS
94+
------------------------
8395
- u16int_t get_timeout_threshold(void) // returns the current timeout threshold
8496
- void timeout_update_threshold(bool increase) // change threshold: true = increase, false = decrease
8597
- void timeout_reset_timer(void) // resets timer (put in process_record_user if you override it)

users/jonavin/rules.mk

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ endif
1717
ifeq ($(strip $(EMOTICON_ENABLE)), yes)
1818
OPT_DEFS += -DEMOTICON_ENABLE
1919
endif
20+
ifeq ($(strip $(INVERT_NUMLOCK_INDICATOR)), yes)
21+
OPT_DEFS += -DINVERT_NUMLOCK_INDICATOR
22+
endif

0 commit comments

Comments
 (0)