diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2017-06-17 17:55:44 +0300 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2017-06-18 21:22:22 +0300 |
commit | fb95d86b39074b581455fb35a17477cce79a3738 (patch) | |
tree | 69832d2d4827afa1845c4c1fefa0bc304ba6545e /tmk_core/common/report.c | |
parent | 017458a07bda3f4b2604d079ec65ef607a1a1e57 (diff) | |
download | qmk_firmware-fb95d86b39074b581455fb35a17477cce79a3738.tar.gz |
Move functions for adding keys from to reports to report.h
Diffstat (limited to 'tmk_core/common/report.c')
-rw-r--r-- | tmk_core/common/report.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tmk_core/common/report.c b/tmk_core/common/report.c index 0a67b2534..74c6d3fdd 100644 --- a/tmk_core/common/report.c +++ b/tmk_core/common/report.c @@ -175,3 +175,33 @@ void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code) } } #endif + +void add_key_to_report(report_keyboard_t* keyboard_report, int8_t key) +{ +#ifdef NKRO_ENABLE + if (keyboard_protocol && keymap_config.nkro) { + add_key_bit(keyboard_report, key); + return; + } +#endif + add_key_byte(keyboard_report, key); +} + +void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key) +{ +#ifdef NKRO_ENABLE + if (keyboard_protocol && keymap_config.nkro) { + del_key_bit(keyboard_report, key); + return; + } +#endif + del_key_byte(keyboard_report, key); +} + +void clear_keys_from_report(report_keyboard_t* keyboard_report) +{ + // not clear mods + for (int8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) { + keyboard_report->raw[i] = 0; + } +}
\ No newline at end of file |