keymap.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Copyright 2021 Atsushi Nagase
  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 meishi2_moc_layers {
  18. _DEFAULT,
  19. _RAISE
  20. };
  21. #define PRO_MICRO_LED_TX D5
  22. #define RAISE MO(_RAISE)
  23. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  24. [_DEFAULT] = LAYOUT( /* Base */
  25. RAISE, KC_B, KC_N, KC_SPC
  26. ),
  27. [_RAISE] = LAYOUT( /* Raise */
  28. _______, KC_LEFT, KC_RGHT, LSFT(KC_S)
  29. )
  30. };
  31. void matrix_init_user(void) {
  32. setPinOutput(PRO_MICRO_LED_TX);
  33. writePinHigh(PRO_MICRO_LED_TX);
  34. }
  35. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  36. if (keycode == RAISE) {
  37. writePin(PRO_MICRO_LED_TX, !record->event.pressed);
  38. }
  39. return true;
  40. }