From 2b8cd88ab142068eed0a3f230a3de79deb567536 Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 10 Feb 2011 15:51:30 +0900 Subject: refactor keyboard.h, host.h --- layer.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'layer.c') diff --git a/layer.c b/layer.c index 0e88d53d9c..7138c0ed1d 100644 --- a/layer.c +++ b/layer.c @@ -1,5 +1,5 @@ #include "keymap_skel.h" -#include "keyboard.h" +#include "host.h" #include "debug.h" #include "timer.h" #include "layer.h" @@ -98,23 +98,23 @@ void layer_switching(uint8_t fn_bits) debug(" -> "); debug_hex(current_layer); debug("\n"); } } else { - if (keyboard_has_anykey()) { // other keys is pressed + if (host_has_anykey()) { // other keys is pressed uint8_t _fn_to_send = BIT_SUBT(fn_bits, sent_fn); if (_fn_to_send) { debug("Fn case: 4(send Fn before other key pressed)\n"); // send only Fn key first - keyboard_swap_report(); - keyboard_clear_report(); - keyboard_add_code(keymap_fn_keycode(_fn_to_send)); // TODO: do all Fn keys - keyboard_set_mods(last_mods); - keyboard_send(); - keyboard_swap_report(); + host_swap_keyboard_report(); + host_clear_keyboard_report(); + host_add_code(keymap_fn_keycode(_fn_to_send)); // TODO: do all Fn keys + host_set_mods(last_mods); + host_send_keyboard_report(); + host_swap_keyboard_report(); sent_fn |= _fn_to_send; } } } // add Fn keys to send - //keyboard_add_code(keymap_fn_keycode(fn_bits&sent_fn)); // TODO: do all Fn keys + //host_add_code(keymap_fn_keycode(fn_bits&sent_fn)); // TODO: do all Fn keys } } else { // Fn state is changed(edge) uint8_t fn_changed = 0; @@ -128,7 +128,7 @@ void layer_switching(uint8_t fn_bits) // pressed Fn if ((fn_changed = BIT_SUBT(fn_bits, last_fn))) { debug("fn_changed: "); debug_bin(fn_changed); debug("\n"); - if (keyboard_has_anykey()) { + if (host_has_anykey()) { debug("Fn case: 5(pressed Fn with other key)\n"); sent_fn |= fn_changed; } else if (fn_changed & sent_fn) { // pressed same Fn in a row @@ -149,12 +149,12 @@ void layer_switching(uint8_t fn_bits) if (BIT_SUBT(fn_changed, sent_fn)) { // layer not used && Fn not sent debug("Fn case: 2(send Fn one shot: released Fn during LAYER_SEND_FN_TERM)\n"); // send only Fn key first - keyboard_swap_report(); - keyboard_clear_report(); - keyboard_add_code(keymap_fn_keycode(fn_changed)); // TODO: do all Fn keys - keyboard_set_mods(last_mods); - keyboard_send(); - keyboard_swap_report(); + host_swap_keyboard_report(); + host_clear_keyboard_report(); + host_add_code(keymap_fn_keycode(fn_changed)); // TODO: do all Fn keys + host_set_mods(last_mods); + host_send_keyboard_report(); + host_swap_keyboard_report(); sent_fn |= fn_changed; } } @@ -171,7 +171,7 @@ void layer_switching(uint8_t fn_bits) // send Fn keys for (uint8_t i = 0; i < 8; i++) { if ((sent_fn & fn_bits) & (1<