logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

keymap.c (1757B)


  1. /* Copyright 2019 Franklin Harding
  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. PDXKBCREDDIT = SAFE_RANGE,
  20. PDXKBCDISCORD,
  21. BADGELIFE,
  22. HACKTHEPLANET
  23. };
  24. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  25. [0] = LAYOUT(
  26. PDXKBCREDDIT, PDXKBCDISCORD,
  27. BADGELIFE, HACKTHEPLANET,
  28. KC_VOLU, KC_VOLD
  29. ),
  30. };
  31. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  32. switch (keycode) {
  33. case PDXKBCREDDIT:
  34. if (record->event.pressed) {
  35. SEND_STRING("https://reddit.com/r/pdxkbc" SS_TAP(X_ENTER));
  36. }
  37. break;
  38. case PDXKBCDISCORD:
  39. if (record->event.pressed) {
  40. SEND_STRING("https://discordapp.com/invite/bHwjHXh" SS_TAP(X_ENTER));
  41. }
  42. break;
  43. case BADGELIFE:
  44. if (record->event.pressed) {
  45. SEND_STRING("#badgelife" SS_TAP(X_ENTER));
  46. }
  47. break;
  48. case HACKTHEPLANET:
  49. if (record->event.pressed) {
  50. SEND_STRING("HACK THE PLANET!" SS_TAP(X_ENTER));
  51. }
  52. break;
  53. }
  54. return true;
  55. }