diff options
author | fauxpark <fauxpark@gmail.com> | 2019-10-16 10:02:09 +1100 |
---|---|---|
committer | Joel Challis <git@zvecr.com> | 2019-10-16 00:02:09 +0100 |
commit | 63f4806d7a67100fdf37b5f557ceb9d0982c0775 (patch) | |
tree | c942f96e391b32e91753516fe0b07af639fc5b97 /tmk_core/common | |
parent | 45225190794b438129d5b27d4fe5b756fdf2efc4 (diff) |
Fix bug in `do_code16()` (#6935)
* Fix bug in `do_code16()`
* Remove qk_ mods functions
Diffstat (limited to 'tmk_core/common')
-rw-r--r-- | tmk_core/common/action.c | 30 | ||||
-rw-r--r-- | tmk_core/common/action.h | 2 |
2 files changed, 28 insertions, 4 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 1ba38a285e..44b19d368e 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -868,9 +868,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 +879,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 +890,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. diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 633cedb06b..15f4ce15c0 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -90,6 +90,8 @@ void unregister_code(uint8_t code); void tap_code(uint8_t code); void register_mods(uint8_t mods); void unregister_mods(uint8_t mods); +void register_weak_mods(uint8_t mods); +void unregister_weak_mods(uint8_t mods); // void set_mods(uint8_t mods); void clear_keyboard(void); void clear_keyboard_but_mods(void); |