diff options
author | Jack Humbert <jack.humb@gmail.com> | 2017-05-26 18:32:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-26 18:32:43 -0400 |
commit | 453877422bddd7c83ae8b893e79203cb5d868cf7 (patch) | |
tree | 4a8e66adc77bb754261217ca95df5f21ae9ae96f /tmk_core/common/action.c | |
parent | 9851e6f3b156e3d77a2c9af01872e8bb550ca226 (diff) | |
parent | 6b994ecd82f660feb44bac376ae7d0147d40d818 (diff) |
Merge pull request #1327 from Dbroqua/master
Added Integration of IBM Trackpoint
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r-- | tmk_core/common/action.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index a534f818ec..f73b0fe807 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,11 +313,35 @@ void process_action(keyrecord_t *record, action_t action) /* Mouse key */ case ACT_MOUSEKEY: if (event.pressed) { - mousekey_on(action.key.code); - mousekey_send(); + 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: + mousekey_on(action.key.code); + mousekey_send(); + } } else { - mousekey_off(action.key.code); - mousekey_send(); + 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: + mousekey_off(action.key.code); + mousekey_send(); + } } break; #endif |