keymap.c 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. /*
  2. Copyright 2018 Eric Gebhart <e.a.gebhart@gmail.com>
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include "keymap_bepo.h"
  15. #include "ericgebhart.h"
  16. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  17. [DVORAK] = LAYOUT_ortho_5x15_wrapper(
  18. KC_GRV, ___ORTHO_15_N___, KC_EQL,
  19. KC_LOCK, ___13_DVORAK_1___, KC_SLASH,
  20. TAB_BKTAB, ___13_DVORAK_2___, KC_MINUS,
  21. KC_LSFT, ___13_DVORAK_3___, KC_RSFT,
  22. ___ORTHO_15_BOTTOM___
  23. ),
  24. [QWERTY] = LAYOUT_ortho_5x15_wrapper(
  25. KC_GRV, ___ORTHO_15_N___, KC_EQL,
  26. KC_LOCK, ___13_QWERTY_1___, KC_SLASH,
  27. TAB_BKTAB, ___13_QWERTY_2___, KC_MINUS,
  28. KC_LSFT, ___13_QWERTY_3___, KC_RSFT,
  29. ___ORTHO_15_BOTTOM___
  30. ),
  31. [COLEMAK] = LAYOUT_ortho_5x15_wrapper(
  32. KC_GRV, ___ORTHO_15_N___, KC_EQL,
  33. KC_LOCK, ___13_COLEMAK_1___, KC_SLASH,
  34. TAB_BKTAB, ___13_COLEMAK_2___, KC_MINUS,
  35. KC_LSFT, ___13_COLEMAK_3___, KC_RSFT,
  36. ___ORTHO_15_BOTTOM___
  37. ),
  38. [WORKMAN] = LAYOUT_ortho_5x15_wrapper(
  39. KC_GRV, ___ORTHO_15_N___, KC_EQL,
  40. KC_LOCK, ___13_WORKMAN_1___, KC_SLASH,
  41. TAB_BKTAB, ___13_WORKMAN_2___, KC_MINUS,
  42. KC_LSFT, ___13_WORKMAN_3___, KC_RSFT,
  43. ___ORTHO_15_BOTTOM___
  44. ),
  45. [NORMAN] = LAYOUT_ortho_5x15_wrapper(
  46. KC_GRV, ___ORTHO_15_N___, KC_EQL,
  47. KC_LOCK, ___13_NORMAN_1___, KC_SLASH,
  48. TAB_BKTAB, ___13_NORMAN_2___, KC_MINUS,
  49. KC_LSFT, ___13_NORMAN_3___, KC_RSFT,
  50. ___ORTHO_15_BOTTOM___
  51. ),
  52. [DVORAK_ON_BEPO] = LAYOUT_ortho_5x15_wrapper(
  53. DB_GRV, ___ORTHO_15_B_N___, DB_EQL,
  54. KC_LOCK, ___13_DVORAK_B_1___, DB_SLASH,
  55. TAB_BKTAB, ___13_DVORAK_B_2___, DB_MINUS,
  56. KC_LSFT, ___13_DVORAK_B_3___, KC_RSFT,
  57. ___ORTHO_15_BOTTOM_FR___
  58. ),
  59. [XMONAD] = LAYOUT_ortho_5x15_wrapper(
  60. ___ORTHO_15_FUNC_1_12___,
  61. ___, ___13_DVORAK_1___, ___,
  62. ___, ___13_DVORAK_2___, ___,
  63. ___, ___13_DVORAK_3___, ___,
  64. ___15___
  65. ),
  66. [XMONAD_FR] = LAYOUT_ortho_5x15_wrapper(
  67. ___ORTHO_15_FUNC_1_12___,
  68. ___, ___13_DVORAK_B_1___, ___,
  69. ___, ___13_DVORAK_B_2___, ___,
  70. ___, ___13_DVORAK_B_3___, ___,
  71. ___15___
  72. ),
  73. [BEPO] = LAYOUT_ortho_5x15_wrapper(
  74. ___ORTHO_15_B_SYMB___,
  75. KC_LOCK, ___13_BEPO_1___, BP_W,
  76. TAB_BKTAB, ___13_BEPO_2___, BP_CCED,
  77. BP_SFT_T_ECRC, ___13_BEPO_3___, BP_SFT_T_W,
  78. ___ORTHO_15_BOTTOM_BP___
  79. ),
  80. // SYMBOLS
  81. [SYMB] = LAYOUT_ortho_5x15_wrapper(
  82. ___ORTHO_15_FUNC_1_12___,
  83. ___15_SYMB_1___,
  84. ___15_SYMB_2___,
  85. ___15_SYMB_3___,
  86. ___15_SYMB_4___
  87. ),
  88. [KEYPAD] = LAYOUT_ortho_5x15_wrapper(
  89. ___ORTHO_15_FUNC_1_12___,
  90. ___15_KP_1___,
  91. ___15_KP_2___,
  92. ___15_KP_3___,
  93. ___15_KP_4___
  94. ),
  95. [KEYPAD_ON_BEPO] = LAYOUT_ortho_5x15_wrapper(
  96. ___ORTHO_15_FUNC_1_12___,
  97. ___15_KP_B_1___,
  98. ___15_KP_B_2___,
  99. ___15_KP_B_3___,
  100. ___15_KP_B_4___
  101. ),
  102. [SYMB_ON_BEPO] = LAYOUT_ortho_5x15_wrapper(
  103. ___ORTHO_15_FUNC_1_12___,
  104. ___15_SYMB_B_1___,
  105. ___15_SYMB_B_2___,
  106. ___15_SYMB_B_3___,
  107. ___15_SYMB_B_4___
  108. ),
  109. // MEDIA AND MOUSE
  110. [MDIA] = LAYOUT_ortho_5x15_wrapper(
  111. ___ORTHO_15_FUNC_1_12___,
  112. ___15_MDIA_1___,
  113. ___15_MDIA_2___,
  114. ___15_MDIA_3___,
  115. ___15_MDIA_4___
  116. ),
  117. [LAYERS] = LAYOUT_ortho_5x15_wrapper(
  118. ___ORTHO_15_FUNC_1_12___,
  119. ___15_LAYERS_1___,
  120. ___15_LAYERS_2___,
  121. ___15_LAYERS_3___,
  122. ___15___
  123. ),
  124. [_RGB] = LAYOUT_ortho_5x15_wrapper(
  125. ___ORTHO_15_FUNC_1_12___,
  126. ___15_RGB_1___,
  127. ___15_RGB_2___,
  128. ___15_RGB_3___,
  129. ___15___
  130. ),
  131. };
  132. /********************************************************************************/
  133. /* Using layers to do RGB underlighting */
  134. /********************************************************************************/
  135. const rgblight_segment_t PROGMEM on_bepo[] = RGBLIGHT_LAYER_SEGMENTS(
  136. {0, 2, HSV_AZURE}
  137. );
  138. const rgblight_segment_t PROGMEM bepo[] = RGBLIGHT_LAYER_SEGMENTS(
  139. {3, 2, HSV_MAGENTA}
  140. );
  141. const rgblight_segment_t PROGMEM dvorak[] = RGBLIGHT_LAYER_SEGMENTS(
  142. {3, 2, HSV_AZURE}
  143. );
  144. const rgblight_segment_t PROGMEM media[] = RGBLIGHT_LAYER_SEGMENTS(
  145. {5, 1, HSV_GREEN}
  146. );
  147. const rgblight_segment_t PROGMEM symbol[] = RGBLIGHT_LAYER_SEGMENTS(
  148. {4, 2, HSV_GOLD}
  149. );
  150. const rgblight_segment_t PROGMEM keypad[] = RGBLIGHT_LAYER_SEGMENTS(
  151. {4, 2, HSV_BLUE}
  152. );
  153. const rgblight_segment_t PROGMEM layers[] = RGBLIGHT_LAYER_SEGMENTS(
  154. {5, 1, HSV_RED}
  155. );
  156. const rgblight_segment_t PROGMEM rgb[] = RGBLIGHT_LAYER_SEGMENTS(
  157. {5, 1, HSV_ORANGE}
  158. );
  159. const rgblight_segment_t* const PROGMEM rgb_layers[] = RGBLIGHT_LAYERS_LIST(on_bepo, bepo, dvorak, media, symbol,
  160. keypad, layers, rgb);
  161. void keyboard_post_init_user(void) {
  162. rgblight_sethsv_noeeprom(HSV_PURPLE);
  163. rgblight_layers = rgb_layers;
  164. }
  165. layer_state_t layer_state_set_user(layer_state_t state) {
  166. // rgblight_set_layer_state(0, !on_qwerty());
  167. rgblight_set_layer_state(0, layer_state_cmp(state, DVORAK));
  168. rgblight_set_layer_state(1, layer_state_cmp(state, BEPO));
  169. rgblight_set_layer_state(2, layer_state_cmp(state, DVORAK));
  170. //|| layer_state_cmp(state, DVORAK_ON_BEPO)));
  171. rgblight_set_layer_state(3, layer_state_cmp(state, MDIA));
  172. rgblight_set_layer_state(4, layer_state_cmp(state, SYMB) );
  173. //(layer_state_cmp(state, SYMB) || (layer_state_cmp(state, SYMB_ON_BEPO))));
  174. rgblight_set_layer_state(5, layer_state_cmp(state, KEYPAD) );
  175. ///(layer_state_cmp(state, KEYPAD) || (layer_state_cmp(state, KEYPAD_ON_BEPO))));
  176. rgblight_set_layer_state(6, layer_state_cmp(state, LAYERS));
  177. rgblight_set_layer_state(7, layer_state_cmp(state, _RGB));
  178. return state;
  179. }
  180. /* void suspend_power_down_user(void) { */
  181. /* rgblight_disable(); */
  182. /* } */
  183. /* void suspend_wakeup_init_user(void) { */
  184. /* rgblight_enable(); */
  185. /* } */
  186. /* bool is_shift_pressed = false; */
  187. /* bool led_update_user(led_t led_state) { */
  188. /* rgblight_set_layer_state(2, is_shift_pressed != led_state.caps_lock); */
  189. /* return true; */
  190. /* } */
  191. /* bool process_record_user(uint16_t keycode, keyrecord_t* record) { */
  192. /* switch (keycode) { */
  193. /* case KC_LSFT: */
  194. /* case KC_RSFT: */
  195. /* is_shift_pressed = record->event.pressed; */
  196. /* rgblight_set_layer_state(2, is_shift_pressed != host_keyboard_led_state().caps_lock); */
  197. /* default: */
  198. /* return true; */
  199. /* } */
  200. /* } */