diff options
author | gourdo1 <gourdo1@users.noreply.github.com> | 2022-08-13 09:24:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-13 17:24:07 +0100 |
commit | 4c6ce12d2a671b4e4270648989b7c74ac2876882 (patch) | |
tree | 9b87d8c88c8e7ca48b2133a17ef20e9586227827 /users/gourdo1/custom_double_taps.h | |
parent | 0c0d01966f4ef4af6c945422426894bfc114fdf1 (diff) |
Updated gourdo1 GMMK Pro keymaps (#17873)
* Fixed Left Shift tapdance in general and for gaming mode. (#12)
* update ISO readme
* left shift fixed in general, including for gaming mode
* fixed toggle menu rendering on ISO layouts
* updated readme's and cosmetics
* update readme's
* update readme's again
* readme cosmetics
* consolidate readme's
* more readme cosmetics
* clarification for bootloader mode on ISO
* Autocorrect added with 400 word English dictionary (#13)
* autocorrect added with 400 word dictionary
* update readme's for autocorrect
* Add FN-B as shortcut to bootloader
* Update .gitignore
Co-authored-by: Joel Challis <git@zvecr.com>
* RGB changes to system numlock and ISO extended alphas
- hide system numlock off indicator (primarily for Mac users) by moving it to numpad and FN layers instead
- give users with extended alpha ISO languages a config option to add RGB highlights for extras alphas on capslock
* readme updates
* Fixed [FN]B and [FN]N shortcuts not working on numpad layer
Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'users/gourdo1/custom_double_taps.h')
-rw-r--r-- | users/gourdo1/custom_double_taps.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/users/gourdo1/custom_double_taps.h b/users/gourdo1/custom_double_taps.h index 4f551e1fa1..fe97b8cd1f 100644 --- a/users/gourdo1/custom_double_taps.h +++ b/users/gourdo1/custom_double_taps.h @@ -71,3 +71,31 @@ static bool process_esc_to_base(uint16_t keycode, keyrecord_t * record) { } return true; } + +static bool process_lsft_for_caps(uint16_t keycode, keyrecord_t * record) { + static bool tapped = false; + static uint16_t tap_timer = 0; + + if (keycode == KC_LSFT) { + if (user_config.double_tap_shift_for_capslock) { + if (!keymap_config.no_gui) { + if (record->event.pressed) { + if (tapped && !timer_expired(record->event.time, tap_timer)) { + // The key was double tapped. + //clear_mods(); // If needed, clear the mods. + // Do something interesting... + register_code(KC_CAPS); + } + tapped = true; + tap_timer = record->event.time + TAPPING_TERM; + } else { + unregister_code(KC_CAPS); + } + } + } + } else { + // On an event with any other key, reset the double tap state. + tapped = false; + } + return true; +} |