]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
FIX: host_get_first_key in vusb/host.c
authortmk <nobody@nowhere>
Fri, 25 Feb 2011 12:58:00 +0000 (21:58 +0900)
committertmk <nobody@nowhere>
Fri, 25 Feb 2011 12:58:00 +0000 (21:58 +0900)
vusb/host.c

index f637abac8c54aa27a189e6f23e8f09337c284e5f..05a1f29cd19716ed368f074a5ebe7ad47a63b086 100644 (file)
@@ -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];
 }