You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.0 KiB

  1. /*
  2. Copyright 2020 Copyright 2020 Draevin Luke <contact@drae.vin> @draevin
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include "draevin.h"
  15. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  16. switch (keycode) {
  17. case CM_QW: // Switch between Colemak and QWERTY
  18. if (record->event.pressed) {
  19. layer_invert(_CM);
  20. layer_invert(_QW);
  21. }
  22. return false;
  23. case KC_MAKE:
  24. if (!record->event.pressed) {
  25. SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP ":flash\n");
  26. reset_keyboard();
  27. }
  28. break;
  29. case PRNPAIR:
  30. if (record->event.pressed) {
  31. SEND_STRING("()");
  32. tap_code(KC_LEFT);
  33. }
  34. break;
  35. case BRCPAIR:
  36. if (record->event.pressed) {
  37. uint8_t shifted = get_mods() & (MOD_MASK_SHIFT);
  38. if (shifted) {
  39. unregister_code(KC_LSFT);
  40. unregister_code(KC_RSFT);
  41. SEND_STRING("{}"SS_TAP(X_LEFT));
  42. }
  43. else {
  44. SEND_STRING("[]"SS_TAP(X_LEFT));
  45. }
  46. }
  47. break;
  48. }
  49. return true;
  50. }
  51. qk_tap_dance_action_t tap_dance_actions[] = {
  52. [TD_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) // shift/caps TD
  53. };