1
0
Fork 0

Tidy up use of keycode range helpers (#19756)

This commit is contained in:
Joel Challis 2023-02-10 21:10:14 +00:00 committed by GitHub
parent 2ffdec5dc2
commit 1d0b4c8d38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 39 additions and 33 deletions

View file

@ -89,16 +89,16 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM
#ifdef SPACE_CADET_MODIFIER_CARRYOVER
sc_mods = get_mods();
#endif
if (IS_MOD(holdMod)) {
if (IS_MODIFIER_KEYCODE(holdMod)) {
register_mods(MOD_BIT(holdMod));
}
} else {
if (sc_last == holdMod && timer_elapsed(sc_timer) < GET_TAPPING_TERM(sc_keycode, record)) {
if (holdMod != tapMod) {
if (IS_MOD(holdMod)) {
if (IS_MODIFIER_KEYCODE(holdMod)) {
unregister_mods(MOD_BIT(holdMod));
}
if (IS_MOD(tapMod)) {
if (IS_MODIFIER_KEYCODE(tapMod)) {
register_mods(MOD_BIT(tapMod));
}
}
@ -109,11 +109,11 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM
#ifdef SPACE_CADET_MODIFIER_CARRYOVER
clear_weak_mods();
#endif
if (IS_MOD(tapMod)) {
if (IS_MODIFIER_KEYCODE(tapMod)) {
unregister_mods(MOD_BIT(tapMod));
}
} else {
if (IS_MOD(holdMod)) {
if (IS_MODIFIER_KEYCODE(holdMod)) {
unregister_mods(MOD_BIT(holdMod));
}
}