2
0

keymap.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Copyright 2019 MechMerlin
  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. // Defines the keycodes used by our macros in process_record_user
  18. enum custom_keycodes {
  19. QMKBEST = SAFE_RANGE,
  20. QMKURL
  21. };
  22. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  23. [0] = LAYOUT_ortho_4x4( /* Base */
  24. KC_A, KC_1, KC_2, KC_4, \
  25. KC_A, KC_1, KC_2, KC_4, \
  26. KC_A, KC_1, KC_2, KC_4, \
  27. KC_A, KC_1, KC_2, KC_4 \
  28. ),
  29. };
  30. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  31. switch (keycode) {
  32. case QMKBEST:
  33. if (record->event.pressed) {
  34. // when keycode QMKBEST is pressed
  35. SEND_STRING("QMK is the best thing ever!");
  36. } else {
  37. // when keycode QMKBEST is released
  38. }
  39. break;
  40. case QMKURL:
  41. if (record->event.pressed) {
  42. // when keycode QMKURL is pressed
  43. SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
  44. } else {
  45. // when keycode QMKURL is released
  46. }
  47. break;
  48. }
  49. return true;
  50. }
  51. void matrix_init_user(void) {
  52. }
  53. void matrix_scan_user(void) {
  54. }
  55. void led_set_user(uint8_t usb_led) {
  56. }