diff options
author | Christopher Browne <cbbrowne@ca.afilias.info> | 2016-03-28 11:29:54 -0400 |
---|---|---|
committer | Christopher Browne <cbbrowne@ca.afilias.info> | 2016-03-28 11:29:54 -0400 |
commit | 95a88c09e18a7531a64838ceaa52df37bad8dc0d (patch) | |
tree | e108b87cbe318ff4824509be19209b010101d419 /tmk_core/common/action_util.c | |
parent | a4ff9f256738cf637553e7840d53f778d791fb6f (diff) | |
parent | 80eefb09ac5de95a6977702b4014d4b4d79a5d7d (diff) |
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'tmk_core/common/action_util.c')
-rw-r--r-- | tmk_core/common/action_util.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tmk_core/common/action_util.c b/tmk_core/common/action_util.c index f81877dd9f..a2d6577b24 100644 --- a/tmk_core/common/action_util.c +++ b/tmk_core/common/action_util.c @@ -29,6 +29,7 @@ static inline void del_key_bit(uint8_t code); static uint8_t real_mods = 0; static uint8_t weak_mods = 0; +static uint8_t macro_mods = 0; #ifdef USB_6KRO_ENABLE #define RO_ADD(a, b) ((a + b) % KEYBOARD_REPORT_KEYS) @@ -55,6 +56,7 @@ static int16_t oneshot_time = 0; void send_keyboard_report(void) { keyboard_report->mods = real_mods; keyboard_report->mods |= weak_mods; + keyboard_report->mods |= macro_mods; #ifndef NO_ACTION_ONESHOT if (oneshot_mods) { #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) @@ -118,6 +120,13 @@ void del_weak_mods(uint8_t mods) { weak_mods &= ~mods; } void set_weak_mods(uint8_t mods) { weak_mods = mods; } void clear_weak_mods(void) { weak_mods = 0; } +/* macro modifier */ +uint8_t get_macro_mods(void) { return macro_mods; } +void add_macro_mods(uint8_t mods) { macro_mods |= mods; } +void del_macro_mods(uint8_t mods) { macro_mods &= ~mods; } +void set_macro_mods(uint8_t mods) { macro_mods = mods; } +void clear_macro_mods(void) { macro_mods = 0; } + /* Oneshot modifier */ #ifndef NO_ACTION_ONESHOT void set_oneshot_mods(uint8_t mods) |