~ruther/qmk_firmware

ref: f37f27f02a55f750c21f671e712e3f704ba57885 qmk_firmware/keyboards/handwired/d48/taphold.h -rw-r--r-- 783 bytes
f37f27f0 — James Young Migrate `LOCKING_*_ENABLE` to Data-Driven: O (#23778) 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include <stdint.h>
#include <stdbool.h>
#include "action.h"

typedef enum taphold_mode_t {
    TAPHOLD_LAYER,
    TAPHOLD_MOD
} taphold_mode_t;

typedef struct taphold_t {
    uint16_t key;
    uint32_t time;
    taphold_mode_t mode;
    uint16_t shortAction;
    uint16_t longAction;
    keypos_t keypos;
    // We store key pos to properly release the key
    // even when a different layer is active and the key has a different action now
} taphold_t;

extern taphold_t taphold_config[];
extern uint16_t taphold_config_size;
// Dual keys tap/hold timeout.
// If key is tapped for less than this value, send key in addition to primary action after completing the action.
extern uint32_t taphold_timeout;

bool taphold_process(uint16_t keycode, keyrecord_t *record);
Do not follow this link