diff options
Diffstat (limited to 'quantum/action.c')
-rw-r--r-- | quantum/action.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/quantum/action.c b/quantum/action.c index 5c33bd6d2..ceaaa551f 100644 --- a/quantum/action.c +++ b/quantum/action.c | |||
@@ -277,8 +277,8 @@ void process_action(keyrecord_t *record, action_t action) { | |||
277 | if (event.pressed) { | 277 | if (event.pressed) { |
278 | if (mods) { | 278 | if (mods) { |
279 | if (IS_MOD(action.key.code) || action.key.code == KC_NO) { | 279 | if (IS_MOD(action.key.code) || action.key.code == KC_NO) { |
280 | // e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless. | 280 | // e.g. LSFT(KC_LEFT_GUI): we don't want the LSFT to be weak as it would make it useless. |
281 | // This also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT). | 281 | // This also makes LSFT(KC_LEFT_GUI) behave exactly the same as LGUI(KC_LEFT_SHIFT). |
282 | // Same applies for some keys like KC_MEH which are declared as MEH(KC_NO). | 282 | // Same applies for some keys like KC_MEH which are declared as MEH(KC_NO). |
283 | add_mods(mods); | 283 | add_mods(mods); |
284 | } else { | 284 | } else { |
@@ -410,7 +410,7 @@ void process_action(keyrecord_t *record, action_t action) { | |||
410 | } else { | 410 | } else { |
411 | if (tap_count > 0) { | 411 | if (tap_count > 0) { |
412 | dprint("MODS_TAP: Tap: unregister_code\n"); | 412 | dprint("MODS_TAP: Tap: unregister_code\n"); |
413 | if (action.layer_tap.code == KC_CAPS) { | 413 | if (action.layer_tap.code == KC_CAPS_LOCK) { |
414 | wait_ms(TAP_HOLD_CAPS_DELAY); | 414 | wait_ms(TAP_HOLD_CAPS_DELAY); |
415 | } else { | 415 | } else { |
416 | wait_ms(TAP_CODE_DELAY); | 416 | wait_ms(TAP_CODE_DELAY); |
@@ -609,7 +609,7 @@ void process_action(keyrecord_t *record, action_t action) { | |||
609 | } else { | 609 | } else { |
610 | if (tap_count > 0) { | 610 | if (tap_count > 0) { |
611 | dprint("KEYMAP_TAP_KEY: Tap: unregister_code\n"); | 611 | dprint("KEYMAP_TAP_KEY: Tap: unregister_code\n"); |
612 | if (action.layer_tap.code == KC_CAPS) { | 612 | if (action.layer_tap.code == KC_CAPS_LOCK) { |
613 | wait_ms(TAP_HOLD_CAPS_DELAY); | 613 | wait_ms(TAP_HOLD_CAPS_DELAY); |
614 | } else { | 614 | } else { |
615 | wait_ms(TAP_CODE_DELAY); | 615 | wait_ms(TAP_CODE_DELAY); |
@@ -786,37 +786,37 @@ void register_code(uint8_t code) { | |||
786 | return; | 786 | return; |
787 | } | 787 | } |
788 | #ifdef LOCKING_SUPPORT_ENABLE | 788 | #ifdef LOCKING_SUPPORT_ENABLE |
789 | else if (KC_LOCKING_CAPS == code) { | 789 | else if (KC_LOCKING_CAPS_LOCK == code) { |
790 | # ifdef LOCKING_RESYNC_ENABLE | 790 | # ifdef LOCKING_RESYNC_ENABLE |
791 | // Resync: ignore if caps lock already is on | 791 | // Resync: ignore if caps lock already is on |
792 | if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) return; | 792 | if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) return; |
793 | # endif | 793 | # endif |
794 | add_key(KC_CAPSLOCK); | 794 | add_key(KC_CAPS_LOCK); |
795 | send_keyboard_report(); | 795 | send_keyboard_report(); |
796 | wait_ms(100); | 796 | wait_ms(100); |
797 | del_key(KC_CAPSLOCK); | 797 | del_key(KC_CAPS_LOCK); |
798 | send_keyboard_report(); | 798 | send_keyboard_report(); |
799 | } | 799 | } |
800 | 800 | ||
801 | else if (KC_LOCKING_NUM == code) { | 801 | else if (KC_LOCKING_NUM_LOCK == code) { |
802 | # ifdef LOCKING_RESYNC_ENABLE | 802 | # ifdef LOCKING_RESYNC_ENABLE |
803 | if (host_keyboard_leds() & (1 << USB_LED_NUM_LOCK)) return; | 803 | if (host_keyboard_leds() & (1 << USB_LED_NUM_LOCK)) return; |
804 | # endif | 804 | # endif |
805 | add_key(KC_NUMLOCK); | 805 | add_key(KC_NUM_LOCK); |
806 | send_keyboard_report(); | 806 | send_keyboard_report(); |
807 | wait_ms(100); | 807 | wait_ms(100); |
808 | del_key(KC_NUMLOCK); | 808 | del_key(KC_NUM_LOCK); |
809 | send_keyboard_report(); | 809 | send_keyboard_report(); |
810 | } | 810 | } |
811 | 811 | ||
812 | else if (KC_LOCKING_SCROLL == code) { | 812 | else if (KC_LOCKING_SCROLL_LOCK == code) { |
813 | # ifdef LOCKING_RESYNC_ENABLE | 813 | # ifdef LOCKING_RESYNC_ENABLE |
814 | if (host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK)) return; | 814 | if (host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK)) return; |
815 | # endif | 815 | # endif |
816 | add_key(KC_SCROLLLOCK); | 816 | add_key(KC_SCROLL_LOCK); |
817 | send_keyboard_report(); | 817 | send_keyboard_report(); |
818 | wait_ms(100); | 818 | wait_ms(100); |
819 | del_key(KC_SCROLLLOCK); | 819 | del_key(KC_SCROLL_LOCK); |
820 | send_keyboard_report(); | 820 | send_keyboard_report(); |
821 | } | 821 | } |
822 | #endif | 822 | #endif |
@@ -882,34 +882,34 @@ void unregister_code(uint8_t code) { | |||
882 | return; | 882 | return; |
883 | } | 883 | } |
884 | #ifdef LOCKING_SUPPORT_ENABLE | 884 | #ifdef LOCKING_SUPPORT_ENABLE |
885 | else if (KC_LOCKING_CAPS == code) { | 885 | else if (KC_LOCKING_CAPS_LOCK == code) { |
886 | # ifdef LOCKING_RESYNC_ENABLE | 886 | # ifdef LOCKING_RESYNC_ENABLE |
887 | // Resync: ignore if caps lock already is off | 887 | // Resync: ignore if caps lock already is off |
888 | if (!(host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK))) return; | 888 | if (!(host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK))) return; |
889 | # endif | 889 | # endif |
890 | add_key(KC_CAPSLOCK); | 890 | add_key(KC_CAPS_LOCK); |
891 | send_keyboard_report(); | 891 | send_keyboard_report(); |
892 | del_key(KC_CAPSLOCK); | 892 | del_key(KC_CAPS_LOCK); |
893 | send_keyboard_report(); | 893 | send_keyboard_report(); |
894 | } | 894 | } |
895 | 895 | ||
896 | else if (KC_LOCKING_NUM == code) { | 896 | else if (KC_LOCKING_NUM_LOCK == code) { |
897 | # ifdef LOCKING_RESYNC_ENABLE | 897 | # ifdef LOCKING_RESYNC_ENABLE |
898 | if (!(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK))) return; | 898 | if (!(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK))) return; |
899 | # endif | 899 | # endif |
900 | add_key(KC_NUMLOCK); | 900 | add_key(KC_NUM_LOCK); |
901 | send_keyboard_report(); | 901 | send_keyboard_report(); |
902 | del_key(KC_NUMLOCK); | 902 | del_key(KC_NUM_LOCK); |
903 | send_keyboard_report(); | 903 | send_keyboard_report(); |
904 | } | 904 | } |
905 | 905 | ||
906 | else if (KC_LOCKING_SCROLL == code) { | 906 | else if (KC_LOCKING_SCROLL_LOCK == code) { |
907 | # ifdef LOCKING_RESYNC_ENABLE | 907 | # ifdef LOCKING_RESYNC_ENABLE |
908 | if (!(host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK))) return; | 908 | if (!(host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK))) return; |
909 | # endif | 909 | # endif |
910 | add_key(KC_SCROLLLOCK); | 910 | add_key(KC_SCROLL_LOCK); |
911 | send_keyboard_report(); | 911 | send_keyboard_report(); |
912 | del_key(KC_SCROLLLOCK); | 912 | del_key(KC_SCROLL_LOCK); |
913 | send_keyboard_report(); | 913 | send_keyboard_report(); |
914 | } | 914 | } |
915 | #endif | 915 | #endif |
@@ -952,9 +952,9 @@ void tap_code_delay(uint8_t code, uint16_t delay) { | |||
952 | 952 | ||
953 | /** \brief Tap a keycode with the default delay. | 953 | /** \brief Tap a keycode with the default delay. |
954 | * | 954 | * |
955 | * \param code The basic keycode to tap. If `code` is `KC_CAPS`, the delay will be `TAP_HOLD_CAPS_DELAY`, otherwise `TAP_CODE_DELAY`, if defined. | 955 | * \param code The basic keycode to tap. If `code` is `KC_CAPS_LOCK`, the delay will be `TAP_HOLD_CAPS_DELAY`, otherwise `TAP_CODE_DELAY`, if defined. |
956 | */ | 956 | */ |
957 | void tap_code(uint8_t code) { tap_code_delay(code, code == KC_CAPS ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY); } | 957 | void tap_code(uint8_t code) { tap_code_delay(code, code == KC_CAPS_LOCK ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY); } |
958 | 958 | ||
959 | /** \brief Adds the given physically pressed modifiers and sends a keyboard report immediately. | 959 | /** \brief Adds the given physically pressed modifiers and sends a keyboard report immediately. |
960 | * | 960 | * |
@@ -1078,7 +1078,7 @@ bool is_tap_action(action_t action) { | |||
1078 | case ACT_LAYER_TAP: | 1078 | case ACT_LAYER_TAP: |
1079 | case ACT_LAYER_TAP_EXT: | 1079 | case ACT_LAYER_TAP_EXT: |
1080 | switch (action.layer_tap.code) { | 1080 | switch (action.layer_tap.code) { |
1081 | case KC_NO ... KC_RGUI: | 1081 | case KC_NO ... KC_RIGHT_GUI: |
1082 | case OP_TAP_TOGGLE: | 1082 | case OP_TAP_TOGGLE: |
1083 | case OP_ONESHOT: | 1083 | case OP_ONESHOT: |
1084 | return true; | 1084 | return true; |
@@ -1086,7 +1086,7 @@ bool is_tap_action(action_t action) { | |||
1086 | return false; | 1086 | return false; |
1087 | case ACT_SWAP_HANDS: | 1087 | case ACT_SWAP_HANDS: |
1088 | switch (action.swap.code) { | 1088 | switch (action.swap.code) { |
1089 | case KC_NO ... KC_RGUI: | 1089 | case KC_NO ... KC_RIGHT_GUI: |
1090 | case OP_SH_TAP_TOGGLE: | 1090 | case OP_SH_TAP_TOGGLE: |
1091 | return true; | 1091 | return true; |
1092 | } | 1092 | } |