]> xenbits.xensource.com Git - xenclient/ioemu-pq.git/commitdiff
Revert "[dom0-driver] Better switch and added an array for the passthrough keys."
authorJean Guyader <jean.guyader@eu.citrix.com>
Mon, 27 Jul 2009 11:21:39 +0000 (12:21 +0100)
committerJean Guyader <jean.guyader@eu.citrix.com>
Mon, 27 Jul 2009 11:21:39 +0000 (12:21 +0100)
This reverts commit 6edae919724e015cf0a368102d72cdf547aa6f86.

master/dom0-driver

index b5a630cbe0fb180f0b36a8516b332f8854d91f9b..37eb5085b8e246c08367ca647f380ee55c72a3f2 100644 (file)
@@ -742,10 +742,10 @@ index 0000000..a747911
 +}
 diff --git a/hid-linux.c b/hid-linux.c
 new file mode 100644
-index 0000000..8b1a477
+index 0000000..9e09f97
 --- /dev/null
 +++ b/hid-linux.c
-@@ -0,0 +1,574 @@
+@@ -0,0 +1,557 @@
 +/*
 + * QEMU hid-linux /dev/input driver
 + *
@@ -839,17 +839,6 @@ index 0000000..8b1a477
 +    KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z
 +};
 +
-+static const uint32_t keycodes_pt[] = {
-+    KEY_LEFTALT, KEY_RIGHTALT,
-+    KEY_LEFTCTRL, KEY_RIGHTCTRL,
-+    KEY_MSDOS,
-+};
-+
-+static uint32_t const * const keycodes_pt_end =
-+    keycodes_pt + sizeof (keycodes_pt) / sizeof (keycodes_pt[0]);
-+
-+
-+
 +static void hid_linux_secure_read(void *opaque);
 +
 +static char keycode2ascii(int keycode)
@@ -1000,10 +989,10 @@ index 0000000..8b1a477
 +    if (!hid_linux_driver.has_mouse)
 +        return false;
 +
-+    for (const uint32_t * k = keycodes_pt; k != keycodes_pt_end; k++)
-+        /* If Alt is pressed or just released, pass through */
-+        if (hid_linux_driver.key_status[*k] || keycode == *k)
-+            return true;
++    /* If Alt is pressed or just released, pass through */
++    if (hid_linux_driver.key_status[KEY_LEFTALT] ||
++        keycode == KEY_LEFTALT)
++        return true;
 +    return false;
 +}
 +
@@ -1132,20 +1121,14 @@ index 0000000..8b1a477
 +
 +void hid_linux_reset_keyboard(void)
 +{
-+    for (int i = 0; i < 256; i++)
-+    {
-+        for (const uint32_t * k = keycodes_pt; k != keycodes_pt_end; k++)
-+            if (i == *k)
-+                goto no_reset;
++    int i = 0;
++
++    for (i = 0; i < 256; i++)
 +      if (hid_linux_driver.key_status[i])
 +      {
 +          hid_linux_key_inject(0, i);
 +          hid_linux_driver.key_status[i] = 0;
 +      }
-+
-+      no_reset:
-+        continue;
-+    }
 +}
 +
 +static void hid_linux_redirect_fds(int *fd, IOHandler *cb)