summaryrefslogtreecommitdiff
path: root/quantum/action.c
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2023-02-10 21:10:14 +0000
committerGitHub <noreply@github.com>2023-02-10 21:10:14 +0000
commit1d0b4c8d38794dc019ecb224f2992b4ddfa70839 (patch)
tree48e0423bcafbb2fa680c7bc5199aba8794665339 /quantum/action.c
parent2ffdec5dc2a5cb350998168e76d7916e2d9728fc (diff)
Tidy up use of keycode range helpers (#19756)
Diffstat (limited to 'quantum/action.c')
-rw-r--r--quantum/action.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/quantum/action.c b/quantum/action.c
index 6b5660af8b..72f132eaa8 100644
--- a/quantum/action.c
+++ b/quantum/action.c
@@ -351,7 +351,7 @@ void process_action(keyrecord_t *record, action_t action) {
bool do_release_oneshot = false;
// notice we only clear the one shot layer if the pressed key is not a modifier.
if (is_oneshot_layer_active() && event.pressed &&
- (action.kind.id == ACT_USAGE || !(IS_MOD(action.key.code)
+ (action.kind.id == ACT_USAGE || !(IS_MODIFIER_KEYCODE(action.key.code)
# ifndef NO_ACTION_TAPPING
|| (tap_count == 0 && (action.kind.id == ACT_LMODS_TAP || action.kind.id == ACT_RMODS_TAP))
# endif
@@ -372,7 +372,7 @@ void process_action(keyrecord_t *record, action_t action) {
uint8_t mods = (action.kind.id == ACT_LMODS) ? action.key.mods : action.key.mods << 4;
if (event.pressed) {
if (mods) {
- if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
+ if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) {
// e.g. LSFT(KC_LEFT_GUI): we don't want the LSFT to be weak as it would make it useless.
// This also makes LSFT(KC_LEFT_GUI) behave exactly the same as LGUI(KC_LEFT_SHIFT).
// Same applies for some keys like KC_MEH which are declared as MEH(KC_NO).
@@ -386,7 +386,7 @@ void process_action(keyrecord_t *record, action_t action) {
} else {
unregister_code(action.key.code);
if (mods) {
- if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
+ if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) {
del_mods(mods);
} else {
del_weak_mods(mods);
@@ -406,7 +406,7 @@ void process_action(keyrecord_t *record, action_t action) {
if (!keymap_config.oneshot_enable) {
if (event.pressed) {
if (mods) {
- if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
+ if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) {
// e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless.
// This also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT).
// Same applies for some keys like KC_MEH which are declared as MEH(KC_NO).
@@ -420,7 +420,7 @@ void process_action(keyrecord_t *record, action_t action) {
} else {
unregister_code(action.key.code);
if (mods) {
- if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
+ if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) {
del_mods(mods);
} else {
del_weak_mods(mods);
@@ -877,7 +877,7 @@ __attribute__((weak)) void register_code(uint8_t code) {
send_keyboard_report();
#endif
- } else if IS_KEY (code) {
+ } else if IS_BASIC_KEYCODE (code) {
// TODO: should push command_proc out of this block?
if (command_proc(code)) return;
@@ -890,7 +890,7 @@ __attribute__((weak)) void register_code(uint8_t code) {
}
add_key(code);
send_keyboard_report();
- } else if IS_MOD (code) {
+ } else if IS_MODIFIER_KEYCODE (code) {
add_mods(MOD_BIT(code));
send_keyboard_report();
@@ -944,10 +944,10 @@ __attribute__((weak)) void unregister_code(uint8_t code) {
send_keyboard_report();
#endif
- } else if IS_KEY (code) {
+ } else if IS_BASIC_KEYCODE (code) {
del_key(code);
send_keyboard_report();
- } else if IS_MOD (code) {
+ } else if IS_MODIFIER_KEYCODE (code) {
del_mods(MOD_BIT(code));
send_keyboard_report();