aboutsummaryrefslogtreecommitdiff
path: root/users/konstantin/konstantin.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/konstantin/konstantin.c')
-rw-r--r--users/konstantin/konstantin.c52
1 files changed, 32 insertions, 20 deletions
diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c
index 9e3caca41..c56c9490f 100644
--- a/users/konstantin/konstantin.c
+++ b/users/konstantin/konstantin.c
@@ -32,26 +32,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
32 } 32 }
33 33
34 switch (keycode) { 34 switch (keycode) {
35 case CLEAR: 35 uint16_t kc;
36 if (record->event.pressed) {
37 SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE));
38 }
39 return false;
40
41 case DST_P_R:
42 (record->event.pressed ? register_code16 : unregister_code16)(
43 (get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV
44 );
45 return false;
46
47 case DST_N_A:
48 (record->event.pressed ? register_code16 : unregister_code16)(
49 (get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT
50 );
51 return false;
52
53#ifdef LAYER_FN 36#ifdef LAYER_FN
54 static bool fn_lock; 37 static bool fn_lock = false;
55 38
56 case FN_FNLK: 39 case FN_FNLK:
57 if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { 40 if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) {
@@ -77,6 +60,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
77 } 60 }
78 return true; 61 return true;
79 62
63 case CLEAR:
64 if (record->event.pressed) {
65 CLEAN_MODS(
66 SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE));
67 )
68 }
69 return false;
70
71 case DST_P_R:
72 kc = (get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV;
73 CLEAN_MODS(
74 (record->event.pressed ? register_code16 : unregister_code16)(kc);
75 )
76 return false;
77
78 case DST_N_A:
79 kc = (get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT;
80 CLEAN_MODS(
81 (record->event.pressed ? register_code16 : unregister_code16)(kc);
82 )
83 return false;
84
80 default: 85 default:
81 return true; 86 return true;
82 } 87 }
@@ -91,7 +96,7 @@ uint32_t layer_state_set_user(uint32_t state) {
91 state = layer_state_set_keymap(state); 96 state = layer_state_set_keymap(state);
92 97
93#ifdef LAYER_NUMPAD 98#ifdef LAYER_NUMPAD
94 bool numpad = state & 1UL<<L_NUMPAD; 99 bool numpad = IS_LAYER_ON_STATE(state, L_NUMPAD);
95 bool num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); 100 bool num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK);
96 if (numpad != num_lock) { 101 if (numpad != num_lock) {
97 tap_code(KC_NLCK); // Toggle Num Lock to match Numpad layer state 102 tap_code(KC_NLCK); // Toggle Num Lock to match Numpad layer state
@@ -100,3 +105,10 @@ uint32_t layer_state_set_user(uint32_t state) {
100 105
101 return state; 106 return state;
102} 107}
108
109__attribute__((weak))
110void led_set_keymap(uint8_t usb_led) {}
111
112void led_set_user(uint8_t usb_led) {
113 led_set_keymap(usb_led);
114}