]> xenbits.xen.org Git - xenclient/ioemu-pq.git/commitdiff
[dom0-driver] code cleaning and documentation
authorAlexandre Bique <alexandre.bique@citrix.com>
Tue, 21 Jul 2009 16:46:12 +0000 (16:46 +0000)
committerAlexandre Bique <alexandre.bique@citrix.com>
Tue, 21 Jul 2009 16:46:12 +0000 (16:46 +0000)
master/dom0-driver

index 7bcd95b25a8d10c46acf7b0f41a4943820301386..a222e5d2be869938535770416587773077f8d5c9 100644 (file)
@@ -748,10 +748,10 @@ index 0000000..bdfe37c
 +}
 diff --git a/hid-linux.c b/hid-linux.c
 new file mode 100644
-index 0000000..51f70c2
+index 0000000..73bb956
 --- /dev/null
 +++ b/hid-linux.c
-@@ -0,0 +1,538 @@
+@@ -0,0 +1,555 @@
 +/*
 + * QEMU hid-linux /dev/input driver
 + *
@@ -982,6 +982,24 @@ index 0000000..51f70c2
 +      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)
@@ -989,8 +1007,7 @@ index 0000000..51f70c2
 +          return;
 +
 +    if (hid_linux_driver.has_keyboard || // We have the keyboard
-+        (hid_linux_driver.has_mouse &&   // We have the mouse and track Alt...
-+         (hid_linux_driver.key_status[KEY_LEFTALT] || keycode == KEY_LEFTALT)))
++        hid_linux_check_modifiers_pt())
 +        hid_linux_key_inject(code, keycode);
 +}
 +