1 #include "konstantin.h"
4 static void toggle_numpad(void) {
5 layer_invert(L_NUMPAD);
6 bool num_lock = host_keyboard_leds() & 1<<USB_LED_NUM_LOCK;
7 if (num_lock != (bool)IS_LAYER_ON(L_NUMPAD)) {
8 tap_code(KC_NLCK); // Toggle Num Lock to match layer state
14 bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
18 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
19 if (!process_record_keymap(keycode, record)) {
25 if (record->event.pressed) {
26 SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE));
34 if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) {
35 fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this
42 if (record->event.pressed) {
49 if (record->event.pressed) {
51 if (IS_LAYER_ON(L_NUMPAD)) {
57 if (IS_LAYER_ON(L_FN) && fn_lock) {
59 return fn_lock = false;
71 uint32_t layer_state_set_keymap(uint32_t state) {
75 uint32_t layer_state_set_user(uint32_t state) {
76 return layer_state_set_keymap(state);