mcrown.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /** @file mcrown.h
  2. * @brief mcrown header thant incluedes key layout and some definintions.
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. * @author Mario Corona (mariocc@comunidad.unam.mx) 2021
  18. *
  19. */
  20. #pragma once
  21. #include QMK_KEYBOARD_H
  22. #include "oled.h"
  23. #define KC_XXXXX KC_NO
  24. #define KC_LOWER LOWER
  25. #define KC_RAISE RAISE
  26. #define KC_CTLTB CTL_T(KC_TAB)
  27. #define KC_GUIEI GUI_T(KC_LANG2)
  28. #define KC_ALTKN ALT_T(KC_LANG1)
  29. #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
  30. /* For values greater than 0x200, substract that value and add 0x20 so the characters can be mapped */
  31. #define RM_LSFT(kc) ((uint8_t)(0x20)+(kc-0x200))
  32. /* ######################################################################### LAYOUT BLOCKS ##################################################### */
  33. /* -----------------------------------------BUTTON1---BUTTON2- BUTTON3------- */
  34. #define _____________MOD_LEFT_____________ KC_GUIEI, KC_LOWER, KC_SPC
  35. #define _____________MOD_RIGHT____________ KC_ENT, KC_RAISE, KC_ALTKN
  36. /* ------------------------------------------------------------COL1------COL2-----COL3-----COL4-----COL5-----COL6--------- */
  37. #define _____________________RAISE_L1_______________________ KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC
  38. #define _____________________RAISE_L2_______________________ KC_LSFT, KC_MPLY, KC_VOLU, KC_MNXT, XXXXXXX, XXXXXXX
  39. #define _____________________RAISE_L3_______________________ KC_CTLTB, KC_CALC, KC_VOLD, KC_MPRV, KC_BRIU, KC_BRID
  40. #define _____________________RAISE_R1_______________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL
  41. #define _____________________RAISE_R2_______________________ KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV
  42. #define _____________________RAISE_R3_______________________ KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TILD
  43. /* ------------------------------------------------------------COL1------COL2-----COL3-----COL4-----COL5-----COL6--------- */
  44. #define _____________________QWERTY_L1______________________ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T
  45. #define _____________________QWERTY_L2______________________ KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G
  46. #define _____________________QWERTY_L3______________________ KC_CTLTB, KC_Z, KC_X, KC_C, KC_V, KC_B
  47. #define _____________________QWERTY_R1______________________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC
  48. #define _____________________QWERTY_R2______________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT
  49. #define _____________________QWERTY_R3______________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT
  50. /* ------------------------------------------------------------COL1------COL2-----COL3-----COL4-----COL5-----COL6--------- */
  51. #define _____________________LOWER_L1_______________________ KC_CAPS, KC_1, KC_2, KC_3, KC_4, KC_5
  52. #define _____________________LOWER_L2_______________________ KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN
  53. #define _____________________LOWER_L3_______________________ KC_CTLTB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
  54. #define _____________________LOWER_R1_______________________ KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC
  55. #define _____________________LOWER_R2_______________________ KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_HOME, KC_END
  56. #define _____________________LOWER_R3_______________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11
  57. /* ------------------------------------------------------------COL1------COL2-----COL3-----COL4-----COL5-----COL6--------- */
  58. #define _____________________ADJUST_L1______________________ XXXXXXX, EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  59. #if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)
  60. #define _____________________ADJUST_L2______________________ XXXXXXX, XXXXXXX, RGB_SPI, RGB_SAI, RGB_HUI, RGB_VAI
  61. #define _____________________ADJUST_L3______________________ XXXXXXX, XXXXXXX, RGB_SPD, RGB_SAD, RGB_HUD, RGB_VAD
  62. #else/* ---------------------------------------------------------------|---------|--------|--------|--------|------------- */
  63. #define _____________________ADJUST_L2______________________ M_VRSN, M_MALL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  64. #define _____________________ADJUST_L3______________________ M_FLSH, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  65. #endif/* --------------------------------------------------------------|---------|--------|--------|--------|------------- */
  66. #if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)
  67. #define _____________________ADJUST_R1______________________ RGB_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  68. #define _____________________ADJUST_R3______________________ RGB_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  69. #else/* ---------------------------------------------------------------|---------|--------|--------|--------|------------- */
  70. #define _____________________ADJUST_R1______________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  71. #define _____________________ADJUST_R3______________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  72. #endif/* --------------------------------------------------------------|---------|--------|--------|--------|------------- */
  73. #define _____________________ADJUST_R2______________________ RGB_RMOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  74. /* Each layer gets a name for readability */
  75. typedef enum custom_layers {
  76. _QWERTY,
  77. _DVORAK,
  78. _COLEMAK,
  79. _LOWER,
  80. _RAISE,
  81. _ADJUST,
  82. _NUMPAD,
  83. _MAX_LAYERS
  84. }CUSTOM_LAYERS_T;
  85. /* To be used to identify the current working layer */
  86. typedef enum custom_keycodes{
  87. QWERTY = SAFE_RANGE,
  88. LOWER,
  89. RAISE,
  90. ADJUST,
  91. BACKLIT,
  92. RGBRST
  93. }CUSTOM_KEYCODES_T;