+}
diff --git a/hid-linux.c b/hid-linux.c
new file mode 100644
-index 0000000..73bb956
+index 0000000..51f70c2
--- /dev/null
+++ b/hid-linux.c
-@@ -0,0 +1,555 @@
+@@ -0,0 +1,538 @@
+/*
+ * QEMU hid-linux /dev/input driver
+ *
+ kbd_put_keycode(keycode & 0x7f);
+}
+
-+/* This function has been introduced to allow some exceptionnal
-+ * pass through. For exemple when you're using ICA and you have
-+ * the mouse, but not the keyboard (the appserver has the keyboard),
-+ * you want to be able to do Alt+Tab inside the PVM even if you
-+ * don't have the keyboard. */
-+static bool hid_linux_check_modifiers_pt(void)
-+{
-+ /* We don't passthrough if we don't have the mouse */
-+ if (!hid_linux_driver.has_mouse)
-+ return false;
-+
-+ /* If Alt is pressed or just released, pass through */
-+ if (hid_linux_driver.key_status[KEY_LEFTALT] ||
-+ keycode == KEY_LEFTALT)
-+ return true;
-+ return false;
-+}
-+
+static void hid_linux_key_event(int code, uint32_t keycode)
+{
+ if (code == 1)
+ return;
+
+ if (hid_linux_driver.has_keyboard || // We have the keyboard
-+ hid_linux_check_modifiers_pt())
++ (hid_linux_driver.has_mouse && // We have the mouse and track Alt...
++ (hid_linux_driver.key_status[KEY_LEFTALT] || keycode == KEY_LEFTALT)))
+ hid_linux_key_inject(code, keycode);
+}
+