summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2011-02-25 21:58:00 +0900
committertmk <nobody@nowhere>2011-02-25 21:58:00 +0900
commit258fd3c3680fadd16433511c038ac52dab0c39ae (patch)
tree29479e6f4586c9bf2f35179189b3eabe1e21f613
parent00350c180dee31ec9d9c4aee31e06faf55bd1c6b (diff)
FIX: host_get_first_key in vusb/host.c
-rw-r--r--vusb/host.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/vusb/host.c b/vusb/host.c
index f637abac8c..05a1f29cd1 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];
}