X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=common%2Fkeyboard.c;h=c7ea2b840c4124ce437b027adf84c2f9ad9d7686;hb=e451c059296a4c9af7a476577fee64afb9965bca;hp=be01e5540cd39001c3d87928b41f38ebd92b340b;hpb=f7a445e537243f886d9cb022bede18859c9bfd12;p=max%2Ftmk_keyboard.git
diff --git a/common/keyboard.c b/common/keyboard.c
index be01e554..c7ea2b84 100644
--- a/common/keyboard.c
+++ b/common/keyboard.c
@@ -28,9 +28,6 @@ along with this program. If not, see .
#ifdef MOUSEKEY_ENABLE
#include "mousekey.h"
#endif
-#ifdef EXTRAKEY_ENABLE
-#include
-#endif
#define LAYER_DELAY 250
@@ -154,8 +151,12 @@ static bool layer_switch_off(uint8_t code)
static void register_code(uint8_t code)
{
if IS_KEY(code) {
- host_add_key(code);
- host_send_keyboard_report();
+ if (command_proc(code)) {
+ //clear_keyboard();
+ } else {
+ host_add_key(code);
+ host_send_keyboard_report();
+ }
}
else if IS_MOD(code) {
host_add_mod_bit(MOD_BIT(code));
@@ -330,9 +331,9 @@ static void unregister_code(uint8_t code)
* Ld: Switch back to default layer(*unregister* all keys but modifiers)
*/
#define NEXT(state) do { \
- debug("NEXT: "); print_P(state_str(kbdstate)); \
+ debug("NEXT: "); debug_P(state_str(kbdstate)); \
kbdstate = state; \
- debug(" -> "); print_P(state_str(kbdstate)); debug("\n"); \
+ debug(" -> "); debug_P(state_str(kbdstate)); debug("\n"); \
} while (0)
static inline void process_key(keyevent_t event)
@@ -342,7 +343,7 @@ static inline void process_key(keyevent_t event)
uint8_t tmp_mods;
- debug("state: "); print_P(state_str(kbdstate));
+ debug("state: "); debug_P(state_str(kbdstate));
debug(" kind: "); debug_hex(kind);
debug(" code: "); debug_hex(code);
if (event.pressed) { debug("d"); } else { debug("u"); }
@@ -554,18 +555,11 @@ void keyboard_task(void)
matrix_row_t matrix_change = 0;
matrix_scan();
- if (command_proc()) {
- debug("COMMAND\n");
- // TODO: COMMAND state?
- clear_keyboard();
- return;
- }
-
for (int r = 0; r < MATRIX_ROWS; r++) {
matrix_row = matrix_get_row(r);
matrix_change = matrix_row ^ matrix_prev[r];
if (matrix_change) {
- if (debug_matrix) matrix_print();
+ matrix_debug();
for (int c = 0; c < MATRIX_COLS; c++) {
if (matrix_change & (1<