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.

104 lines
2.6 KiB

  1. /* Copyright 2019-2021 Konstantin Đorđević <vomindoraan@gmail.com>
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #include "quantum.h"
  18. #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
  19. #include "rgb.h"
  20. #endif
  21. #ifdef TAP_DANCE_ENABLE
  22. #include "tap_dance.h"
  23. #endif
  24. #if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE)
  25. #include "unicode.h"
  26. #endif
  27. #ifdef LAYER_FN
  28. #define FN MO(L_FN)
  29. #define FNLK TG(L_FN)
  30. #define FN_CAPS LT(L_FN, KC_CAPS)
  31. #define FN_ESC LT(L_FN, KC_ESC)
  32. #define FN_FNLK TT(L_FN)
  33. #endif
  34. #ifdef LAYER_NUMPAD
  35. #define NUMPAD TG(L_NUMPAD)
  36. #endif
  37. #define BREAK LCTL(KC_PAUS)
  38. #define SYSRQ LALT(KC_PSCR)
  39. #define MV_UP LCTL(KC_UP)
  40. #define MV_DOWN LCTL(KC_DOWN)
  41. #define MV_LEFT LCTL(KC_LEFT)
  42. #define MV_RGHT LCTL(KC_RGHT)
  43. #define TOP LCTL(KC_HOME)
  44. #define BOTTOM LCTL(KC_END)
  45. #define TAB_PRV LCTL(KC_PGUP)
  46. #define TAB_NXT LCTL(KC_PGDN)
  47. #define DEL_PRV LCTL(KC_BSPC)
  48. #define DEL_NXT LCTL(KC_DEL)
  49. #define DST_ADD LCTL(LGUI(KC_D))
  50. #define DST_REM LCTL(LGUI(KC_F4))
  51. #define DST_PRV LCTL(LGUI(KC_LEFT))
  52. #define DST_NXT LCTL(LGUI(KC_RGHT))
  53. #ifndef DST_MOD_MASK
  54. #define DST_MOD_MASK MOD_MASK_SHIFT
  55. #endif
  56. #define LCT_CPS LCTL_T(KC_CAPS)
  57. #define RSF_SLS RSFT_T(KC_SLSH)
  58. // Clear mods, perform action, restore mods
  59. #define CLEAN_MODS(action) { \
  60. uint8_t mods = get_mods(); \
  61. clear_mods(); \
  62. action; \
  63. set_mods(mods); \
  64. }
  65. enum layers_user {
  66. L_BASE,
  67. #ifdef LAYER_FN
  68. L_FN,
  69. #endif
  70. #ifdef LAYER_NUMPAD
  71. L_NUMPAD,
  72. #endif
  73. LAYERS_KEYMAP,
  74. };
  75. enum keycodes_user {
  76. CLEAR = SAFE_RANGE,
  77. DST_P_R,
  78. DST_N_A,
  79. RANGE_KEYMAP,
  80. };
  81. void keyboard_pre_init_keymap(void);
  82. void eeconfig_init_keymap(void);
  83. void keyboard_post_init_keymap(void);
  84. layer_state_t layer_state_set_keymap(layer_state_t state);
  85. void led_set_keymap(uint8_t usb_led);
  86. bool led_update_keymap(led_t led_state);
  87. bool process_record_keymap(uint16_t keycode, keyrecord_t *record);