You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
2.5 KiB

  1. #include "template.h"
  2. // Add reconfigurable functions here, for keymap customization
  3. // This allows for a global, userspace functions, and continued
  4. // customization of the keymap. Use _keymap instead of _user
  5. // functions in the keymaps
  6. __attribute__ ((weak))
  7. void matrix_init_keymap(void) {}
  8. // Call user matrix init, then call the keymap's init function
  9. void matrix_init_user(void) {
  10. matrix_init_keymap();
  11. }
  12. __attribute__ ((weak))
  13. void matrix_scan_keymap(void) {}
  14. // No global matrix scan code, so just run keymap's matix
  15. // scan function
  16. __attribute__ ((weak))
  17. void matrix_scan_user(void) {
  18. matrix_scan_keymap();
  19. }
  20. __attribute__ ((weak))
  21. bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
  22. return true;
  23. }
  24. // Defines actions tor my global custom keycodes. Defined in drashna.h file
  25. // Then runs the _keymap's recod handier if not processed here,
  26. // And use "NEWPLACEHOLDER" for new safe range
  27. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  28. switch (keycode) {
  29. case KC_MAKE:
  30. if (!record->event.pressed) {
  31. SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
  32. #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
  33. ":dfu"
  34. #elif defined(BOOTLOADER_HALFKAY)
  35. ":teensy"
  36. #elif defined(BOOTLOADER_CATERINA)
  37. ":avrdude"
  38. #endif
  39. SS_TAP(X_ENTER));
  40. }
  41. return false;
  42. break;
  43. case VRSN:
  44. if (record->event.pressed) {
  45. SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
  46. }
  47. return false;
  48. break;
  49. }
  50. return process_record_keymap(keycode, record);
  51. }
  52. __attribute__ ((weak))
  53. uint32_t layer_state_set_keymap (uint32_t state) {
  54. return state;
  55. }
  56. uint32_t layer_state_set_user (uint32_t state) {
  57. return layer_state_set_keymap (state);
  58. }
  59. __attribute__ ((weak))
  60. void led_set_keymap(uint8_t usb_led) {}
  61. void led_set_user(uint8_t usb_led) {
  62. led_set_keymap(usb_led);
  63. }
  64. __attribute__ ((weak))
  65. void suspend_power_down_keymap(void) {}
  66. void suspend_power_down_user(void)
  67. {
  68. suspend_power_down_keymap();
  69. }
  70. __attribute__ ((weak))
  71. void suspend_wakeup_init_keymap(void) {}
  72. void suspend_wakeup_init_user(void)
  73. {
  74. suspend_wakeup_init_keymap();
  75. #ifdef KEYBOARD_ergodox_ez
  76. wait_ms(10);
  77. #endif
  78. }
  79. __attribute__ ((weak))
  80. void startup_keymap(void) {}
  81. void startup_user (void) {
  82. #ifdef RGBLIGHT_ENABLE
  83. matrix_init_rgb();
  84. #endif //RGBLIGHT_ENABLE
  85. startup_keymap();
  86. }
  87. __attribute__ ((weak))
  88. void shutdown_keymap(void) {}
  89. void shutdown_user (void) {
  90. shutdown_keymap();
  91. }