Index: uspace/lib/usb/include/usb/classes/hidpath.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hidpath.h	(revision 1be39e988ca00ac8ad0815e79965878eacbd64a6)
+++ uspace/lib/usb/include/usb/classes/hidpath.h	(revision 5f7b75aeb93f31ea66e112a980a54f47e93c0081)
@@ -44,19 +44,13 @@
  */
 /** Wanted usage path must be exactly the same as the searched one */
-#define USB_HID_PATH_COMPARE_STRICT				0
+#define USB_HID_PATH_COMPARE_STRICT		0
 /** Wanted usage path must be the suffix in the searched one */
-#define USB_HID_PATH_COMPARE_END			1
+#define USB_HID_PATH_COMPARE_END		1
 /** */
-#define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY	4
-#define USB_HID_PATH_COMPARE_COLLECTION_ONLY	2 /* porovnava jenom cestu z Kolekci */
+#define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY	2
 /** Searched usage page must be prefix of the other one */
-#define USB_HID_PATH_COMPARE_BEGIN		8
+#define USB_HID_PATH_COMPARE_BEGIN		4
 /** Searched couple of usage page and usage can be anywhere in usage path */
-#define USB_HID_PATH_COMPARE_WHERE		16
-/**
- * TODO
- *  * porovnani zacatek - neni to to samy jako COLLECTION ONLY?? -- TEST
- *  * porovnani kdekoliv (jenom s delkou 1 at si to moc nekomplikujem)
- */
+#define USB_HID_PATH_COMPARE_ANYWHERE		8
 
 
Index: uspace/lib/usb/src/hidpath.c
===================================================================
--- uspace/lib/usb/src/hidpath.c	(revision 1be39e988ca00ac8ad0815e79965878eacbd64a6)
+++ uspace/lib/usb/src/hidpath.c	(revision 5f7b75aeb93f31ea66e112a980a54f47e93c0081)
@@ -149,5 +149,5 @@
 		usb_log_debug("\tFLAGS: %d\n", path_item->flags);		
 		
-		item = item->next;
+       		item = item->next;
 	}
 }
@@ -156,7 +156,6 @@
  * Compares two usage paths structures
  *
- * If USB_HID_PATH_COMPARE_COLLECTION_ONLY flag is given, the last item in report_path structure is forgotten
- *
- * @param report_path usage path structure to compare
+ *
+ * @param report_path usage path structure to compare with @path 
  * @param path usage patrh structure to compare
  * @param flags Flags determining the mode of comparison
@@ -179,4 +178,5 @@
 	}
 
+	// Empty path match all others
 	if(path->depth == 0){
 		return EOK;
@@ -189,10 +189,43 @@
 	
 	switch(flags){
-		/* path must be completly identical */
+		/* path is somewhere in report_path */
+		case USB_HID_PATH_COMPARE_ANYWHERE:
+			if(path->depth != 1){
+				return 1;
+			}
+
+			// projit skrz cestu a kdyz nekde sedi tak vratim EOK
+			// dojduli az za konec tak nnesedi
+			report_link = report_path->head.next;
+			path_link = path->head.next;
+			path_item = list_get_instance(path_link, usb_hid_report_usage_path_t, link);
+
+			while(report_link != &report_path->head) {
+				report_item = list_get_instance(report_link, usb_hid_report_usage_path_t, link);
+				if(report_item->usage_page == path_item->usage_page){
+					if(only_page == 0){
+						if(report_item->usage == path_item->usage) {
+							return EOK;
+						}
+					}
+					else {
+						return EOK;
+					}
+				}
+
+				report_link = report_link->next;
+			}
+
+			return 1;
+			break;
+		/* the paths must be identical */
 		case USB_HID_PATH_COMPARE_STRICT:
 				if(report_path->depth != path->depth){
 					return 1;
 				}
-
+		
+		/* path is prefix of the report_path */
+		case USB_HID_PATH_COMPARE_BEGIN:
+	
 				report_link = report_path->head.next;
 				path_link = path->head.next;
@@ -221,8 +254,6 @@
 				}
 
-				if(((report_link == &report_path->head) && (path_link == &path->head)) || 
-				   (((flags & USB_HID_PATH_COMPARE_COLLECTION_ONLY) != 0) && 
-				    (path_link = &path->head) && 
-				    (report_link == report_path->head.prev))) {
+				if((((flags & USB_HID_PATH_COMPARE_BEGIN) != 0) && (path_link == &path->head)) || 
+				   ((report_link == &report_path->head) && (path_link == &path->head))) {
 					return EOK;
 				}
@@ -232,13 +263,8 @@
 			break;
 
-		/* compare with only the end of path*/
+		/* path is suffix of report_path */
 		case USB_HID_PATH_COMPARE_END:
 
-				if((flags & USB_HID_PATH_COMPARE_COLLECTION_ONLY) != 0) {
-					report_link = report_path->head.prev->prev;
-				}
-				else {
-					report_link = report_path->head.prev;
-				}
+				report_link = report_path->head.prev;
 				path_link = path->head.prev;
 
