From: tmk Date: Fri, 25 Feb 2011 12:58:00 +0000 (+0900) Subject: FIX: host_get_first_key in vusb/host.c X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=258fd3c3680fadd16433511c038ac52dab0c39ae;p=max%2Ftmk_keyboard.git FIX: host_get_first_key in vusb/host.c --- diff --git a/vusb/host.c b/vusb/host.c index f637abac..05a1f29c 100644 --- a/vusb/host.c +++ b/vusb/host.c @@ -86,14 +86,17 @@ uint8_t host_has_anykey(void) return cnt; } -uint8_t *host_get_keys(void) +uint8_t host_get_first_key(void) { - return keyboard_report->keys; -} - -uint8_t host_get_mods(void) -{ - return keyboard_report->mods; +#ifdef USB_NKRO_ENABLE + if (keyboard_nkro) { + uint8_t i = 0; + for (; i < REPORT_KEYS && !keyboard_report->keys[i]; i++) + ; + return i<<3 | biton(keyboard_report->keys[i]); + } +#endif + return keyboard_report->keys[0]; }