diff options
author | Nick Brassel <[email protected]> | 2023-11-28 16:39:48 +1100 |
---|---|---|
committer | Nick Brassel <[email protected]> | 2023-11-28 16:40:47 +1100 |
commit | 0115951de12bd4c798a43a380651c34552552e85 (patch) | |
tree | 62999011ae782d93aa6dc9c889615db2a840cafc /users/ericgebhart/extensions/alt_shift.c | |
parent | 0379d1f59e58cefa18cdb72ba1b77507d1108ae6 (diff) | |
parent | 4d99e0a23cff02f4c6e55e093b5de08a9be0df7c (diff) | |
download | qmk_firmware-0.23.0.tar.gz qmk_firmware-0.23.0.zip |
`develop` -> `master`, 2023q4 edition0.23.0
Diffstat (limited to 'users/ericgebhart/extensions/alt_shift.c')
-rw-r--r-- | users/ericgebhart/extensions/alt_shift.c | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/users/ericgebhart/extensions/alt_shift.c b/users/ericgebhart/extensions/alt_shift.c deleted file mode 100644 index 002adec230..0000000000 --- a/users/ericgebhart/extensions/alt_shift.c +++ /dev/null @@ -1,99 +0,0 @@ -#include USERSPACE_H -#include <stdbool.h> -#include <stdint.h> - -bool shift_for_two(uint16_t keycode, keyrecord_t *record){ - uint16_t mod_state = get_mods(); - - bool is_shifted = (get_mods() & MOD_MASK_SHIFT) || - (get_oneshot_mods() & MOD_MASK_SHIFT); - - if(record ->event.pressed) { - // If shifted, double these common punctuation marks. - if(is_shifted){ - // clear shift temporarily - del_mods(MOD_MASK_SHIFT); - del_oneshot_mods(MOD_MASK_SHIFT); - - tap_code16(keycode); - tap_code16(keycode); - - // restore previous shift state - set_mods(mod_state); - return false; - } - } - return true; -} - -bool shift_for_three(uint16_t keycode, keyrecord_t *record){ - uint16_t mod_state = get_mods(); - - bool is_shifted = (get_mods() & MOD_MASK_SHIFT) || - (get_oneshot_mods() & MOD_MASK_SHIFT); - - if(record ->event.pressed) { - // If shifted, double these common punctuation marks. - if(is_shifted){ - // clear shift temporarily - del_mods(MOD_MASK_SHIFT); - del_oneshot_mods(MOD_MASK_SHIFT); - - tap_code16(keycode); - tap_code16(keycode); - tap_code16(keycode); - - // restore previous shift state - set_mods(mod_state); - return false; - } - } - return true; - } - -bool override_shift(uint16_t keycode, - uint16_t shift_keycode, - keyrecord_t *record - ) { - - bool is_shifted = (get_mods() & MOD_MASK_SHIFT) || - (get_oneshot_mods() & MOD_MASK_SHIFT); - - if (record->event.pressed) { - if (is_shifted) { - uint8_t mod_state = get_mods(); - del_mods(MOD_MASK_SHIFT); - del_oneshot_mods(MOD_MASK_SHIFT); - - tap_code16(shift_keycode); - - set_mods(mod_state); - } else { - //tap_code16(keycode); - } - } - return false; -} - -// macros for use in alt_shift.defs. -#define ALT_SHIFT(KCKEY, KC01) \ - case KCKEY: \ - return override_shift(KCKEY, KC01, record); \ - break; - -#define SHIFT_FOR_2(KCKEY) \ - case KCKEY: \ - return shift_for_two(KCKEY, record); \ - break; - -#define SHIFT_FOR_3(KCKEY) \ - case KCKEY: \ - return shift_for_three(KCKEY, record); \ - break; - -bool process_alt_shift_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode){ -#include "alt_shift.def" - } - return true; -} |