keymap.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* Copyright 2020 Ben Roesner (keycapsss.com)
  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. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  18. /*
  19. * ,-----------------------,
  20. * | 7 | 8 | 9 | / |
  21. * |-----+-----+-----+-----|
  22. * | 4 | 5 | 6 | * |
  23. * |-----+-----+-----+-----|
  24. * | 1 | 2 | 3 | - |
  25. * |-----+-----+-----+-----|
  26. * | 0 | . | = | + |
  27. * `-----------------------'
  28. */
  29. LAYOUT_ortho_4x4(
  30. KC_P7, KC_P8, KC_P9, KC_PSLS,
  31. KC_P4, KC_P5, KC_P6, KC_PAST,
  32. KC_P1, KC_P2, KC_P3, KC_PMNS,
  33. KC_P0, KC_PDOT, KC_PEQL, KC_PPLS
  34. ),
  35. };
  36. // Set led state during power-up
  37. // There is also a LED_GREEN
  38. // Only for Rev1 & Rev2
  39. #ifdef LED_RED
  40. void keyboard_post_init_user(void) {
  41. gpio_write_pin_high(LED_RED);
  42. }
  43. #endif
  44. // Rev3 and above only
  45. #ifdef OLED_ENABLE
  46. bool oled_task_user(void) {
  47. oled_write_ln_P(PSTR("Plaid-Pad ///////////"), false);
  48. return false;
  49. }
  50. #endif
  51. #ifdef ENCODER_MAP_ENABLE
  52. /*
  53. Rev1.1 Rev1
  54. ,-----------------------, ,-----------------------,
  55. | E1 | E2 | E3 | E4 | | E1 | | | E2 |
  56. |-----+-----+-----+-----| |-----+-----+-----+-----|
  57. | | | | E3 | | | | | |
  58. |-----+-----+-----+-----| |-----+-----+-----+-----|
  59. | | | | E2 | | | | | |
  60. |-----+-----+-----+-----| |-----+-----+-----+-----|
  61. | | | | E1 | | | | | |
  62. `-----------------------' `-----------------------'
  63. */
  64. const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
  65. #ifdef KEYBOARD_keycapsss_plaid_pad_rev1
  66. { ENCODER_CCW_CW(KC_F18, KC_F17), ENCODER_CCW_CW(KC_F20, KC_F19) }
  67. #else
  68. { ENCODER_CCW_CW(KC_F18, KC_F17), ENCODER_CCW_CW(KC_F20, KC_F19), ENCODER_CCW_CW(KC_F22, KC_F21), ENCODER_CCW_CW(KC_F24, KC_F23) }
  69. #endif
  70. };
  71. #endif