aboutsummaryrefslogtreecommitdiff
path: root/common/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/keyboard.c')
-rw-r--r--common/keyboard.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/keyboard.c b/common/keyboard.c
index 37d3b06ba..43abf4236 100644
--- a/common/keyboard.c
+++ b/common/keyboard.c
@@ -90,8 +90,10 @@ static void clear_keyboard(void)
90 host_system_send(0); 90 host_system_send(0);
91 host_consumer_send(0); 91 host_consumer_send(0);
92 92
93#ifdef MOUSEKEY_ENABLE
93 mousekey_clear(); 94 mousekey_clear();
94 mousekey_send(); 95 mousekey_send();
96#endif
95} 97}
96 98
97static void clear_keyboard_but_mods(void) 99static void clear_keyboard_but_mods(void)
@@ -102,8 +104,10 @@ static void clear_keyboard_but_mods(void)
102 host_system_send(0); 104 host_system_send(0);
103 host_consumer_send(0); 105 host_consumer_send(0);
104 106
107#ifdef MOUSEKEY_ENABLE
105 mousekey_clear(); 108 mousekey_clear();
106 mousekey_send(); 109 mousekey_send();
110#endif
107} 111}
108 112
109static void layer_switch_on(uint8_t code) 113static void layer_switch_on(uint8_t code)
@@ -159,8 +163,10 @@ static void register_code(uint8_t code)
159 host_send_keyboard_report(); 163 host_send_keyboard_report();
160 } 164 }
161 else if IS_MOUSEKEY(code) { 165 else if IS_MOUSEKEY(code) {
166#ifdef MOUSEKEY_ENABLE
162 mousekey_on(code); 167 mousekey_on(code);
163 mousekey_send(); 168 mousekey_send();
169#endif
164 } 170 }
165 else if IS_CONSUMER(code) { 171 else if IS_CONSUMER(code) {
166 uint16_t usage = 0; 172 uint16_t usage = 0;
@@ -251,8 +257,10 @@ static void unregister_code(uint8_t code)
251 host_send_keyboard_report(); 257 host_send_keyboard_report();
252 } 258 }
253 else if IS_MOUSEKEY(code) { 259 else if IS_MOUSEKEY(code) {
260#ifdef MOUSEKEY_ENABLE
254 mousekey_off(code); 261 mousekey_off(code);
255 mousekey_send(); 262 mousekey_send();
263#endif
256 } 264 }
257 else if IS_CONSUMER(code) { 265 else if IS_CONSUMER(code) {
258 host_consumer_send(0x0000); 266 host_consumer_send(0x0000);
@@ -390,7 +398,7 @@ static inline void process_key(keyevent_t event)
390 case KEY_UP: 398 case KEY_UP:
391 case MOD_UP: 399 case MOD_UP:
392 unregister_code(code); 400 unregister_code(code);
393 // no key registered? mousekey, mediakey, systemkey 401 // TODO: no key registered? mousekey, mediakey, systemkey
394 if (!host_has_anykey()) 402 if (!host_has_anykey())
395 NEXT(IDLE); 403 NEXT(IDLE);
396 break; 404 break;
@@ -570,8 +578,10 @@ void keyboard_task(void)
570 } 578 }
571 } 579 }
572 580
581#ifdef MOUSEKEY_ENABLE
573 // mousekey repeat & acceleration 582 // mousekey repeat & acceleration
574 mousekey_task(); 583 mousekey_task();
584#endif
575 585
576 // FAIL SAFE: clear all key if no key down 586 // FAIL SAFE: clear all key if no key down
577 if (matrix_change) { 587 if (matrix_change) {