logo

qmk_firmware

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

process_auto_shift.h (2058B)


  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 <stdint.h>
  18. #include <stdbool.h>
  19. #include "action.h"
  20. #include "keyboard.h"
  21. #include "keycodes.h"
  22. #ifndef AUTO_SHIFT_TIMEOUT
  23. # define AUTO_SHIFT_TIMEOUT 175
  24. #endif
  25. #define IS_RETRO(kc) (IS_QK_MOD_TAP(kc) || IS_QK_LAYER_TAP(kc))
  26. #define DO_GET_AUTOSHIFT_TIMEOUT(keycode, record, ...) record
  27. // clang-format off
  28. #define AUTO_SHIFT_ALPHA KC_A ... KC_Z
  29. #define AUTO_SHIFT_NUMERIC KC_1 ... KC_0
  30. #define AUTO_SHIFT_SYMBOLS \
  31. KC_MINUS ... KC_SLASH: \
  32. case KC_NONUS_BACKSLASH
  33. // Kept to avoid breaking existing keymaps.
  34. #define AUTO_SHIFT_SPECIAL \
  35. KC_TAB: \
  36. case AUTO_SHIFT_SYMBOLS
  37. // clang-format on
  38. bool process_auto_shift(uint16_t keycode, keyrecord_t *record);
  39. void retroshift_poll_time(keyevent_t *event);
  40. void retroshift_swap_times(void);
  41. void autoshift_enable(void);
  42. void autoshift_disable(void);
  43. void autoshift_toggle(void);
  44. bool get_autoshift_state(void);
  45. uint16_t get_generic_autoshift_timeout(void);
  46. // clang-format off
  47. uint16_t (get_autoshift_timeout)(uint16_t keycode, keyrecord_t *record);
  48. void set_autoshift_timeout(uint16_t timeout);
  49. void autoshift_matrix_scan(void);
  50. bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record);
  51. bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record);
  52. // clang-format on