2021-12-29 20:17:34 -08:00
|
|
|
// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2020-10-17 11:46:57 -07:00
|
|
|
|
2018-08-29 10:42:15 -07:00
|
|
|
#include "template.h"
|
|
|
|
|
2017-11-10 19:58:53 -08:00
|
|
|
// Add reconfigurable functions here, for keymap customization
|
|
|
|
// This allows for a global, userspace functions, and continued
|
|
|
|
// customization of the keymap. Use _keymap instead of _user
|
|
|
|
// functions in the keymaps
|
2019-11-20 12:37:24 -08:00
|
|
|
__attribute__((weak)) void matrix_init_keymap(void) {}
|
2017-11-10 19:58:53 -08:00
|
|
|
|
|
|
|
// Call user matrix init, then call the keymap's init function
|
2019-11-20 12:37:24 -08:00
|
|
|
void matrix_init_user(void) { matrix_init_keymap(); }
|
2017-11-10 19:58:53 -08:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
__attribute__((weak)) void matrix_scan_keymap(void) {}
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2017-11-10 19:58:53 -08:00
|
|
|
// No global matrix scan code, so just run keymap's matix
|
|
|
|
// scan function
|
2019-11-20 12:37:24 -08:00
|
|
|
void matrix_scan_user(void) { matrix_scan_keymap(); }
|
2017-11-10 19:58:53 -08:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2017-11-10 19:58:53 -08:00
|
|
|
// Defines actions tor my global custom keycodes. Defined in drashna.h file
|
|
|
|
// Then runs the _keymap's recod handier if not processed here,
|
|
|
|
// And use "NEWPLACEHOLDER" for new safe range
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
2019-11-20 12:37:24 -08:00
|
|
|
switch (keycode) {
|
|
|
|
case VRSN:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
2017-11-10 19:58:53 -08:00
|
|
|
}
|
2019-11-20 12:37:24 -08:00
|
|
|
return process_record_keymap(keycode, record);
|
2017-11-10 19:58:53 -08:00
|
|
|
}
|
2017-12-05 18:45:42 -08:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; }
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
layer_state_t layer_state_set_user(layer_state_t state) { return layer_state_set_keymap(state); }
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {}
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); }
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
__attribute__((weak)) void suspend_power_down_keymap(void) {}
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
void suspend_power_down_user(void) { suspend_power_down_keymap(); }
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
__attribute__((weak)) void suspend_wakeup_init_keymap(void) {}
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
void suspend_wakeup_init_user(void) {
|
|
|
|
suspend_wakeup_init_keymap();
|
|
|
|
#ifdef KEYBOARD_ergodox_ez
|
|
|
|
wait_ms(10);
|
|
|
|
#endif
|
2018-08-29 10:42:15 -07:00
|
|
|
}
|
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
__attribute__((weak)) void startup_keymap(void) {}
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
void startup_user(void) {
|
|
|
|
#ifdef RGBLIGHT_ENABLE
|
2018-08-29 10:42:15 -07:00
|
|
|
matrix_init_rgb();
|
2019-11-20 12:37:24 -08:00
|
|
|
#endif // RGBLIGHT_ENABLE
|
|
|
|
startup_keymap();
|
2018-08-29 10:42:15 -07:00
|
|
|
}
|
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
__attribute__((weak)) void shutdown_keymap(void) {}
|
2018-08-29 10:42:15 -07:00
|
|
|
|
2019-11-20 12:37:24 -08:00
|
|
|
void shutdown_user(void) { shutdown_keymap(); }
|