logo

qmk_firmware

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

taphold.h (783B)


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