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.

140 lines
7.7 KiB

  1. /*
  2. Copyright 2019 @foostan
  3. Copyright 2020 Ben Lipson <ben.j.lipson@gmail.com>
  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. 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. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #include QMK_KEYBOARD_H
  16. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  17. [0] = LAYOUT_split_3x6_3(
  18. //,-----------------------------------------------------. ,-----------------------------------------------------.
  19. KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
  20. //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  21. KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
  22. //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  23. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
  24. //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
  25. MO(1), KC_LGUI, KC_SPC, KC_SPC, KC_RALT, MO(2)
  26. //`--------------------------' `--------------------------'
  27. ),
  28. [1] = LAYOUT_split_3x6_3(
  29. //,-----------------------------------------------------. ,-----------------------------------------------------.
  30. KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_UP, KC_LPRN, KC_RPRN, KC_BSLS,
  31. //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  32. KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, KC_ENT,
  33. //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  34. KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_END, KC_HOME, KC_PGDN, KC_PGUP, KC_RSFT,
  35. //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
  36. _______, KC_LGUI, KC_SPC, KC_SPC, KC_RALT, MO(3)
  37. //`--------------------------' `--------------------------'
  38. ),
  39. [2] = LAYOUT_split_3x6_3(
  40. //,-----------------------------------------------------. ,-----------------------------------------------------.
  41. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
  42. //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  43. KC_LCTL, KC_ASTR, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  44. //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  45. KC_BSLS, KC_PIPE, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  46. //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
  47. MO(3), KC_LGUI, KC_SPC, KC_SPC, KC_RALT, _______
  48. //`--------------------------' `--------------------------'
  49. ),
  50. [3] = LAYOUT_split_3x6_3(
  51. //,-------------------------------------------------------------------------------. ,------------------------------------------------------------------.
  52. KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET,
  53. //|----------+------------+--------------+---------------+-----------+------------| |------------+------------+------------+--------+--------+---------|
  54. KC_LCTL, A(KC_F12), A(G(KC_LEFT)), A(G(KC_RIGHT)), S(KC_F6), C(S(KC_D)), C(S(KC_R)), G(KC_LBRC), G(KC_RBRC), KC_F11, KC_F12, KC_MPLY,
  55. //|----------+------------+--------------+---------------+-----------+------------| |------------+------------+------------+--------+--------+---------|
  56. G(KC_F2), A(G(KC_F)), KC_MUTE, KC__VOLDOWN, KC__VOLUP, G(KC_GRV), C(G(KC_G)), KC_TAB, S(KC_TAB), KC_BRID, KC_BRIU, KC_CAPS,
  57. //|----------+------------+--------------+---------------+-----------+------------+--------| |--------+------------+------------+------------+--------+--------+---------|
  58. _______, KC_LGUI, KC_SPC, KC_SPC, KC_RALT, _______
  59. //`----------------------------------' `-------------------------------'
  60. )
  61. };
  62. #ifdef OLED_ENABLE
  63. oled_rotation_t oled_init_user(oled_rotation_t rotation) {
  64. if (!is_keyboard_left()) {
  65. return OLED_ROTATION_180; // flips the display 180 degrees if offhand
  66. }
  67. return rotation;
  68. }
  69. #define L_BASE 0
  70. #define L_LOWER 2
  71. #define L_RAISE 4
  72. #define L_ADJUST 8
  73. void oled_render_layer_state(void) {
  74. oled_write_P(PSTR("Layer: "), false);
  75. switch (layer_state) {
  76. case L_BASE:
  77. oled_write_ln_P(PSTR("Default"), false);
  78. break;
  79. case L_LOWER:
  80. oled_write_ln_P(PSTR("Lower"), false);
  81. break;
  82. case L_RAISE:
  83. oled_write_ln_P(PSTR("Raise"), false);
  84. break;
  85. case L_ADJUST:
  86. case L_ADJUST|L_LOWER:
  87. case L_ADJUST|L_RAISE:
  88. case L_ADJUST|L_LOWER|L_RAISE:
  89. oled_write_ln_P(PSTR("Adjust"), false);
  90. break;
  91. }
  92. oled_write_P(PSTR("I love Marce"), false);
  93. }
  94. void render_bootmagic_status(bool status) {
  95. /* Show Ctrl-Gui Swap options */
  96. static const char PROGMEM logo[][2][3] = {
  97. {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
  98. {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
  99. };
  100. if (status) {
  101. oled_write_ln_P(logo[0][0], false);
  102. oled_write_ln_P(logo[0][1], false);
  103. } else {
  104. oled_write_ln_P(logo[1][0], false);
  105. oled_write_ln_P(logo[1][1], false);
  106. }
  107. }
  108. void oled_render_logo(void) {
  109. static const char PROGMEM crkbd_logo[] = {
  110. 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
  111. 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
  112. 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
  113. 0};
  114. oled_write_P(crkbd_logo, false);
  115. }
  116. bool oled_task_user(void) {
  117. if (is_keyboard_master()) {
  118. oled_render_layer_state();
  119. } else {
  120. oled_render_logo();
  121. }
  122. return false;
  123. }
  124. #endif // OLED_ENABLE