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.

68 lines
2.2 KiB

  1. /* Copyright 2020 Paul James
  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 "peej.h"
  17. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  18. bool is_shifted = get_mods() & MOD_LSFT;
  19. if (record->event.pressed) {
  20. switch(keycode) {
  21. case MC_ARR:
  22. if (is_shifted) {
  23. unregister_mods(MOD_LSFT);
  24. SEND_STRING("=>");
  25. register_mods(MOD_LSFT);
  26. } else {
  27. SEND_STRING("->");
  28. }
  29. break;
  30. case MC_DARR:
  31. unregister_mods(MOD_LSFT);
  32. SEND_STRING("=>");
  33. if (is_shifted) register_mods(MOD_LSFT);
  34. break;
  35. case MC_DEQL:
  36. if (is_shifted) {
  37. unregister_mods(MOD_LSFT);
  38. SEND_STRING("!=");
  39. register_mods(MOD_LSFT);
  40. } else {
  41. SEND_STRING("==");
  42. }
  43. break;
  44. case MC_TEQL:
  45. if (is_shifted) {
  46. unregister_mods(MOD_LSFT);
  47. SEND_STRING("!==");
  48. register_mods(MOD_LSFT);
  49. } else {
  50. SEND_STRING("===");
  51. }
  52. break;
  53. case KC_RESET:
  54. #ifdef RGBLIGHT_ENABLE
  55. rgblight_enable_noeeprom();
  56. rgblight_mode_noeeprom(1);
  57. rgblight_setrgb_red();
  58. #endif
  59. reset_keyboard();
  60. break;
  61. }
  62. }
  63. return true;
  64. };