3 // Add reconfigurable functions here, for keymap customization
4 // This allows for a global, userspace functions, and continued
5 // customization of the keymap. Use _keymap instead of _user
6 // functions in the keymaps
8 void matrix_init_keymap(void) {}
10 __attribute__ ((weak))
11 void matrix_scan_keymap(void) {}
13 __attribute__ ((weak))
14 bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
17 __attribute__ ((weak))
18 uint32_t layer_state_set_keymap (uint32_t state) {
21 __attribute__ ((weak))
22 void led_set_keymap(uint8_t usb_led) {}
24 __attribute__ ((weak))
25 void action_function_keymap(keyrecord_t *record, uint8_t id, uint8_t opt) {}
27 // Call user matrix init, then call the keymap's init function
28 void matrix_init_user(void) {
32 // No global matrix scan code, so just run keymap's matix
34 void matrix_scan_user(void) {
38 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
41 mod_or_mod_with_macro(record, KC_LGUI, SS_TAP(X_TAB));
44 mod_or_mod_with_macro(record, KC_RGUI, SS_TAP(X_GRAVE));
48 if (record->event.pressed) {
51 if (get_mods()&(MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT))) {
52 SEND_STRING(SS_TAP(X_NONUS_BSLASH));
54 SEND_STRING(SS_LALT("3"));
58 SEND_STRING(SS_LCTRL("a"));
61 SEND_STRING(SS_LGUI(SS_LALT("c")));
64 SEND_STRING(SS_LGUI("L"));
66 case ISO_COUNTRY_CODE:
67 SEND_STRING("country_iso_alpha2_code");
70 return process_record_keymap(keycode, record);
74 return process_record_keymap(keycode, record);
77 static uint16_t sunds_timer;
79 void mod_or_mod_with_macro(keyrecord_t *record, uint16_t kc_mod, char* macro) {
80 if (record->event.pressed) {
81 sunds_timer = timer_read();
82 register_code(kc_mod);
84 if (timer_elapsed(sunds_timer) < TAPPING_TERM) {
87 unregister_code(kc_mod);
91 // Runs state check and changes underglow color and animation
92 // on layer change, no matter where the change was initiated
93 // Then runs keymap's layer change check
94 uint32_t layer_state_set_user (uint32_t state) {
95 return layer_state_set_keymap (state);
98 void led_set_user(uint8_t usb_led) {
99 led_set_keymap(usb_led);