extensions.c 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. Copyright 2018-2022 Eric Gebhart <e.a.gebhart@gmail.com>
  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 USERSPACE_H
  15. #include "extensions.h"
  16. #include "keymap_combo.h"
  17. #include "altlocal_keys.h"
  18. #include "tap_hold.h"
  19. #include "accented_keys.h"
  20. #include "process_smart_lock.h"
  21. #include "mod_lock.h"
  22. #include "oneshot.h"
  23. #include "process_nshot.h"
  24. #include "process_locales.h"
  25. #include "unicode.h"
  26. #include "key_overrides.h"
  27. #include "console_key_logger.h"
  28. // should make header files maybe. being lazy.
  29. void process_not_dead(uint16_t keycode, keyrecord_t *record);
  30. bool process_alt_shift_user(uint16_t keycode, keyrecord_t *record);
  31. void process_send_strs(uint16_t keycode, keyrecord_t *record);
  32. //bool process_alt_local_key(uint16_t keycode, keyrecord_t* record);
  33. bool process_global_quick_tap(uint16_t keycode, keyrecord_t *record);
  34. // call this from the top of process records before the switch.
  35. bool process_extensions(uint16_t keycode, keyrecord_t *record){
  36. if (!process_locales(keycode, record)) { return false; }
  37. #ifdef GLOBAL_QUICK_TAP_ENABLE
  38. if (!process_global_quick_tap(keycode, record)) {return false; }
  39. #endif
  40. #ifdef CAPS_WORD_ENABLE
  41. if (!process_caps_word(keycode, record)) { return false; }
  42. #endif
  43. #ifdef ALT_LOCAL_ENABLE
  44. if (!process_alt_local_key(keycode, record)) { return false; }
  45. #endif
  46. #ifdef ACCENTED_KEYS_ENABLE
  47. if (!process_accent_keys(keycode, record)) { return false; }
  48. #endif
  49. #ifdef TAP_HOLD_ENABLE
  50. process_tap_hold_user(keycode, record);
  51. #endif
  52. #ifdef SMART_LOCK_ENABLE
  53. process_smart_lock(keycode, record);
  54. #endif
  55. #ifdef MOD_LOCK_ENABLE
  56. process_mod_lock(keycode, record);
  57. #endif
  58. #ifdef NSHOT_ENABLE
  59. if(!process_nshot_state(keycode, record)) {return false;}
  60. #endif
  61. #ifdef SEND_UNICODE_ENABLE
  62. process_unicode_strs(keycode, record);
  63. #endif
  64. #ifdef SEND_STRING_ENABLE
  65. process_send_strs(keycode, record);
  66. #endif
  67. #ifdef NOT_DEAD_ENABLE
  68. process_not_dead(keycode, record);
  69. #endif
  70. #ifdef ALT_SHIFT_ENABLE
  71. if(!process_alt_shift_user(keycode, record)) {return false;}
  72. #endif
  73. #if defined( CONSOLE_ENABLE) && defined(CONSOLE_KEY_LOGGER_ENABLE)
  74. process_console_key_logger(keycode, record);
  75. #endif
  76. #ifdef ONESHOT_MOD_ENABLE
  77. int8_t keycode_consumed = 0;
  78. keycode_consumed += update_oneshot_modifiers(keycode, record, keycode_consumed);
  79. #endif
  80. return true;
  81. }