diff options
| author | Alex Ong <the.onga@gmail.com> | 2019-01-04 19:43:45 +1100 |
|---|---|---|
| committer | Alex Ong <the.onga@gmail.com> | 2019-01-04 19:43:45 +1100 |
| commit | 2bb2977c133646c4e056960e72029270d77cc1eb (patch) | |
| tree | 235d491f992121ac1716c5bf2fafb80983748576 /tmk_core/common/action.c | |
| parent | a55c838961c89097ab849ed6cb1f261791e6b9b4 (diff) | |
| parent | 47c91fc7f75ae0a477e55b687aa0fc30da0a283c (diff) | |
| download | qmk_firmware-2bb2977c133646c4e056960e72029270d77cc1eb.tar.gz qmk_firmware-2bb2977c133646c4e056960e72029270d77cc1eb.zip | |
Merge branch 'master' into debounce_refactor
# Conflicts:
# tmk_core/common/keyboard.c
Diffstat (limited to 'tmk_core/common/action.c')
| -rw-r--r-- | tmk_core/common/action.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index f7c039f45..b99c2acaa 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c | |||
| @@ -120,7 +120,7 @@ void process_hand_swap(keyevent_t *event) { | |||
| 120 | } | 120 | } |
| 121 | #endif | 121 | #endif |
| 122 | 122 | ||
| 123 | #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) | 123 | #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) |
| 124 | bool disable_action_cache = false; | 124 | bool disable_action_cache = false; |
| 125 | 125 | ||
| 126 | void process_record_nocache(keyrecord_t *record) | 126 | void process_record_nocache(keyrecord_t *record) |
| @@ -773,6 +773,13 @@ void register_code(uint8_t code) | |||
| 773 | else if IS_CONSUMER(code) { | 773 | else if IS_CONSUMER(code) { |
| 774 | host_consumer_send(KEYCODE2CONSUMER(code)); | 774 | host_consumer_send(KEYCODE2CONSUMER(code)); |
| 775 | } | 775 | } |
| 776 | |||
| 777 | #ifdef MOUSEKEY_ENABLE | ||
| 778 | else if IS_MOUSEKEY(code) { | ||
| 779 | mousekey_on(code); | ||
| 780 | mousekey_send(); | ||
| 781 | } | ||
| 782 | #endif | ||
| 776 | } | 783 | } |
| 777 | 784 | ||
| 778 | /** \brief Utilities for actions. (FIXME: Needs better description) | 785 | /** \brief Utilities for actions. (FIXME: Needs better description) |
| @@ -832,6 +839,24 @@ void unregister_code(uint8_t code) | |||
| 832 | else if IS_CONSUMER(code) { | 839 | else if IS_CONSUMER(code) { |
| 833 | host_consumer_send(0); | 840 | host_consumer_send(0); |
| 834 | } | 841 | } |
| 842 | #ifdef MOUSEKEY_ENABLE | ||
| 843 | else if IS_MOUSEKEY(code) { | ||
| 844 | mousekey_off(code); | ||
| 845 | mousekey_send(); | ||
| 846 | } | ||
| 847 | #endif | ||
| 848 | } | ||
| 849 | |||
| 850 | /** \brief Utilities for actions. (FIXME: Needs better description) | ||
| 851 | * | ||
| 852 | * FIXME: Needs documentation. | ||
| 853 | */ | ||
| 854 | void tap_code(uint8_t code) { | ||
| 855 | register_code(code); | ||
| 856 | #if TAP_CODE_DELAY > 0 | ||
| 857 | wait_ms(TAP_CODE_DELAY); | ||
| 858 | #endif | ||
| 859 | unregister_code(code); | ||
| 835 | } | 860 | } |
| 836 | 861 | ||
| 837 | /** \brief Utilities for actions. (FIXME: Needs better description) | 862 | /** \brief Utilities for actions. (FIXME: Needs better description) |
| @@ -874,9 +899,18 @@ void clear_keyboard(void) | |||
| 874 | */ | 899 | */ |
| 875 | void clear_keyboard_but_mods(void) | 900 | void clear_keyboard_but_mods(void) |
| 876 | { | 901 | { |
| 902 | clear_keys(); | ||
| 903 | clear_keyboard_but_mods_and_keys(); | ||
| 904 | } | ||
| 905 | |||
| 906 | /** \brief Utilities for actions. (FIXME: Needs better description) | ||
| 907 | * | ||
| 908 | * FIXME: Needs documentation. | ||
| 909 | */ | ||
| 910 | void clear_keyboard_but_mods_and_keys() | ||
| 911 | { | ||
| 877 | clear_weak_mods(); | 912 | clear_weak_mods(); |
| 878 | clear_macro_mods(); | 913 | clear_macro_mods(); |
| 879 | clear_keys(); | ||
| 880 | send_keyboard_report(); | 914 | send_keyboard_report(); |
| 881 | #ifdef MOUSEKEY_ENABLE | 915 | #ifdef MOUSEKEY_ENABLE |
| 882 | mousekey_clear(); | 916 | mousekey_clear(); |
