From 81e85a1a4e4b1b7c5bbf1fcffe967a60639778c0 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Fri, 26 May 2017 20:35:31 +0200 Subject: - Added integration of IBM Trackpoint --- tmk_core/common/action.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'tmk_core/common/action.c') 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 . #include "nodebug.h" #endif +int tp_buttons; + #ifdef FAUXCLICKY_ENABLE #include #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 -- cgit v1.2.3 From b6c60333e48e3ed77d5e8a21a139ce9955977559 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 29 May 2017 13:21:38 -0400 Subject: Re-enable mouse buttons --- tmk_core/common/action.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tmk_core/common/action.c') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index f73b0fe807..cffc0b9ebe 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -324,9 +324,10 @@ void process_action(keyrecord_t *record, action_t action) tp_buttons |= (1<<2); break; default: - mousekey_on(action.key.code); - mousekey_send(); + break; } + mousekey_on(action.key.code); + mousekey_send(); } else { switch (action.key.code) { case KC_MS_BTN1: @@ -339,9 +340,10 @@ void process_action(keyrecord_t *record, action_t action) tp_buttons &= ~(1<<2); break; default: - mousekey_off(action.key.code); - mousekey_send(); + break; } + mousekey_off(action.key.code); + mousekey_send(); } break; #endif -- cgit v1.2.3