keymap.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /* Copyright 2019 Arda Kilicdagi
  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. #include QMK_KEYBOARD_H
  17. enum heisenberg_layers {
  18. _QWERTY,
  19. _LOWER,
  20. _RAISE,
  21. _ADJUST,
  22. _SPACE,
  23. _SODA,
  24. _NUMPAD
  25. };
  26. //KC_NUBS (\|) is equivalent to ["é] key in Turkish keyboards.
  27. //KC_GRV (~ `) is equivalent to [<>|] key in Turkish keyboards.
  28. // KC_SCLN is Turkish s [şŞ] key
  29. // KC_QUOT is Turkish i [iİ] key
  30. // KC_COMM is Turkish o [öÖ] key
  31. // KC_DOT is Turkish c [çÇ] key
  32. // Custom shortcuts specific to Turkish layout
  33. #define CURLY_OPEN RALT(KC_7)
  34. #define CURLY_CLOSE RALT(KC_0)
  35. #define SQUARE_OPEN RALT(KC_8)
  36. #define SQUARE_CLOSE RALT(KC_9)
  37. #define DOLLAR_SIGN RALT(KC_4)
  38. #define BACKSLASH RALT(KC_MINS)
  39. #define VERTICAL_PIPE RALT(KC_EQL)
  40. #define BACKTICK RALT(KC_BSLS)
  41. #define TILDE RALT(KC_RBRC)
  42. #define NUMBER_SIGN RALT(KC_3)
  43. #define LOCKSCREEN LCTL(LSFT(KC_PWR)) // Screen Lock shortcut for OSX
  44. /*
  45. // Unicode Turkish characters, in case it's needed
  46. enum {
  47. TR_C, // ç
  48. TR_C_L, // Ç
  49. TR_I, // ı
  50. TR_I_L, // İ
  51. TR_G, // ğ
  52. TR_G_L, // Ğ
  53. TR_S, // ş
  54. TR_S_L, // Ş
  55. TR_U, // ü
  56. TR_U_L, // Ü
  57. TR_O, // ö
  58. TR_O_L, // Ö
  59. };
  60. // clang-format off
  61. const uint32_t PROGMEM unicode_map[] = {
  62. [TR_C] = 0x00c7,
  63. [TR_C_L] = 0x00e7,
  64. [TR_I] = 0x0130,
  65. [TR_I_L] = 0x0131,
  66. [TR_G] = 0x011e,
  67. [TR_G_L] = 0x011f,
  68. [TR_S] = 0x015e,
  69. [TR_S_L] = 0x015f,
  70. [TR_U] = 0x00dc,
  71. [TR_U_L] = 0x00fc,
  72. [TR_O] = 0x00d6,
  73. [TR_O_L] = 0x00f6,
  74. };
  75. // clang-format on
  76. */
  77. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  78. /* Qwerty
  79. * ,-----------------------------------------------------------------------------------.
  80. * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
  81. * |------+------+------+------+------+------+------+------+------+------+------+------|
  82. * |NPdEsc| A | S | D | F | G | H | J | K | L | Ş | İ |
  83. * |------+------+------+------+------+------+------+------+------+------+------+------|
  84. * |SftCps| Z | X | C | V | B | N | M | Ö | Ç | . |SftEtr|
  85. * |------+------+------+------+------+------+------+------+------+------+------+------|
  86. * |Sda|<>| Ctrl | Alt | OS |Lowr|,| Space* |Rise|"| Left | Down | Up |Right |
  87. * `-----------------------------------------------------------------------------------'
  88. */
  89. [_QWERTY] = LAYOUT_planck_mit(
  90. KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
  91. LT(_NUMPAD, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
  92. LSFT_T(KC_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SC_SENT /*KC_ENT*/,
  93. LT(_SODA, KC_GRV), KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_BSLS), LT(_SPACE, KC_SPC), LT(_RAISE, KC_NUBS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
  94. ),
  95. /* Lower
  96. * ,-----------------------------------------------------------------------------------.
  97. * | > | ! | ' | ^ | + | % | & | / | ( | ) | = | Bksp |
  98. * |------+------+------+------+------+------+------+------+------+------+------+------|
  99. * | Del | F1 | F2 | F3 | F4 | F5 | F6 | ? | _ | Ğ | Ü | - |
  100. * |------+------+------+------+------+------+------+------+------+------+------+------|
  101. * | | F7 | F8 | F9 | F10 | F11 | F12 | "$" | "{" | "}" | < | ">" |
  102. * |------+------+------+------+------+------+------+------+------+------+------+------|
  103. * | | | | | | | | "[" | "]" | ' | " |
  104. * `-----------------------------------------------------------------------------------'
  105. */
  106. [_LOWER] = LAYOUT_planck_mit(
  107. KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
  108. KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_EQL,
  109. _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DOLLAR_SIGN, CURLY_OPEN, CURLY_CLOSE, KC_GRV, LSFT(KC_GRV),
  110. _______, _______, _______, _______, _______, _______, _______, SQUARE_OPEN, SQUARE_CLOSE, LSFT(KC_2), KC_NUBS
  111. ),
  112. /* Raise
  113. * ,-----------------------------------------------------------------------------------.
  114. * | <>| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
  115. * |------+------+------+------+------+------+------+------+------+------+------+------|
  116. * | Del | F1 | F2 | F3 | F4 | F5 | F6 | * | - | "\" | "|" | , |
  117. * |------+------+------+------+------+------+------+------+------+------+------+------|
  118. * | | F7 | F8 | F9 | F10 | F11 | F12 | # | " | "~" | "`" | <>| |
  119. * |------+------+------+------+------+------+------+------+------+------+------+------|
  120. * | | | | | | | | Next | Vol- | Vol+ | Play |
  121. * `-----------------------------------------------------------------------------------'
  122. */
  123. [_RAISE] = LAYOUT_planck_mit(
  124. KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
  125. KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, BACKSLASH, VERTICAL_PIPE, KC_BSLS,
  126. _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMBER_SIGN, KC_NUBS, TILDE, BACKTICK, KC_GRV,
  127. _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
  128. ),
  129. /* Soda Layer
  130. * ,-----------------------------------------------------------------------------------.
  131. * | | | | | | | | | Up | | | |
  132. * |------+------+------+------+------+------+------+------+------+------+------+------|
  133. * | | | | | | | | Left | Down |Right | | Mute |
  134. * |------+------+------+------+------+------+------+------+------+------+------+------|
  135. * | | | | | | | | | Next | Vol- | Vol+ | Play |
  136. * |------+------+------+------+------+------+------+------+------+------+------+------|
  137. * | | | | | | | | | |Brght▼|Brght▲|
  138. * `-----------------------------------------------------------------------------------'
  139. */
  140. [_SODA] = LAYOUT_planck_mit(
  141. _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______,
  142. _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_MUTE,
  143. _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY,
  144. _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRMD, KC_BRMU
  145. ),
  146. /* Space Layer (Space Bar Layer Tap)
  147. * ,-----------------------------------------------------------------------------------.
  148. * | |CMD+1 |CMD+2 |CMD+3 |CMD+4 |CMD+5 |CMD+6 |CMD+7 |CMD+8 |CMD+9 |CMD+0 |LCKOSX|
  149. * |------+------+------+------+------+------+------+------+------+------+------+------|
  150. * | | | | | | | | | | Up | | |
  151. * |------+------+------+------+------+------+------+------+------+------+------+------|
  152. * | | | | | | | | | Left | Down |Right | |
  153. * |------+------+------+------+------+------+------+------+------+------+------+------|
  154. * | | | | | | | | | |Brght▼|Brght▲|
  155. * `-----------------------------------------------------------------------------------'
  156. */
  157. [_SPACE] = LAYOUT_planck_mit(
  158. _______, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), LGUI(KC_6), LGUI(KC_7), LGUI(KC_8), LGUI(KC_9), LGUI(KC_0), LOCKSCREEN,
  159. _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______,
  160. _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______,
  161. _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRMD, KC_BRMU
  162. ),
  163. /* Numpad Layer
  164. * KC_PDOT is comma on the Turkish layout ¯\_(ツ)_/¯
  165. * ,-----------------------------------------------------------------------------------.
  166. * | | | | | | | | 7 | 8 | 9 | - | Bksp |
  167. * |------+------+------+------+------+------+------+------+------+------+------+------|
  168. * | | | | | | | Enter| 4 | 5 | 6 | + | * |
  169. * |------+------+------+------+------+------+------+------+------+------+------+------|
  170. * | | | | | | | Enter| 1 | 2 | 3 | + | / |
  171. * |------+------+------+------+------+------+------+------+------+------+------+------|
  172. * | | | | | | | 0 | 0 | . | , | = |
  173. * `-----------------------------------------------------------------------------------'
  174. */
  175. [_NUMPAD] = LAYOUT_planck_mit(
  176. _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_BSPC,
  177. _______, _______, _______, _______, _______, _______, KC_PENT, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PAST,
  178. _______, _______, _______, _______, _______, _______, KC_PENT, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PSLS,
  179. _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, KC_SLSH, KC_PDOT, KC_PEQL
  180. ),
  181. /* Adjust (Lower + Raise)
  182. * ,-----------------------------------------------------------------------------------.
  183. * | | Reset|EEPRom| RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del |
  184. * |------+------+------+------+------+------+------+------+------+------+------+------|
  185. * | | |MUSmod|Aud on|Audoff| | | | | | | |
  186. * |------+------+------+------+------+------+------+------+------+------+------+------|
  187. * | |Voice-|Voice+|Mus on|Musoff| | | | | | | |
  188. * |------+------+------+------+------+------+------+------+------+------+------+------|
  189. * | | | | | | | | | | | |
  190. * `-----------------------------------------------------------------------------------'
  191. */
  192. [_ADJUST] = LAYOUT_planck_mit(
  193. _______, QK_BOOT, EE_CLR, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL,
  194. _______, _______, MU_MOD, AU_ON, AU_OFF, _______, _______, _______, _______, _______, _______, _______,
  195. _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______,
  196. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  197. )
  198. };
  199. // Enable the adjust layer when both lower and
  200. layer_state_t layer_state_set_user(layer_state_t state) {
  201. return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
  202. }
  203. // I like greenish cyan for my single colored animations
  204. //extern rgblight_config_t rgblight_config;
  205. void keyboard_post_init_user(void) {
  206. //rgblight_config.hue = 100;
  207. //rgblight_config.sat = 255;
  208. //rgblight_config.val = 255;
  209. rgblight_enable_noeeprom(); // enables Rgb, without saving settings
  210. rgblight_sethsv_noeeprom(100, 255, 255); // sets the color to greenish without saving
  211. //rgblight_sethsv_noeeprom_turquoise();
  212. }