diff options
Diffstat (limited to 'users/konstantin')
| -rw-r--r-- | users/konstantin/konstantin.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c index f5c59f9eb..a567d9166 100644 --- a/users/konstantin/konstantin.c +++ b/users/konstantin/konstantin.c | |||
| @@ -40,22 +40,21 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | |||
| 40 | return true; | 40 | return true; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | #ifdef LAYER_NUMPAD | ||
| 44 | static void toggle_numpad(void) { | ||
| 45 | layer_invert(L_NUMPAD); | ||
| 46 | bool numpad_on = IS_LAYER_ON(L_NUMPAD); | ||
| 47 | bool num_lock_on = IS_HOST_LED_ON(USB_LED_NUM_LOCK); | ||
| 48 | if (num_lock_on != numpad_on) { | ||
| 49 | tap_code(KC_NLCK); // Toggle Num Lock to match layer state | ||
| 50 | } | ||
| 51 | } | ||
| 52 | #endif | ||
| 53 | |||
| 54 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 43 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 55 | if (!process_record_keymap(keycode, record)) { | 44 | if (!process_record_keymap(keycode, record)) { |
| 56 | return false; | 45 | return false; |
| 57 | } | 46 | } |
| 58 | 47 | ||
| 48 | #ifdef LAYER_NUMPAD | ||
| 49 | void toggle_numpad(void) { | ||
| 50 | layer_invert(L_NUMPAD); | ||
| 51 | bool numpad = IS_LAYER_ON(L_NUMPAD), num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); | ||
| 52 | if (num_lock != numpad) { | ||
| 53 | tap_code(KC_NLCK); // Toggle Num Lock to match layer state | ||
| 54 | } | ||
| 55 | } | ||
| 56 | #endif | ||
| 57 | |||
| 59 | switch (keycode) { | 58 | switch (keycode) { |
| 60 | case CLEAR: | 59 | case CLEAR: |
| 61 | if (record->event.pressed) { | 60 | if (record->event.pressed) { |
