diff options
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r-- | tmk_core/common/action.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 1ba38a285e..bd6aeba4f8 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "mousekey.h" #include "command.h" #include "led.h" -#include "backlight.h" #include "action_layer.h" #include "action_tapping.h" #include "action_macro.h" @@ -28,6 +27,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "action.h" #include "wait.h" +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif + #ifdef DEBUG_ACTION # include "debug.h" #else @@ -868,9 +871,9 @@ void tap_code(uint8_t code) { unregister_code(code); } -/** \brief Utilities for actions. (FIXME: Needs better description) +/** \brief Adds the given physically pressed modifiers and sends a keyboard report immediately. * - * FIXME: Needs documentation. + * \param mods A bitfield of modifiers to unregister. */ void register_mods(uint8_t mods) { if (mods) { @@ -879,9 +882,9 @@ void register_mods(uint8_t mods) { } } -/** \brief Utilities for actions. (FIXME: Needs better description) +/** \brief Removes the given physically pressed modifiers and sends a keyboard report immediately. * - * FIXME: Needs documentation. + * \param mods A bitfield of modifiers to unregister. */ void unregister_mods(uint8_t mods) { if (mods) { @@ -890,6 +893,28 @@ void unregister_mods(uint8_t mods) { } } +/** \brief Adds the given weak modifiers and sends a keyboard report immediately. + * + * \param mods A bitfield of modifiers to register. + */ +void register_weak_mods(uint8_t mods) { + if (mods) { + add_weak_mods(mods); + send_keyboard_report(); + } +} + +/** \brief Removes the given weak modifiers and sends a keyboard report immediately. + * + * \param mods A bitfield of modifiers to unregister. + */ +void unregister_weak_mods(uint8_t mods) { + if (mods) { + del_weak_mods(mods); + send_keyboard_report(); + } +} + /** \brief Utilities for actions. (FIXME: Needs better description) * * FIXME: Needs documentation. |