X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Faction.c;h=cffc0b9ebe1c994ee53edad4a072c08b5d97fd30;hb=2c9f846608cbf91ce936071372634194745994d0;hp=a534f818ec00e80910e0b275b039afdf05c03048;hpb=4f1007952b4deea2012be4787789289fae7c19e1;p=qmk_firmware.git
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index a534f818e..cffc0b9eb 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,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();
}