keymap.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Copyright 2019 %YOUR_NAME%
  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( /* Base */
  24. KC_A, KC_1, KC_H, \
  25. KC_TAB, KC_SPC \
  26. ),
  27. };
  28. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  29. switch (keycode) {
  30. case QMKBEST:
  31. if (record->event.pressed) {
  32. // when keycode QMKBEST is pressed
  33. SEND_STRING("QMK is the best thing ever!");
  34. } else {
  35. // when keycode QMKBEST is released
  36. }
  37. break;
  38. case QMKURL:
  39. if (record->event.pressed) {
  40. // when keycode QMKURL is pressed
  41. SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
  42. } else {
  43. // when keycode QMKURL is released
  44. }
  45. break;
  46. }
  47. return true;
  48. }
  49. void matrix_init_user(void) {
  50. }
  51. void matrix_scan_user(void) {
  52. }
  53. void led_set_user(uint8_t usb_led) {
  54. }