Index: uspace/app/virtusbkbd/virtusbkbd.c
===================================================================
--- uspace/app/virtusbkbd/virtusbkbd.c	(revision ecf52c4b10488466ad9c3ec623faa7b2c400e3a8)
+++ uspace/app/virtusbkbd/virtusbkbd.c	(revision 2aee3e06057800db871d46dced9fce569bc63061)
@@ -55,5 +55,6 @@
 #include "stdreq.h"
 
-#define LOOPS 5
+/** Pause between individual key-presses in seconds. */
+#define KEY_PRESS_DELAY 2
 #define NAME "virt-usb-kbd"
 
@@ -83,7 +84,32 @@
 }
 
+/** Compares current and last status of pressed keys.
+ *
+ * @warning Has side-efect - changes status_last field.
+ *
+ * @param status_now Status now.
+ * @param status_last Last status.
+ * @param len Size of status.
+ * @return Whether they are the same.
+ */
+static bool keypress_check_with_last_request(uint8_t *status_now,
+    uint8_t *status_last, size_t len)
+{
+	bool same = true;
+	size_t i;
+	for (i = 0; i < len; i++) {
+		if (status_now[i] != status_last[i]) {
+			status_last[i] = status_now[i];
+			same = false;
+		}
+	}
+	return same;
+}
+
 static int on_request_for_data(struct usbvirt_device *dev,
     usb_endpoint_t endpoint, void *buffer, size_t size, size_t *actual_size)
 {
+	static uint8_t last_data[2 + KB_MAX_KEYS_AT_ONCE];
+
 	if (size < 2 + KB_MAX_KEYS_AT_ONCE) {
 		return EINVAL;
@@ -101,4 +127,10 @@
 	}
 	
+	if (keypress_check_with_last_request(data, last_data,
+	    2 + KB_MAX_KEYS_AT_ONCE)) {
+		*actual_size = 0;
+		return EOK;
+	}
+
 	memcpy(buffer, &data, *actual_size);
 	
@@ -152,4 +184,6 @@
 	.ops = &keyboard_ops,
 	.descriptors = &descriptors,
+	.lib_debug_level = 3,
+	.lib_debug_enabled_tags = USBVIRT_DEBUGTAG_ALL,
 	.name = "keyboard"
 };
@@ -177,5 +211,5 @@
 	printf("\n");
 	
-	fibril_sleep(1);
+	fibril_sleep(KEY_PRESS_DELAY);
 }
 
@@ -223,5 +257,5 @@
 	
 	printf("%s: Simulating keyboard events...\n", NAME);
-	while(1){
+	while (1) {
 		kb_process_events(&status, keyboard_events, keyboard_events_count,
 			on_keyboard_change);
