process_auto_shift.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Copyright 2017 Jeremy Cowgar
  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. #pragma once
  17. #include "quantum.h"
  18. #ifndef AUTO_SHIFT_TIMEOUT
  19. # define AUTO_SHIFT_TIMEOUT 175
  20. #endif
  21. #define IS_RETRO(kc) (IS_QK_MOD_TAP(kc) || IS_QK_LAYER_TAP(kc))
  22. #define DO_GET_AUTOSHIFT_TIMEOUT(keycode, record, ...) record
  23. // clang-format off
  24. #define AUTO_SHIFT_ALPHA KC_A ... KC_Z
  25. #define AUTO_SHIFT_NUMERIC KC_1 ... KC_0
  26. #define AUTO_SHIFT_SPECIAL \
  27. KC_TAB: \
  28. case KC_MINUS ... KC_SLASH: \
  29. case KC_NONUS_BACKSLASH
  30. // clang-format on
  31. bool process_auto_shift(uint16_t keycode, keyrecord_t *record);
  32. void retroshift_poll_time(keyevent_t *event);
  33. void retroshift_swap_times(void);
  34. void autoshift_enable(void);
  35. void autoshift_disable(void);
  36. void autoshift_toggle(void);
  37. bool get_autoshift_state(void);
  38. uint16_t get_generic_autoshift_timeout(void);
  39. // clang-format off
  40. uint16_t (get_autoshift_timeout)(uint16_t keycode, keyrecord_t *record);
  41. void set_autoshift_timeout(uint16_t timeout);
  42. void autoshift_matrix_scan(void);
  43. bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record);
  44. // clang-format on