keymap.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. Copyright 2019 @foostan
  3. Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
  4. Copyright 2021 Rocco Meli <@RMeli>
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 2 of the License, or
  8. (at your option) any later version.
  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. 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. #include QMK_KEYBOARD_H
  17. #include "rmeli.h"
  18. // + -------------------- +
  19. // + RGB MATRIX CALLBACKS |
  20. // + -------------------- +
  21. // LED numbers:
  22. // https://github.com/foostan/crkbd/blob/main/corne-classic/doc/buildguide_en.md
  23. // Change LED color to red when CAPS LOCK is active
  24. bool rgb_matrix_indicators_user(void) {
  25. if (host_keyboard_led_state().caps_lock) {
  26. rgb_matrix_set_color(26, 255, 0, 0);
  27. // Only works with SPLIT_LED_STATE_ENABLE
  28. rgb_matrix_set_color(53, 255, 0, 0);
  29. }
  30. return false;
  31. }
  32. // + ---- +
  33. // + OLED |
  34. // + ---- +
  35. bool oled_task_user(void) {
  36. if (is_keyboard_master()) {
  37. oled_render_rocco();
  38. } else {
  39. oled_render_meli();
  40. }
  41. return false;
  42. }
  43. // + ------- +
  44. // + KEY MAP |
  45. // + ------- +
  46. // Layer names
  47. enum layer_names {
  48. _QWERTY,
  49. _COLEMAK_DH,
  50. _DWN,
  51. _UP,
  52. _CONFIG,
  53. };
  54. // Layer names shortcuts
  55. #define _QWY 0
  56. #define _CMK 1
  57. #define _CFG 4
  58. #define ______THUMB_LEFT_x3______ KC_LGUI, MO(_DWN), KC_SPC
  59. #define ______THUMB_RIGHT_x3_____ KC_ENT, MO(_UP), KC_RCTL
  60. // LAYOUT
  61. //
  62. // |-----------------------------| |-----------------------------|
  63. // | | | | | | | | | | | | | |
  64. // |----+----+----+----+----+----| |----+----+----+----+----+----|
  65. // | | | | | | | | | | | | | |
  66. // |----+----+----+----+----+----| |----+----+----+----+----+----|
  67. // | | | | | | | | | | | | | |
  68. // |----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
  69. // | | | | | | | |
  70. // |--------------| |--------------|
  71. // Define wrapper for standard CRKB layout
  72. #define LAYOUT_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__)
  73. // clang-format off
  74. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  75. [_QWERTY] = LAYOUT_wrapper(
  76. // clang-format off
  77. ___________________QWERTY_L1_x6_____________________, ___________________QWERTY_R1_x6_____________________,
  78. ___________________QWERTY_L2_x6_____________________, ___________________QWERTY_R2_x6_____________________,
  79. ___________________QWERTY_L3_x6_____________________, ___________________QWERTY_R3_x6_____________________,
  80. ______THUMB_LEFT_x3______, ______THUMB_RIGHT_x3_____
  81. ),
  82. [_COLEMAK_DH] = LAYOUT_wrapper(
  83. ________________COLEMAK_MOD_DH_L1_x6________________, ________________COLEMAK_MOD_DH_R1_x6________________,
  84. ________________COLEMAK_MOD_DH_L2_x6________________, ________________COLEMAK_MOD_DH_R2_x6________________,
  85. ________________COLEMAK_MOD_DH_L3_x6________________, ________________COLEMAK_MOD_DH_R3_x6________________,
  86. ______THUMB_LEFT_x3______, ______THUMB_RIGHT_x3_____
  87. ),
  88. [_DWN] = LAYOUT_wrapper(
  89. _______, ______________NUMBER_LEFT_x5_______________, ______________NUMBER_RIGHT_x5______________, _______,
  90. _______, ______________UNICODE_L2_x5________________, ________________NAV_R2_x5__________________, XXXXXXX,
  91. _______, ______________UNICODE_L3_x5________________, ________________NAV_R3_x5__________________, _______,
  92. KC_LGUI, _______, _______, _______,MO(_CFG), _______
  93. ),
  94. [_UP] = LAYOUT_wrapper(
  95. ___________________SYMBOL_LEFT_x6___________________, ___________________SYMBOL_RIGHT_x6__________________,
  96. _______, ____________NAV_VIM_x4____________, XXXXXXX, ____________________SYMBOL_R2_x6____________________,
  97. _______, _________________NONE_5x___________________, ____________________SYMBOL_R3_x6____________________,
  98. _______,MO(_CFG), _______, _______, _______, _______
  99. ),
  100. [_CONFIG] = LAYOUT_wrapper(
  101. QK_BOOT, _________________NONE_5x___________________, _______________CONFIG_R1_x5________________,DF(_QWY),
  102. RGB_TOG, ________________RGB_L2_x5__________________, _______________CONFIG_R2_x5________________, XXXXXXX,
  103. XXXXXXX, ________________RGB_L3_x5__________________, _______________CONFIG_R3_x5________________,DF(_CMK),
  104. _______, _______, _______, _______, _______, _______
  105. )
  106. };
  107. // clang-format on