diff options
author | Nick Choi <nikchi@users.noreply.github.com> | 2017-05-30 14:17:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-30 14:17:48 -0400 |
commit | 2c9f846608cbf91ce936071372634194745994d0 (patch) | |
tree | 7fc260baa3bca7ba748117e07fca8aaa186943dd /tmk_core/common/action.c | |
parent | 5393bc6f4eee3d3cb83997e5b03d8e5a5cea85d8 (diff) | |
parent | cb791cf6cdbcd9fd1291f36f6b1a6840753db97f (diff) |
Merge pull request #2 from qmk/master
pull in new qmk changes
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r-- | tmk_core/common/action.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index a534f818ec..cffc0b9ebe 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -34,6 +34,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "nodebug.h" #endif +int tp_buttons; + #ifdef FAUXCLICKY_ENABLE #include <fauxclicky.h> #endif @@ -311,9 +313,35 @@ void process_action(keyrecord_t *record, action_t action) /* Mouse key */ case ACT_MOUSEKEY: if (event.pressed) { + switch (action.key.code) { + case KC_MS_BTN1: + tp_buttons |= (1<<0); + break; + case KC_MS_BTN2: + tp_buttons |= (1<<1); + break; + case KC_MS_BTN3: + tp_buttons |= (1<<2); + break; + default: + break; + } mousekey_on(action.key.code); mousekey_send(); } else { + switch (action.key.code) { + case KC_MS_BTN1: + tp_buttons &= ~(1<<0); + break; + case KC_MS_BTN2: + tp_buttons &= ~(1<<1); + break; + case KC_MS_BTN3: + tp_buttons &= ~(1<<2); + break; + default: + break; + } mousekey_off(action.key.code); mousekey_send(); } |