diff options
| author | Eric Defore <d4mation@users.noreply.github.com> | 2019-12-18 03:59:12 -0500 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-12-18 00:59:12 -0800 |
| commit | f42dd61b8d29f71af2ce479064c64c96fef55ad4 (patch) | |
| tree | f4bb23467099a228c46371cebe748139953245c9 /users/d4mation/tap-hold.c | |
| parent | b2405fccce1d9dd33e72d2b43a941e9b6bbd1f0d (diff) | |
| download | qmk_firmware-f42dd61b8d29f71af2ce479064c64c96fef55ad4.tar.gz qmk_firmware-f42dd61b8d29f71af2ce479064c64c96fef55ad4.zip | |
[Keymap] Added userspace for d4mation. Included their keymap for the Atreus62 (#7483)
* Added userspace for d4mation. Included their keymap for the Atreus62
* Do not assign layer numbers manually
* Remove some unneeded things per @drashna's recommendation
* Fix some single line comments I missed
* Update unicode macros to use send_unicode_hex_string() instead of process_unicode()
* OBetter check for Unicode Enabled. Moved some checks into macros.c
* Use eeconfig_init_user() to set default unicode input mode
Diffstat (limited to 'users/d4mation/tap-hold.c')
| -rw-r--r-- | users/d4mation/tap-hold.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/users/d4mation/tap-hold.c b/users/d4mation/tap-hold.c new file mode 100644 index 000000000..0c5119f99 --- /dev/null +++ b/users/d4mation/tap-hold.c | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | #include "tap-hold.h" | ||
| 2 | |||
| 3 | #ifndef TAP_HOLD_TIME | ||
| 4 | #define TAP_HOLD_TIME 200 | ||
| 5 | #endif | ||
| 6 | |||
| 7 | uint16_t tap_hold_timer; | ||
| 8 | |||
| 9 | void tap_or_hold( keyrecord_t *record, uint16_t tap, uint16_t hold ) { | ||
| 10 | |||
| 11 | if ( record->event.pressed ) { | ||
| 12 | tap_hold_timer = timer_read(); | ||
| 13 | } else { | ||
| 14 | |||
| 15 | if ( tap_hold_timer && | ||
| 16 | timer_elapsed( tap_hold_timer ) > TAP_HOLD_TIME ) { | ||
| 17 | /* Held down then released */ | ||
| 18 | tap_code( hold ); | ||
| 19 | } else { | ||
| 20 | /* Quickly Tapped */ | ||
| 21 | tap_code( tap ); | ||
| 22 | } | ||
| 23 | |||
| 24 | tap_hold_timer = 0; | ||
| 25 | |||
| 26 | } | ||
| 27 | |||
| 28 | } \ No newline at end of file | ||
