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.

25 lines
729 B

  1. #include "quantum.h"
  2. typedef enum taphold_mode_t {
  3. TAPHOLD_LAYER,
  4. TAPHOLD_MOD
  5. } taphold_mode_t;
  6. typedef struct taphold_t {
  7. uint16_t key;
  8. uint32_t time;
  9. taphold_mode_t mode;
  10. uint16_t shortAction;
  11. uint16_t longAction;
  12. keypos_t keypos;
  13. // We store key pos to properly release the key
  14. // even when a different layer is active and the key has a different action now
  15. } taphold_t;
  16. extern taphold_t taphold_config[];
  17. extern uint16_t taphold_config_size;
  18. // Dual keys tap/hold timeout.
  19. // If key is tapped for less than this value, send key in addition to primary action after completing the action.
  20. extern uint32_t taphold_timeout;
  21. bool taphold_process(uint16_t keycode, keyrecord_t *record);