keymap.c 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. Copyright 2019 Batuhan Başerdem <baserdem.batuhan@gmail.com> @bbaserdem
  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 QMK_KEYBOARD_H
  15. #include "bbaserdem.h"
  16. #ifdef KEYBOARD_40percentclub_gherkin
  17. // Flip it
  18. #undef LAYOUT_ortho_3x10
  19. #define LAYOUT_ortho_3x10( \
  20. K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \
  21. K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \
  22. K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \
  23. ) { \
  24. { K45, K44, K43, K42, K41, K40 }, \
  25. { K35, K34, K33, K32, K31, K30 }, \
  26. { K25, K24, K23, K22, K21, K20 }, \
  27. { K15, K14, K13, K12, K11, K10 }, \
  28. { K05, K04, K03, K02, K01, K00 } \
  29. }
  30. #endif
  31. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  32. /* Game pad
  33. * ,-----------------------------------------------------------.
  34. * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | F1 | F2 | F3 |
  35. * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
  36. * |AdjsL| Q | W | E | R | Ent | Tab | Ctr | |^| | Alt |
  37. * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
  38. * |Music| A | S | D | F | Spc |Shift| <-- | |v| | --> |
  39. * `-----------------------------------------------------------'
  40. */
  41. [_BASE] = LAYOUT_ortho_3x10(
  42. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F1, KC_F2, KC_F3,
  43. MO(_MEDI), KC_Q, KC_W, KC_E, KC_R, KC_ENT, KC_TAB, KC_LCTL,KC_UP, KC_LALT,
  44. MU_TOG, KC_A, KC_S, KC_D, KC_F, KC_SPC, KC_LSFT,KC_LEFT,KC_DOWN,KC_RGHT
  45. ),
  46. /* Adjust
  47. * ,-----------------------------------------------------------.
  48. * | Esc |RGBTg|HueUp|HueDn|SatUp|SatDn|ValUp|ValDn|ModNx|ModPr|
  49. * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
  50. * | |BltTg|Breth|BriUp|BriDn| | |Veloc|SpdUp|SpdDn|
  51. * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
  52. * |Music| | | | | | | |EEprm|Reset|
  53. * `-----------------------------------------------------------'
  54. */
  55. [_MEDI] = LAYOUT_ortho_3x10(
  56. CK_TOGG,RGB_TOG,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,RGB_MOD,RGB_RMOD,
  57. _______,BL_TOGG,BL_BRTG,BL_INC, BL_DEC, XXXXXXX,XXXXXXX,VLK_TOG,RGB_SPI,RGB_SPD,
  58. AU_TOG, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,EEP_RST,QK_BOOT
  59. ),
  60. [_MUSI] = LAYOUT_ortho_3x10_wrapper(
  61. MU_FAST,_MU_08_,MU_REC,
  62. MU_SLOW,_MU_08_,MU_STOP,
  63. MU_TOG, _MU_08_,MU_PLAY
  64. ),
  65. };
  66. // Music map, guitar like.
  67. #ifdef AUDIO_ENABLE
  68. const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_3x10(
  69. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
  70. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  71. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  72. );
  73. #endif
  74. // RGB matrix code
  75. #ifdef RGB_MATRIX_ENABLE
  76. // Gherkin
  77. #if defined(KEYBOARD_40percentclub_gherkin)
  78. led_config_t g_led_config = {
  79. { // Key Matrix to LED Index
  80. { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED},
  81. { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED},
  82. { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED},
  83. { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED},
  84. { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}
  85. }, { // LED Index to Physical Position
  86. {224, 0}, {168, 0}, {112, 0}, { 56, 0}, { 0, 0},
  87. { 0, 64}, { 56, 64}, {112, 64}, {168, 64}, {224, 64},
  88. }, { // LED Index to Flag
  89. 2,2,2,2,2,2,2,2,2,2
  90. }};
  91. // Disable layer switching
  92. bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {return true;}
  93. #endif // Gherkin
  94. #endif // RGB Matrix