keymap.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #include QMK_KEYBOARD_H
  2. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  3. /*
  4. * ,-----------------------,
  5. * | 7 | 8 | 9 | / |
  6. * |-----+-----+-----+-----|
  7. * | 4 | 5 | 6 | * |
  8. * |-----+-----+-----+-----|
  9. * | 1 | 2 | 3 | - |
  10. * |-----+-----+-----+-----|
  11. * | 0 | . | = | + |
  12. * `-----------------------'
  13. */
  14. LAYOUT_ortho_4x4(
  15. KC_P7, KC_P8, KC_P9, KC_PSLS,
  16. KC_P4, KC_P5, KC_P6, KC_PAST,
  17. KC_P1, KC_P2, KC_P3, KC_PMNS,
  18. KC_P0, KC_PDOT, KC_PEQL, KC_PPLS
  19. )
  20. };
  21. // Set led state during power-up
  22. // There is also a LED_GREEN
  23. // Only for Rev1 & Rev2
  24. #ifdef LED_RED
  25. void keyboard_post_init_user(void) {
  26. writePinHigh(LED_RED);
  27. }
  28. #endif
  29. // Rev3 and above only
  30. #ifdef OLED_DRIVER_ENABLE
  31. void oled_task_user(void) {
  32. oled_write_ln_P(PSTR("Plaid-Pad ///////////"), false);
  33. }
  34. #endif
  35. #ifdef ENCODER_ENABLE
  36. bool encoder_update_user(uint8_t index, bool clockwise) {
  37. /*
  38. Rev1.1 Rev1
  39. ,-----------------------, ,-----------------------,
  40. | E1 | E2 | E3 | E4 | | E1 | | | E2 |
  41. |-----+-----+-----+-----| |-----+-----+-----+-----|
  42. | | | | E3 | | | | | |
  43. |-----+-----+-----+-----| |-----+-----+-----+-----|
  44. | | | | E2 | | | | | |
  45. |-----+-----+-----+-----| |-----+-----+-----+-----|
  46. | | | | E1 | | | | | |
  47. `-----------------------' `-----------------------'
  48. */
  49. // First encoder (E1)
  50. if (index == 0) {
  51. if (clockwise) {
  52. tap_code(KC_F17);
  53. } else {
  54. tap_code(KC_F18);
  55. }
  56. // Second encoder (E2)
  57. } else if (index == 1) {
  58. if (clockwise) {
  59. tap_code(KC_F19);
  60. } else {
  61. tap_code(KC_F20);
  62. }
  63. // Third encoder (E3)
  64. } else if (index == 2) {
  65. if (clockwise) {
  66. tap_code(KC_F21);
  67. } else {
  68. tap_code(KC_F22);
  69. }
  70. // Forth encoder (E4)
  71. } else if (index == 3) {
  72. if (clockwise) {
  73. tap_code(KC_F23);
  74. } else {
  75. tap_code(KC_F24);
  76. }
  77. }
  78. return true;
  79. }
  80. #endif