aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/action.c6
-rw-r--r--common/action.h1
-rw-r--r--common/action_code.h10
-rw-r--r--common/action_util.h1
-rw-r--r--common/host.c8
-rw-r--r--common/host.h6
-rw-r--r--common/keyboard.c13
-rw-r--r--common/mousekey.c1
8 files changed, 19 insertions, 27 deletions
diff --git a/common/action.c b/common/action.c
index 38ee12abe..e6938f5a2 100644
--- a/common/action.c
+++ b/common/action.c
@@ -496,12 +496,6 @@ void clear_keyboard_but_mods(void)
496#endif 496#endif
497} 497}
498 498
499bool sending_anykey(void)
500{
501 return (has_anykey() || host_mouse_in_use() ||
502 host_last_sysytem_report() || host_last_consumer_report());
503}
504
505bool is_tap_key(key_t key) 499bool is_tap_key(key_t key)
506{ 500{
507 action_t action = layer_switch_get_action(key); 501 action_t action = layer_switch_get_action(key);
diff --git a/common/action.h b/common/action.h
index d57f4a86f..077711c23 100644
--- a/common/action.h
+++ b/common/action.h
@@ -64,7 +64,6 @@ void unregister_mods(uint8_t mods);
64//void set_mods(uint8_t mods); 64//void set_mods(uint8_t mods);
65void clear_keyboard(void); 65void clear_keyboard(void);
66void clear_keyboard_but_mods(void); 66void clear_keyboard_but_mods(void);
67bool sending_anykey(void);
68void layer_switch(uint8_t new_layer); 67void layer_switch(uint8_t new_layer);
69bool is_tap_key(key_t key); 68bool is_tap_key(key_t key);
70 69
diff --git a/common/action_code.h b/common/action_code.h
index bd3652e38..8df86b119 100644
--- a/common/action_code.h
+++ b/common/action_code.h
@@ -209,11 +209,11 @@ enum mods_codes {
209 MODS_TAP_TOGGLE = 0x01, 209 MODS_TAP_TOGGLE = 0x01,
210}; 210};
211#define ACTION_KEY(key) ACTION(ACT_MODS, (key)) 211#define ACTION_KEY(key) ACTION(ACT_MODS, (key))
212#define ACTION_MODS(mods) ACTION(ACT_MODS, (mods&0x1f)<<8 | 0) 212#define ACTION_MODS(mods) ACTION(ACT_MODS, ((mods)&0x1f)<<8 | 0)
213#define ACTION_MODS_KEY(mods, key) ACTION(ACT_MODS, (mods&0x1f)<<8 | (key)) 213#define ACTION_MODS_KEY(mods, key) ACTION(ACT_MODS, ((mods)&0x1f)<<8 | (key))
214#define ACTION_MODS_TAP_KEY(mods, key) ACTION(ACT_MODS_TAP, (mods&0x1f)<<8 | (key)) 214#define ACTION_MODS_TAP_KEY(mods, key) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | (key))
215#define ACTION_MODS_ONESHOT(mods) ACTION(ACT_MODS_TAP, (mods&0x1f)<<8 | MODS_ONESHOT) 215#define ACTION_MODS_ONESHOT(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_ONESHOT)
216#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, (mods&0x1f)<<8 | MODS_TAP_TOGGLE) 216#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_TAP_TOGGLE)
217 217
218 218
219/* 219/*
diff --git a/common/action_util.h b/common/action_util.h
index 939bc2b66..f9d3161a8 100644
--- a/common/action_util.h
+++ b/common/action_util.h
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#define ACTION_UTIL_H 18#define ACTION_UTIL_H
19 19
20#include <stdint.h> 20#include <stdint.h>
21#include "report.h"
21 22
22extern report_keyboard_t *keyboard_report; 23extern report_keyboard_t *keyboard_report;
23 24
diff --git a/common/host.c b/common/host.c
index 0703dba01..1eafef75c 100644
--- a/common/host.c
+++ b/common/host.c
@@ -27,9 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
27bool keyboard_nkro = false; 27bool keyboard_nkro = false;
28#endif 28#endif
29 29
30report_mouse_t mouse_report = {};
31
32
33static host_driver_t *driver; 30static host_driver_t *driver;
34static uint16_t last_system_report = 0; 31static uint16_t last_system_report = 0;
35static uint16_t last_consumer_report = 0; 32static uint16_t last_consumer_report = 0;
@@ -89,11 +86,6 @@ void host_consumer_send(uint16_t report)
89 (*driver->send_consumer)(report); 86 (*driver->send_consumer)(report);
90} 87}
91 88
92uint8_t host_mouse_in_use(void)
93{
94 return (mouse_report.buttons | mouse_report.x | mouse_report.y | mouse_report.v | mouse_report.h);
95}
96
97uint16_t host_last_sysytem_report(void) 89uint16_t host_last_sysytem_report(void)
98{ 90{
99 return last_system_report; 91 return last_system_report;
diff --git a/common/host.h b/common/host.h
index c1a0fbac4..8ff262985 100644
--- a/common/host.h
+++ b/common/host.h
@@ -32,9 +32,6 @@ extern "C" {
32extern bool keyboard_nkro; 32extern bool keyboard_nkro;
33#endif 33#endif
34 34
35/* report */
36extern report_mouse_t mouse_report;
37
38 35
39/* host driver */ 36/* host driver */
40void host_set_driver(host_driver_t *driver); 37void host_set_driver(host_driver_t *driver);
@@ -47,9 +44,6 @@ void host_mouse_send(report_mouse_t *report);
47void host_system_send(uint16_t data); 44void host_system_send(uint16_t data);
48void host_consumer_send(uint16_t data); 45void host_consumer_send(uint16_t data);
49 46
50/* mouse report utils */
51uint8_t host_mouse_in_use(void);
52
53uint16_t host_last_sysytem_report(void); 47uint16_t host_last_sysytem_report(void);
54uint16_t host_last_consumer_report(void); 48uint16_t host_last_consumer_report(void);
55 49
diff --git a/common/keyboard.c b/common/keyboard.c
index 601e3abe1..2b66f20a0 100644
--- a/common/keyboard.c
+++ b/common/keyboard.c
@@ -30,8 +30,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30#include "sendchar.h" 30#include "sendchar.h"
31#include "bootmagic.h" 31#include "bootmagic.h"
32#include "eeconfig.h" 32#include "eeconfig.h"
33#include "mousekey.h"
34#include "backlight.h" 33#include "backlight.h"
34#ifdef MOUSEKEY_ENABLE
35# include "mousekey.h"
36#endif
37#ifdef PS2_MOUSE_ENABLE
38# include "ps2_mouse.h"
39#endif
35 40
36 41
37#ifdef MATRIX_HAS_GHOST 42#ifdef MATRIX_HAS_GHOST
@@ -111,10 +116,16 @@ void keyboard_task(void)
111 action_exec(TICK); 116 action_exec(TICK);
112 117
113MATRIX_LOOP_END: 118MATRIX_LOOP_END:
119
114#ifdef MOUSEKEY_ENABLE 120#ifdef MOUSEKEY_ENABLE
115 // mousekey repeat & acceleration 121 // mousekey repeat & acceleration
116 mousekey_task(); 122 mousekey_task();
117#endif 123#endif
124
125#ifdef PS2_MOUSE_ENABLE
126 ps2_mouse_task();
127#endif
128
118 // update LED 129 // update LED
119 if (led_status != host_keyboard_leds()) { 130 if (led_status != host_keyboard_leds()) {
120 led_status = host_keyboard_leds(); 131 led_status = host_keyboard_leds();
diff --git a/common/mousekey.c b/common/mousekey.c
index 3068fc5e3..017be9411 100644
--- a/common/mousekey.c
+++ b/common/mousekey.c
@@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
26 26
27 27
28 28
29static report_mouse_t mouse_report = {};
29static uint8_t mousekey_repeat = 0; 30static uint8_t mousekey_repeat = 0;
30static uint8_t mousekey_accel = 0; 31static uint8_t mousekey_accel = 0;
31 32