summaryrefslogtreecommitdiffstats
path: root/tmk_core/common
diff options
context:
space:
mode:
authordbroqua <dbroqua@mousur.org>2017-05-26 20:35:31 +0200
committerdbroqua <dbroqua@mousur.org>2017-05-26 20:35:31 +0200
commit81e85a1a4e4b1b7c5bbf1fcffe967a60639778c0 (patch)
tree34c6c60530bb980dd26ad790eb0bc09f4ff99edb /tmk_core/common
parent0a4a966c6648e66a1129ae3af36639054d3e0ed3 (diff)
- Added integration of IBM Trackpoint
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/action.c34
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