summaryrefslogtreecommitdiff
path: root/tmk_core/common
diff options
context:
space:
mode:
authorNick Choi <nikchi@users.noreply.github.com>2017-05-30 14:17:48 -0400
committerGitHub <noreply@github.com>2017-05-30 14:17:48 -0400
commit2c9f846608cbf91ce936071372634194745994d0 (patch)
tree7fc260baa3bca7ba748117e07fca8aaa186943dd /tmk_core/common
parent5393bc6f4eee3d3cb83997e5b03d8e5a5cea85d8 (diff)
parentcb791cf6cdbcd9fd1291f36f6b1a6840753db97f (diff)
Merge pull request #2 from qmk/master
pull in new qmk changes
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/action.c28
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();
}